[FFmpeg-devel] [FFmpeg-cvslog] fftools/ffmpeg_filter: fix the flags parsing for scaler

Linjie Fu linjie.justin.fu at gmail.com
Sat Aug 7 13:28:27 EEST 2021


On Sat, Aug 7, 2021 at 2:33 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Thu, Aug 05, 2021 at 02:30:32PM +0000, Linjie Fu wrote:
> > ffmpeg | branch: master | Linjie Fu <linjie.justin.fu at gmail.com> | Sun
> Aug  1 18:58:19 2021 +0800| [b3a0548a981db52911dd34d9de254c4fee0a8f79] |
> committer: Linjie Fu
> >
> > fftools/ffmpeg_filter: fix the flags parsing for scaler
> >
> > Scaler relys on "-sws_flags" option to pass the flags to swscale
> > and scale filter. Currently passing "sws_flags=xxx" as a filter
> > option to scaler leads to an incorrect option parsing.
> >
> > Check and change the string to "flags=xxx" and dumped flags information.
> > (Refer to parse_sws_flags())
> >
> > CMD:
> > $ffmpeg -v verbose -i input.mp4 -sws_flags lanczos+bitexact+accurate_rnd
> \
> >         -vf format=yuv420p,scale=800x600 -an -vframes 10 -f md5 -
> >
> > Before:
> > [auto_scaler_0 @ 0x7f96c3808680] w:iw h:ih flags:'' interl:0
> > [auto_scaler_0 @ 0x7f96c3808680] w:1920 h:1080 fmt:yuvj420p sar:0/1 ->
> w:1920 h:1080 fmt:yuv420p sar:0/1 flags:0x0
> > [Parsed_scale_1 @ 0x7f96c3806e40] w:1920 h:1080 fmt:yuv420p sar:0/1 ->
> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x0
> > MD5=ff1d6091690c6fcd36d458d2a9f648ce
> >
> > After:
> > [auto_scaler_0 @ 0x7fe94563b4c0] w:iw h:ih
> flags:'lanczos+bitexact+accurate_rnd' interl:0
> > [auto_scaler_0 @ 0x7fe94563b4c0] w:1920 h:1080 fmt:yuvj420p sar:0/1 ->
> w:1920 h:1080 fmt:yuv420p sar:0/1 flags:0xc0200
> > [Parsed_scale_1 @ 0x7fe945639d00] w:1920 h:1080 fmt:yuv420p sar:0/1 ->
> w:800 h:600 fmt:yuv420p sar:0/1 flags:0xc0200
> > MD5=ff1d6091690c6fcd36d458d2a9f648ce
> >
> > Signed-off-by: Linjie Fu <linjie.justin.fu at gmail.com>
> >
> > >
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b3a0548a981db52911dd34d9de254c4fee0a8f79
> > ---
>
> This breaks
> -i laraShadow_dl.flv  -alphablend checkerboard -qscale 2 -t 0.5 file.avi
>

Thanks. Double checked, this commit should be reverted since options are
parsed and passed to libswscale correctly.
Previous issue I was trying to fix is more like a log print issue rather
than an option parsing issue.
New patch sent to the maillist. Sorry for the revert.

After this commit the output is just black
>
> sample seems here:
> https://samples.ffmpeg.org/FLV/flash_with_alpha/


Does filter_complex support the same usage or there are other methods to
pass  swscale_option?

# ffmpeg -i laraShadow_dl.flv -filter_complex
"sws_flags=bilinear;format=yuv420p" -alphablend checkerboard -y patched.avi

The output is black,  "-alphablend checkerboard" seems not passed to the
auto-inserted scale filter.

- linjie


More information about the ffmpeg-devel mailing list