av_guess_sample_aspect_ratio

Guess 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.

@param format the format context which the stream is part of @param stream the stream which the frame is part of @param frame the frame with the aspect ratio to be determined @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea

extern (C) @nogc nothrow
AVRational
av_guess_sample_aspect_ratio

Meta