The rocDecode FFMpeg decoder utility class

The rocDecode FFMpeg decoder utility class#

The rocDecode FFMpeg decoder utility class, FFMpegVideoDecoder, is used to decode demultiplexed (demuxed) frames on the CPU.

Note

The rocdecode-host package must be installed to use FFMpegVideoDecoder.

FFMpegVideoDecoder uses the FFMpeg video decoding backend to decode frame packets output by the FFMpeg demultiplexer (demuxer). It inherits from the RocVideoDecode utility class and uses many of the same functions.

The FFMpegVideoDecoder() constructor takes the same parameters as RocVideoDecoder except for the first parameter, which is the number of CPU threads rather than the device ID, and the force zero latency parameter, which isn’t supported with the FFMpeg decoder.

Six functions are implemented in FFMpegVideoDecoder: DecodeFrame(), GetFrame(), GetOutputSurfaceInfo(), SaveFrameToFile(), ReleaseFrame(), and ReconfigureDecoder().

DecodeFrame() submits a frame for host-based decoding using the FFMpeg decoder and returns the number of available decoded frames.

Once decoding is done, GetFrame() returns the decoded frame and its timestamp and GetOutputSurfaceInfo() returns a pointer to the metadata associated with the decoded frame.

SaveFrameToFile() saves the decoded output surface to a file.

Once processing is complete, ReleaseFrame() is used to release the frame.

ReconfigureDecoder is used to reconfigure the decoder when the video stream resolution changes.

For information about using the FFMpeg decoder, see Understanding the rocDecode videodecode sample.