[FFmpeg-user] setdar ratio - syntax

Kieran O Leary kieran.o.leary at gmail.com
Sun Nov 25 03:15:41 EET 2018


Hi,

On Sat, Nov 24, 2018 at 11:54 PM Ben Barker <ben at bbarker.co.uk> wrote:
>
> I have previously, and for some years, used the scale and setdar filters as
> below:
>
> ffmpeg -i <some_file> -vf scale=352:288,setdar=352:288 <output_file>
>
This is how I would use it as well so I'm surprised to see this change.

> In the example above, the dar would be set to the ratio 355/288, with the
> setdar passed a ratio separated by a colon.
>
Did you mean 352/288?

> I built ffmpeg from git today, the first time in a while, and found that
> the above no longer worked - with dar set to 1:288 instead, so looking very
> odd when played!
>

Can you share the command line you used along with the full uncut
terminal output?
I can replicate your issue:
$ ./ffmpeg -f lavfi -i testsrc -vf scale=720:576,setdar=4:3 -t 1 ratio.mov
ffmpeg version N-92521-g737b5f5869 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration:
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24,
320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'ratio.mov':
  Metadata:
    encoder         : Lavf58.23.100
    Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 720x576
[SAR 12:5 DAR 3:1], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.40.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=   25 fps=0.0 q=1.9 Lsize=     127kB time=00:00:00.96
bitrate=1079.9kbits/s speed=14.8x
video:126kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.797990%



> Checking the man pages for the latest ffmpeg, the above is indeed no longer
> correct - and following the man page guidance instead, using:
>
> ffmpeg -i <some_file> -vf scale=352:288,setdar=ratio=352/288 <output_file>
>
> Works fine. However, the top line /used/ to work fine as well. Does anybody
> know when this changed?

I tried to search through the commit history but didn't have enough
time and knowledge to figure out when this happened.
I don't see why the previous usage needed to change.

Best,

Kieran.


More information about the ffmpeg-user mailing list