Functions | |
struct AVCodecTag * | avformat_get_riff_video_tags (void) |
struct AVCodecTag * | avformat_get_riff_audio_tags (void) |
AVRational | av_guess_sample_aspect_ratio (AVFormatContext *format, AVStream *stream, AVFrame *frame) |
Guesses the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio. |
The tables are meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the following code:
uint32_t tag = MKTAG('H', '2', '6', '4'); const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; enum CodecID id = av_codec_get_id(table, tag);
AVRational av_guess_sample_aspect_ratio | ( | AVFormatContext * | format, | |
AVStream * | stream, | |||
AVFrame * | frame | |||
) |
Guesses the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio.
Since the frame aspect ratio is set by the codec but the stream aspect ratio is set by the demuxer, these two may not be equal. This function tries to return the value that you should use if you would like to display the frame.
Basic logic is to use the stream aspect ratio if it is set to something sane otherwise use the frame aspect ratio. This way a container setting, which is usually easy to modify can override the coded value in the frames.
format | the format context which the stream is part of | |
stream | the stream which the frame is part of | |
frame | the frame with the aspect ratio to be determined |
Definition at line 4430 of file utils.c.
Referenced by queue_picture().
struct AVCodecTag* avformat_get_riff_audio_tags | ( | void | ) | [read] |
struct AVCodecTag* avformat_get_riff_video_tags | ( | void | ) | [read] |