Demultiplexes a video stream into elementary packets that are passed to the rocDecode parser.
More...
#include <video_demuxer.h>
|
|
AVCodecID | GetCodecID () |
| | Returns the FFmpeg codec ID of the demultiplexed video stream.
|
| |
| | VideoDemuxer (const char *input_file_path) |
| | Constructs a demuxer that reads the video stream from a file path. More...
|
| |
| | VideoDemuxer (StreamProvider *stream_provider) |
| | Constructs a demuxer that reads the video stream from a custom StreamProvider. More...
|
| |
|
| ~VideoDemuxer () |
| | Destroys the demuxer and releases the underlying FFmpeg resources.
|
| |
| bool | Demux (uint8_t **video, int *video_size, int64_t *pts=nullptr) |
| | Extracts the next elementary video packet from the stream, starting at the beginning. More...
|
| |
| bool | Seek (VideoSeekContext &seek_ctx, uint8_t **pp_video, int *video_size) |
| | Seeks to a frame identified by seek_ctx and demuxes it, instead of demuxing sequentially. More...
|
| |
|
const uint32_t | GetWidth () const |
| | Returns the width, in pixels, of the demultiplexed video stream.
|
| |
|
const uint32_t | GetHeight () const |
| | Returns the height, in pixels, of the demultiplexed video stream.
|
| |
|
const uint32_t | GetChromaHeight () const |
| | Returns the chroma plane height, in pixels, for the stream's chroma format.
|
| |
|
const uint32_t | GetBitDepth () const |
| | Returns the bit depth of the demultiplexed video stream.
|
| |
|
const uint32_t | GetBytePerPixel () const |
| | Returns the number of bytes per pixel for the stream's chroma format.
|
| |
|
const uint32_t | GetBitRate () const |
| | Returns the bit rate, in bits per second, reported by the input stream.
|
| |
|
const double | GetFrameRate () const |
| | Returns the real (base) frame rate of the demultiplexed video stream.
|
| |
|
bool | IsVFR () const |
| | Returns true if the stream is variable frame rate (its real and average frame rates differ).
|
| |
| int64_t | TsFromTime (double ts_sec) |
| | Converts a timestamp in seconds to the stream's internal time base units. More...
|
| |
| int64_t | TsFromFrameNumber (int64_t frame_num) |
| | Converts a frame number to the stream's internal time base units, using the stream's frame rate. More...
|
| |
Demultiplexes a video stream into elementary packets that are passed to the rocDecode parser.
◆ VideoDemuxer() [1/2]
| VideoDemuxer::VideoDemuxer |
( |
const char * |
input_file_path | ) |
|
|
inline |
Constructs a demuxer that reads the video stream from a file path.
- Parameters
-
| input_file_path | Path to the input video file. |
◆ VideoDemuxer() [2/2]
Constructs a demuxer that reads the video stream from a custom StreamProvider.
- Parameters
-
| stream_provider | The stream provider to demux from. |
◆ Demux()
| bool VideoDemuxer::Demux |
( |
uint8_t ** |
video, |
|
|
int * |
video_size, |
|
|
int64_t * |
pts = nullptr |
|
) |
| |
|
inline |
Extracts the next elementary video packet from the stream, starting at the beginning.
- Parameters
-
| video | Set to a pointer to the extracted packet data. |
| video_size | Set to the size, in bytes, of the extracted packet. |
| pts | Optional; if non-null, set to the packet's presentation timestamp. |
- Returns
true if a packet was extracted, false at end of stream or on error.
◆ Seek()
| bool VideoDemuxer::Seek |
( |
VideoSeekContext & |
seek_ctx, |
|
|
uint8_t ** |
pp_video, |
|
|
int * |
video_size |
|
) |
| |
|
inline |
Seeks to a frame identified by seek_ctx and demuxes it, instead of demuxing sequentially.
- Parameters
-
| seek_ctx | Describes the frame to seek to (by frame number or timestamp) and the seek mode; also receives the presentation timestamp, duration, and decoded frame count for the found frame. |
| pp_video | Set to a pointer to the demuxed packet data at the sought frame. |
| video_size | Set to the size, in bytes, of the demuxed packet. |
- Returns
true on success.
◆ TsFromFrameNumber()
| int64_t VideoDemuxer::TsFromFrameNumber |
( |
int64_t |
frame_num | ) |
|
|
inline |
Converts a frame number to the stream's internal time base units, using the stream's frame rate.
- Parameters
-
- Returns
- The equivalent timestamp in the stream's time base units.
◆ TsFromTime()
| int64_t VideoDemuxer::TsFromTime |
( |
double |
ts_sec | ) |
|
|
inline |
Converts a timestamp in seconds to the stream's internal time base units.
- Parameters
-
| ts_sec | Timestamp, in seconds. |
- Returns
- The equivalent timestamp in the stream's time base units.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocdecode/checkouts/develop/projects/rocdecode/utils/video_demuxer.h