#9192(ffmpeg:new): Command line switch sws_dither doesn't allow "none"
#9192: Command line switch sws_dither doesn't allow "none" -------------------------------------+------------------------------------- Reporter: | Type: defect Videogamer555 | Status: new | Priority: important Component: ffmpeg | Version: | unspecified Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: When using the -sws_dither command line switch to disable dithering with the value "none", it still behaves as if it was using the default value of "ed" (which is error diffusion dithering). How to reproduce: {{{ % ffmpeg -i video_in.avi -swf_dither none animation.gif ffmpeg version is latest nightly Windows build "N-101948-g870bfe16a1 -ffmpeg-windows-build-helpers" built on April 14, 2021 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+---------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: important | Component: ffmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+---------------------------------- Changes (by Videogamer555): * version: unspecified => git-master -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+---------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: important | Component: ffmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+---------------------------------- Comment (by Videogamer555): Replying to [ticket:9192 Videogamer555]:
Summary of the bug: When using the -sws_dither command line switch to disable dithering with the value "none", it still behaves as if it was using the default value of "ed" (which is error diffusion dithering). How to reproduce: {{{ % ffmpeg -i video_in.avi -swf_dither none animation.gif ffmpeg version is latest nightly Windows build "N-101948-g870bfe16a1 -ffmpeg-windows-build-helpers" built on April 14, 2021 }}}
Note that where it says -swf_dither, it SHOULD say -sws_dither. I accidentally typed an "f" where there should be an "s". But I can't edit my original post, so I'm putting the correction here as a comment. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Changes (by cehoyos): * priority: important => minor * component: ffmpeg => swscale Comment: Does {{{-sws_dither 0}}} work? -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Anton1699): This is the relevant part of `ffmpeg -h filter=scale`: {{{ -sws_dither <int> E..V....... set dithering algorithm (from 0 to 6) (default auto) auto 1 E..V....... leave choice to sws bayer 2 E..V....... bayer dither ed 3 E..V....... error diffusion a_dither 4 E..V....... arithmetic addition dither x_dither 5 E..V....... arithmetic xor dither }}} Looks like `auto` isn't a valid value. I guess you could try `-sws_dither 0` instead. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Videogamer555): Replying to [comment:3 cehoyos]:
Does {{{-sws_dither 0}}} work? I tried 0, and it behaves the same as none or ed. It still dither's via error diffusion.
-- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Videogamer555): Replying to [comment:4 Anton1699]:
This is the relevant part of `ffmpeg -h filter=scale`: {{{ -sws_dither <int> E..V....... set dithering algorithm (from 0 to 6) (default auto) auto 1 E..V....... leave choice to sws bayer 2 E..V....... bayer dither ed 3 E..V....... error diffusion a_dither 4 E..V....... arithmetic addition dither x_dither 5 E..V....... arithmetic xor dither }}}
Looks like `none` isn't a valid value. I guess you could try `-sws_dither 0` instead.
But "none" is SUPPOSED TO BE a valid value. In the official documentation at https://ffmpeg.org/ffmpeg-scaler.html it says that for the sws_dither command line switch, that "none" is a valid value. Here's a block quote of the relevant section there. {{{ sws_dither Set the dithering algorithm. Accepts one of the following values. Default value is ‘auto’. ‘auto’ automatic choice ‘none’ no dithering ‘bayer’ bayer dither ‘ed’ error diffusion dither ‘a_dither’ arithmetic dither, based using addition ‘x_dither’ arithmetic dither, based using xor (more random/less apparent patterning that a_dither). }}} The bug here is that the software is not behaving as the official documentation states. I can think of several ways this may occur. The software is supposed to behave as the docs say, but the programmers forgot to write the functionality into the code. Or this was part of a beta or experimental feature that never got added, but was mistakenly put in the official documentation. Or was an old feature that has long ago been removed, but the documentation hasn't been updated accordingly. This feature is planned for some future version, but the person writing the documentation mistakenly documented this feature before it was actually in the software. Whatever the case may be, the mismatch of the documentation and the software's actual features is a bug that needs to be fixed. Either add the feature to the software, or remove the text describing the feature from the official documentation. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Balling):
The bug here is that the software is not behaving as the official documentation states.
"Accepts one of the following values" is also a lie, BTW. For example, print_info can be combined with other options and so is accurate_rnd that fixes bgr to yuv420p and so is bitexact which fixes some of jpeg scaling. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
"Accepts one of the following values" is also a lie, BTW. For example,
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: (none) Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Anton1699): print_info can be combined with other options and so is accurate_rnd that fixes bgr to yuv420p and so is bitexact which fixes some of jpeg scaling (though the last one I am not so sure, D:) ). `-sws_dither` and `-sws_flags` are two different things though. `-sws_flags` is supposed to take multiple flags and the documentation clearly says “It accepts the following values” -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: (none) Type: defect | Status: new Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Valerii): Well, also see https://trac.ffmpeg.org/ticket/3345#comment:1, it says that dithering is expected and cannot be turned off. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: (none) Type: defect | Status: open Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Changes (by Balling): * status: new => open Comment: Looks like this 75285325500672a806ba93bfc1e0ace9c9e566c1 and this fa1e158ef648cc080c5c46a620d2d6aaad72ea06 makes it better but these should be applied I suppose to fix propogation. [https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=4493&state=*] -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:10> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" ---------------------------------------+----------------------------------- Reporter: Videogamer555 | Owner: (none) Type: defect | Status: open Priority: minor | Component: swscale Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------------+----------------------------------- Comment (by Balling): So none always means 0. https://github.com/FFmpeg/FFmpeg/blob/fce01276422a0e121d61aec811ee1773f9013b... So there is no bug. If anything ‘none’ no dithering should be removed from documentation because it shadows global variable. Zero is good. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:11> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9192: Command line switch sws_dither doesn't allow "none" -------------------------------------+------------------------------------- Reporter: | Owner: Niklas Videogamer555 | Haas <git@…> Type: defect | Status: closed Priority: minor | Component: swscale Version: git-master | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by Niklas Haas <git@…>): * owner: (none) => Niklas Haas <git@…> * resolution: => fixed * status: open => closed Comment: In [changeset:"5ca5bbd462bcd8040b35957ccc00d0392e6de57d/ffmpeg" 5ca5bbd4/ffmpeg]: {{{#!CommitTicketReference repository="ffmpeg" revision="5ca5bbd462bcd8040b35957ccc00d0392e6de57d" swscale/options: add -sws_dither none alias While this one was technically supported on account of the generic options code allowing "none" as a valid alias for 0, not having it listed here meant it never showed up in e.g. the -h output, and is also inconsistent with other places in the code that generally add an explicit alias with appropriate documentation. Reduces user confusion at negligible cost. Fixes: #9192 Signed-off-by: Niklas Haas <git@haasn.dev> Sponsored-by: Sovereign Tech Fund }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/9192#comment:12> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg