[FFmpeg-devel] [PATCH] ffprobe: fix sample aspect ratio output when sample aspect ratio is not set

Robert Krüger krueger
Thu Apr 15 15:05:30 CEST 2010

On 15.04.2010, at 14:02, Michael Niedermayer wrote:

> On Thu, Apr 15, 2010 at 01:16:05PM +0200, Robert Kr?ger wrote:
>> the following patch fixes current behaviour where for example for all ffmpeg-generated mjpeg files sample aspect ratio is output as 0:1 and display aspect ratio is computed accordingly (i.e. wrong).
> undefined and 1:1 are 2 different things

What currently happens is that obviously for some files with a sample aspect ratio of 1:1 the corresponding struct is filled correctly and for some it seems to be filled with 0:1.  I looked at the way this is treated in avcodec_string in utils.c and line 857 suggests that it treats a zero numerator for sample aspect ratio as 1:1 at least I guess that's what most people would think given the output of avcodec string but that assumption might be wrong.

if that is incorrect, would it make more sense to have ffprobe output N/A for sample aspect ratio if the numerator isn't set?

Another thing: Is there a reason that the values for sample_aspect_ratio are not filled for mjpeg files generated by ffmpeg or is this a bug that should be looked at?

More information about the ffmpeg-devel mailing list