videoIO : Wrapper for ffmpeg libavcodec

This is a wrapper for ffmpeg libraries (libavcodec, libavformat) and provides an easy to use API for reading/writing videofiles. videoIO is object oriented interface to libavcodec and thus provides the simplest way to encode and decode videos.

In short, using videoIO looks like -

#include “videoIO.h”…videoIn v;v.open( char_arr_filename );…v.seek( some_int_position_optional );…do{	char_arr_buf = v.getFrame();	display_the_frame_on_screen( char_arr_buf ); 	// or just do v.saveFrame(”test.pgm”);}while( v.next() );…v.close();…

and program for reading from a video and writing to another video looks like -

#include “videoIO.h”…videoIn vi;videoOut vo;vi.open( “input.avi” );vo.setSize( vi.width(), vi.height() );vo.open( “output.avi” );

do{	vo.addFrame( vi.getFrame );}while( vi.next() );

vi.close();vo.close();…

download the API and example codes from here.

This wrapper includes modification of code provided by Martin Bohme : here and here and code from example programs available in ffmpeg tarball.

Note : The provided wrapper is written for ffmpeg version 0.4.9-pre1, and might not work for any other version. Also this api is still in beta version.. it lack lots of features and you will probably find lots of bugs. If you make any improvements to it, pls let me know. i will be happy to release them with next version.

TODO :
* implement an easy to use Time-Management API with videoIO for seeking by time, forward, rewind, etc operations.
* audio support

ChangeLog :

Nov 08, 2005 : version 0.2b	Can Write/Encode videosSep 24, 2005 : version 0.1b	Can Read/Decode videos

Leave a Reply