[FFmpeg-trac] #9947(undetermined:new): Misbehaving Curves Filter

FFmpeg trac at avcodec.org
Tue Sep 27 18:39:17 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            |
-------------------------------------+-------------------------------------

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("https://github.com/python-ffmpegio/python-
> ffmpegio/sandbox/ffmpeg_bug/gimp_curves.png?raw=true")]]
>
> 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(https://github.com/python-ffmpegio/python-
> ffmpegio/sandbox/ffmpeg_bug/ffmpeg_curves.png?raw=true)]]
>
> Here are the links to the input image file and the full log file of the
> above command:
>
> [https://github.com/python-ffmpegio/python-
> ffmpegio/blob/sandbox/sandbox/ffmpeg_bug/input.png Input PNG]
> [https://github.com/python-ffmpegio/python-
> ffmpegio/blob/sandbox/sandbox/ffmpeg_bug/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)]]

 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`

--
Comment (by kesh):

 Changed links to attached files (if works
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9947#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list