25 #ifndef _VideoSource_FFMPEGVideo_H_
26 #define _VideoSource_FFMPEGVideo_H_
37 #include <Base/Image/ImageBase.hh>
55 bool Open(
const char *file);
62 bool Init(
int width = 0,
int height = 0,
63 PixelFormat pixFmt = PIX_FMT_RGB24,
unsigned int streamIndex = 0);
84 void Seek(int64_t time);
EColorModel
These are the most often used color models.
bool Open(const char *file)
Open file and retreive info.
AVRational TimeBase()
Returns the TimeBase of the video stream.
unsigned int GetCurrentDTS() const
Returns the current decoding timestamp.
bool Init(int width=0, int height=0, PixelFormat pixFmt=PIX_FMT_RGB24, unsigned int streamIndex=0)
Select video stream, initialize stuff and set destination size and pixel format.
void Close()
Close file and free buffers.
AVFormatContext * _fmtCtx
std::vector< int > _vidStreams
void Seek(int64_t time)
Seeks to time which is given in TimeBase units.
AVCodecContext * _codecCtx
unsigned int CountVideoStreams()
Return number of video streams.
~VideoSource_FFMPEGVideo()
Class for extracting frames from video files using FFMpeg, analog to class DShowVideo.
int Width()
Return width of selected video stream.
unsigned int _streamIndex
static PixelFormat Colormodel2PixFmt(ImageBase::EColorModel cm)
Maps BIAS colormodels to ffmpeg pixelformats.
std::string ErrMsg()
Returns last error message.
VideoSource_FFMPEGVideo()
unsigned int GetLength() const
Returns the length of the video in TimeBase units.
int Height()
Return height of selected video stream.
This is the base class for images in BIAS.
bool GetFrame(BIAS::ImageBase &img)
Retreive the next frame from the video.