[Libav-user] Getting the correct display resolution

Nicolas George george at nsup.org
Wed May 6 20:32:50 EEST 2020


Info || Non-Lethal Applications (12020-05-06):
> There’s AVVideoCodecContext->width/height,

That is what you want.

> coded_width/coded_height

Encode a 126x126 video with x264, then use ffprobe to examine it and
compare coded_width and width.

> and also sample_aspect_ratio.

PAL DVDs are 720×576, meant for 16:9. Do the math.

The sample_aspect_ratio for PAL DVDs is 64/45. Do some more math.

> There’s also AVStream->sample_aspect_ratio, display_aspect_ratio and
> AVFrame->sample_aspect_ratio.

These come from the stream, i.e. are obtained from the headers of the
encapsulation format. The data in AVCodecContext comes after decoding
the actual payload.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200506/f6712ca5/attachment.sig>


More information about the Libav-user mailing list