[FFmpeg-devel] [PATCH 1/1] [RFC] ffprobe: report DAR even if SAR is undefined

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Apr 16 01:07:53 EEST 2018

2018-04-15 16:42 GMT+02:00, Marton Balint <cus at passwd.hu>:
> On Sun, 15 Apr 2018, Timo Teräs wrote:
>> Calculate DAR with assumed SAR 1:1 when SAR is undefined. Same
>> assumption is done in ffplay to create the play window. Usually
>> DAR is more useful metadata than SAR when e.g. choosing which
>> media of multiple versions to use to fit the display.
>> Normally undefined SAR means 1:1. E.g. in mov/mp4 files there's
>> 'pasp' atom to explicitly define SAR. If that is not specified,
>> the video codec's SAR should be used. Should it be also undefined,
>> the SAR should be assumed to be 1:1. It makes sense to not change
>> SAR in the demux info, so ffmpeg can make copies with matching
>> atom structure and codec extra data. So the simplest way to
>> report DAR is assume SAR 1:1 when undefined.
>> Signed-off-by: Timo Teräs <timo.teras at iki.fi>
>> ---
>> This applies on top of the previous DAR/SAR reporting fix:
>> https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228141.html
>> For more details behind this patch, see:
>> https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228146.html
>> This seemed to be the most simple and logical fix. Alternatively,
>> we could add a new 'effective_display_aspect_ratio' or add a flag
>> to enable this assumption if the existing functionality should be
>> kept unchanged. I felt this would be the most sensible thing to do.
>> I am happy this if there's a more desirable approach to the issue.
>> Hopefully this and the DAR/SAR reporting fix can be applied before
>> next release tag. Thanks for considering!
> I don't think it's good idea to generally assume 1:1 display_aspect_ratio
> for every undefined sample aspect ratio.

I don't think that this is what the patch does (and it would definitely
be wrong and not what FFplay does), I don't know if the patch is a
good idea though.

Carl Eugen

More information about the ffmpeg-devel mailing list