36 #include <VideoSource/VideoSource_FFmpeg.hh>
37 #include <Base/Image/ImageBase.hh>
38 #include <Base/Image/ImageIO.hh>
39 #include <Base/Common/FileHandling.hh>
45 int main(
int argc,
char* argv[])
51 if(argc < 2) videoFile =
"test.avi";
52 else videoFile = argv[1];
53 cout <<
"Opening video: "<<videoFile<<endl;
56 cout <<
"Error opening file:" << vid.
GetError()<<endl;
59 cout <<
"Initializing image..." << endl;
68 cout <<
"Getting frame " << i <<
"..." << endl;
71 cout <<
"Writing frame "<<i<<
" to disk..." << endl;
73 cout <<
"Error writing frame!" << endl;
79 cout <<
"Closing video..." << endl;
virtual int InitImage(BIAS::ImageBase &Image)
virtual int OpenDevice(const char *filename)
Open video file.
virtual int GrabSingle(Camera< unsigned char > &image)
Get the next frame from the video file.
Simple video decoding of video files using FFmpeg library.
std::string GetError()
Get the last error message.
static std::string LeadingZeroString(const int &n, const unsigned int &digits=DEFAULT_LEADING_ZEROS)
Create a string with leading zeroes from number.
virtual int PreGrab()
Do last preparations before grabbing (e.g. start ISO transfer)
virtual int CloseDevice()
Close video file.