[FFmpeg-devel] Scale filter bug

Michael Niedermayer michaelni at gmx.at
Sun Dec 11 03:37:44 CET 2011

On Fri, Dec 09, 2011 at 08:01:26PM +0500, Alexander Bokovikov wrote:
> Hi, All,
> The scale filer being applied to produce M4V or MP4 file format
> inserts wrong pixel aspect ratio box, and incorrectly sets the frame
> size in the track header box. As a result target aspect ratio is the
> same as source file aspect ratio, though I've defined target width
> and height explicitly. The same effect appears if I use -s WxH
> parameter instead of -vf scale=W:H one.
> As I believe the problem is here:
> [SAR 25:36 DAR 5:3]
> instead of
> [SAR 1:1 DAR 12:5]
> Changing the values by manual boxes editing I get correct movie.
> I.e. the problem isn't in a wrong stream encoding, but just in wrong
> MP4 boxes writing. Taking into account that 12:5 = (36x5)/(25x3)
> (see digits above), I believe the bug is in these calculations -
> wrong digits are at wrong places. Something like that.
> Here is the source FLV file:
> http://home.bokovikov.com/ffmpeg/video5.flv
> Here is converted M4V file:
> http://home.bokovikov.com/ffmpeg/video5.m4v
> Here is the command line:
> ./ffmpeg -i video5.flv -f ipod -vcodec libx264 -vprofile baseline -
> level 30 -maxrate 10000000 -bufsize 10000000 -vf scale=720:300
> -acodec copy -threads 0 -y video5.m4v

Ive looked at this and i think theres maybe a misunderstanding.
the scale filter doesnt change the aspect based on the assumtation that
the aspect reported by the input is correct.
If your file is "broken" and contains an incorrect aspect then
overriding the aspect with -vf setdar=12:5 is the correct thing to do.
you dont need to scale at all

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111211/c2986664/attachment.asc>

More information about the ffmpeg-devel mailing list