Decode a movie using ffmpeg's libavformat packet streaming API. More...
#include <Media/FfmpegPacketDecoder.H>
Public Member Functions | |
FfmpegPacketDecoder (const char *fname, const bool preload) | |
Construct from a given filename. | |
~FfmpegPacketDecoder () | |
Virtual destructor for safe inheritance. | |
virtual int | apparentFrameNumber () const |
Get the "apparent" frame number. | |
virtual GenericFrameSpec | peekFrameSpec () |
Get the specifications of the movie frames. | |
virtual VideoFrame | readVideoFrame () |
Get the next raw VideoFrame from the stream. | |
virtual Image< PixRGB< byte > > | readRGB () |
Read an RGB image from the stream. | |
virtual bool | readAndDiscardFrame () |
Read a frame from the stream and discard it. |
Decode a movie using ffmpeg's libavformat packet streaming API.
Definition at line 65 of file FfmpegPacketDecoder.H.
FfmpegPacketDecoder::FfmpegPacketDecoder | ( | const char * | fname, | |
const bool | preload | |||
) |
Construct from a given filename.
Definition at line 128 of file FfmpegPacketDecoder.C.
References ASSERT.
FfmpegPacketDecoder::~FfmpegPacketDecoder | ( | ) |
Virtual destructor for safe inheritance.
Definition at line 291 of file FfmpegPacketDecoder.C.
int FfmpegPacketDecoder::apparentFrameNumber | ( | ) | const [virtual] |
Get the "apparent" frame number.
This function takes into account whether or not the next frame will be a push-back frame
Implements MovieDecoder.
Definition at line 314 of file FfmpegPacketDecoder.C.
GenericFrameSpec FfmpegPacketDecoder::peekFrameSpec | ( | ) | [virtual] |
Get the specifications of the movie frames.
Implements MovieDecoder.
Definition at line 323 of file FfmpegPacketDecoder.C.
References ASSERT, and convertAVPixelFormatToVideoFormat().
Referenced by readRGB(), and readVideoFrame().
bool FfmpegPacketDecoder::readAndDiscardFrame | ( | ) | [virtual] |
Read a frame from the stream and discard it.
If you know you are going to discard the frame (e.g. to skip ahead to a certain frame number, or to count the frame), then it is more efficient to call readAndDiscardFrame() than to call readVideoFrame() or readRGB() but ignore the result.
Implements MovieDecoder.
Definition at line 395 of file FfmpegPacketDecoder.C.
Read an RGB image from the stream.
Implements MovieDecoder.
Definition at line 382 of file FfmpegPacketDecoder.C.
References convertAVFrameToRGB(), and peekFrameSpec().
VideoFrame FfmpegPacketDecoder::readVideoFrame | ( | ) | [virtual] |
Get the next raw VideoFrame from the stream.
Implements MovieDecoder.
Definition at line 369 of file FfmpegPacketDecoder.C.
References convertAVFrameToVideoFrame(), and peekFrameSpec().