Discussion:
[FFmpeg-user] setdar ratio - syntax
Ben Barker
2018-11-24 23:47:09 UTC
Permalink
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>

In the example above, the dar would be set to the ratio 355/288, with the
setdar passed a ratio separated by a colon.

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!

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?
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.
Kieran O Leary
2018-11-25 01:15:41 UTC
Permalink
This post might be inappropriate. Click to display it.
Gyan Doshi
2018-11-25 08:01:53 UTC
Permalink
Post by Kieran O Leary
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.
Since ':' is used to delimit options within filters, the colon should be
escaped and the string quoted i.e. 'X\:Y', which works for me.

Gyan

_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffm
Kieran O Leary
2018-11-25 08:44:25 UTC
Permalink
Post by Gyan Doshi
Post by Kieran O Leary
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.
Since ':' is used to delimit options within filters, the colon should be
escaped and the string quoted i.e. 'X\:Y', which works for me.
Of course, my bad - I think I was posting too late ;) Thanks Gyan.
I just checked my scripts and I never use colons as the delimiter, I
use slashes:

$ ./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
File 'ratio.mov' already exists. Overwrite ? [y/N] y
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 16:15 DAR 4:3], 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=15.6x
video:126kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.797990%

-Kieran
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsubscribe"
Ben Barker
2018-11-25 11:12:27 UTC
Permalink
Yep - just checked:

Slashes do indeed work as expected, even if the "ratio" parameter is left
out. However, I have left the "ratio" in for the moment, since it is what
the manual suggests, so less likelihood of future problems!
Post by Kieran O Leary
Post by Gyan Doshi
Post by Kieran O Leary
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.
Since ':' is used to delimit options within filters, the colon should
be
Post by Gyan Doshi
escaped and the string quoted i.e. 'X\:Y', which works for me.
Of course, my bad - I think I was posting too late ;) Thanks Gyan.
I just checked my scripts and I never use colons as the delimiter, I
$ ./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)
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
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
File 'ratio.mov' already exists. Overwrite ? [y/N] y
Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
encoder : Lavf58.23.100
Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 720x576
[SAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
encoder : Lavc58.40.100 mpeg4
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=15.6x
video:126kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.797990%
-Kieran
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-use
Ben Barker
2018-11-25 11:28:32 UTC
Permalink
Sorry....typo on my part - I meant "dar" not "ratio"

So I now have "setdar=dar=x/y"

It seems that "setdar=x/y" would also work in exactly the same way

However, "setdar=x:y" will not work, though it used to. Doesn't matter -
it's working now!
Post by Ben Barker
Slashes do indeed work as expected, even if the "ratio" parameter is left
out. However, I have left the "ratio" in for the moment, since it is what
the manual suggests, so less likelihood of future problems!
Post by Kieran O Leary
Post by Gyan Doshi
Post by Kieran O Leary
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.
Since ':' is used to delimit options within filters, the colon should
be
Post by Gyan Doshi
escaped and the string quoted i.e. 'X\:Y', which works for me.
Of course, my bad - I think I was posting too late ;) Thanks Gyan.
I just checked my scripts and I never use colons as the delimiter, I
$ ./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)
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
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
File 'ratio.mov' already exists. Overwrite ? [y/N] y
Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
encoder : Lavf58.23.100
Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 720x576
[SAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
encoder : Lavc58.40.100 mpeg4
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=15.6x
video:126kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.797990%
-Kieran
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user
Moritz Barsnick
2018-11-25 12:32:32 UTC
Permalink
Post by Ben Barker
However, "setdar=x:y" will not work, though it used to. Doesn't matter -
it's working now!
From a quick glance, this commit changed that behavior:

https://github.com/FFmpeg/FFmpeg/commit/88fd836a015a5f3380df74592e440e7d1e5b8000

(included from ffmpeg 4.0 onwards).

The (allowed) syntax indeed used to be
$ ffmpeg [...] -vf setdar=dar_num=4:dar_den=3 [...]
which would have corresponded to
setdar=4:3

(two separate parameters, coincidentally separated by a colon).

But the latter syntax should have given a warning since ffmpeg 2.0.

Moritz
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subjec

Loading...