setdar ratio - syntax

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

setdar ratio - syntax

Ben Barker
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
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Kieran O Leary
Hi,

On Sat, Nov 24, 2018 at 11:54 PM Ben Barker <[hidden email]> 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.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Gyan Doshi
  On 25-11-2018 06:45 AM, Kieran O Leary wrote:

> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Kieran O Leary
On Sun, Nov 25, 2018 at 8:02 AM Gyan Doshi <[hidden email]> wrote:

>
>   On 25-11-2018 06:45 AM, Kieran O Leary wrote:
>
> > 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Ben Barker
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!



On Sun, Nov 25, 2018 at 8:44 AM Kieran O Leary <[hidden email]>
wrote:

> On Sun, Nov 25, 2018 at 8:02 AM Gyan Doshi <[hidden email]> wrote:
> >
> >   On 25-11-2018 06:45 AM, Kieran O Leary wrote:
> >
> > > 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
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Ben Barker
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!

On Sun, Nov 25, 2018 at 11:12 AM Ben Barker <[hidden email]> wrote:

> 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!
>
>
>
> On Sun, Nov 25, 2018 at 8:44 AM Kieran O Leary <[hidden email]>
> wrote:
>
>> On Sun, Nov 25, 2018 at 8:02 AM Gyan Doshi <[hidden email]> wrote:
>> >
>> >   On 25-11-2018 06:45 AM, Kieran O Leary wrote:
>> >
>> > > 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
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: setdar ratio - syntax

Moritz Barsnick
On Sun, Nov 25, 2018 at 11:28:32 +0000, Ben Barker wrote:
> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".