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

Michael Niedermayer michaelni
Fri Apr 16 18:16:56 CEST 2010

On Thu, Apr 15, 2010 at 03:05:30PM +0200, Robert Kr?ger wrote:
> 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.

If a field is filled incorrectly a bugreport is needed

>  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

no it does not

> 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?

a mjpeg file generated by ffmpeg does not contain a sample_aspect_ratio
because its a file made of bytes and not a c structure.
yes i know you meant something else but i dont know what


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100416/cf39f842/attachment.pgp>

More information about the ffmpeg-devel mailing list