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

FFmpeg trac at avcodec.org
Tue Sep 27 18:36:11 EEST 2022

#9947: Misbehaving Curves Filter
             Reporter:  kesh         |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  curves       |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 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)]`


 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:


 Here are the links to the input image file and the full log file of the
 above command:

 ffmpegio/blob/sandbox/sandbox/ffmpeg_bug/input.png Input PNG]
 ffmpegio/blob/sandbox/sandbox/ffmpeg_bug/ffmpeg.log FFmpeg Log]

 This command was tested on `ffmpeg version 5.1-essentials_build-
Ticket URL: <https://trac.ffmpeg.org/ticket/9947>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list