[FFmpeg-trac] #9947(undetermined:new): Misbehaving Curves Filter
FFmpeg
trac at avcodec.org
Tue Sep 27 18:41:36 EEST 2022
#9947: Misbehaving Curves Filter
-------------------------------------+-------------------------------------
Reporter: kesh | Owner: (none)
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: curves | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by kesh:
Old description:
> Summary of the bug:
>
> The curves filter appears to produce a spline, which is far from that of
> the GIMP's curves' tool.
>
> A failing case:
>
> To illustrate, I have a 2-point curve in GIMP: `[(7,152),(65,234)]`
>
> [[Image(gimp_curves.png)]]
>
> These points normalize to `[(0.027450980392156862, 0.596078431372549),
> (0.2549019607843137, 0.9176470588235294)]`
>
> Accordingly, I run the following FFmpeg command on a single-row input
> image of increasing pixel values to get the curve (so I can plot it
> easily in Python, rather than getting gnuplot setup)
>
> {{{
> ffmpeg -report -nostdin -hide_banner -pix_fmt gray -i input.png \
> -vf "curves=m='0.0/0.0 0.027450980392156862/0.596078431372549
> 0.2549019607843137/0.9176470588235294 1.0/1.0'" \
> -f rawvideo -frames:v 1 -pix_fmt gray
> }}}
>
> Then plotting the input vs output pixel values gave me this curve:
>
> [[Image(ffmpeg_curves.png)]]
>
> Here are the links to the input image file and the full log file of the
> above command:
>
> [input.png Input PNG]
> [ffmpeg.log FFmpeg Log]
>
> This command was tested on `ffmpeg version 5.1-essentials_build-
> www.gyan.dev`
New description:
Summary of the bug:
The curves filter appears to produce a spline, which is far from that of
the GIMP's curves' tool.
A failing case:
To illustrate, I have a 2-point curve in GIMP: `[(7,152),(65,234)]`
[[Image(gimp_curves.png)]]
These points normalize to `[(0.027450980392156862, 0.596078431372549),
(0.2549019607843137, 0.9176470588235294)]`
Accordingly, I run the following FFmpeg command on a single-row input
image of increasing pixel values to get the curve (so I can plot it easily
in Python, rather than getting gnuplot setup)
{{{
ffmpeg -report -nostdin -hide_banner -pix_fmt gray -i input.png \
-vf "curves=m='0.0/0.0 0.027450980392156862/0.596078431372549
0.2549019607843137/0.9176470588235294 1.0/1.0'" \
-f rawvideo -frames:v 1 -pix_fmt gray
}}}
Then plotting the input vs output pixel values gave me this curve:
[[Image(ffmpeg_curves.png)]]
Descriptions of the other attachments:
* input.png: Input single-row image
* ffmpeg.log: FFmpeg log file generated by `-report`
This command was tested on `ffmpeg version 5.1-essentials_build-
www.gyan.dev`
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9947#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list