Opened 20 hours ago

Last modified 3 hours ago

#11256 new task

How to use "curves" filter with "hwupload" in FFmpeg?

Reported by: elias tsolis Owned by:
Priority: normal Component: avfilter
Version: 7.0 Keywords: curves
Cc: MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by elias tsolis)

currently, i use this, however, i am unable to run it specifying points in curves. Is any option to use a gnuplot file directly? or to extract smplayer options on brightness, gamma etc. to use them with ffmpeg somehow?

for vids in *.avi; do ffmpeg -hwaccel vaapi -hwaccel_output_format yuv420p -vaapi_device /dev/dri/renderD128 -i "$vids" -vf 'curves=preset=lighter,setpts=2*PTS,format=nv12,hwupload,scale_vaapi=w=2560:h=1440:format=nv12' -strict experimental -c:v hevc_vaapi -b:v 20M -video_track_timescale 90000 "a_${vids/.*}.mp4"; done;

debian trixie linux,
ffmpeg version 7.0.2-3

Change History (7)

comment:1 by elias tsolis, 20 hours ago

Version: unspecified7.0

comment:2 by elias tsolis, 20 hours ago

Description: modified (diff)

comment:3 by MasterQuestionable, 13 hours ago

Cc: MasterQuestionable added
Component: undeterminedavfilter
Keywords: curves added
Summary: how i can use curves options in hwupload in ffmpeg ?How to use "curves" filter with "hwupload" in FFmpeg?
Type: defecttask

͏    Interpreted filter-chain:
͏    curves=preset=lighter,
͏    setpts=2*PTS,
͏    format=nv12,
͏    hwupload,
͏    scale_vaapi=w=2560:h=1440:format=nv12

͏    Refer:
͏    https://ffmpeg.org/ffmpeg-filters.html#curves
͏    etc.

comment:4 by elias tsolis, 9 hours ago

i have read, and tried different combinations, nothing worked.
this does not work -->
curves=blue='0/0 0.5/0.58 1/1'
or curves=all='0/0,0.5/0.58,1/1'
or curves=all='0/0:0.5/0.58:1/1'
inside this command:

for vids in *.avi; do ffmpeg -hwaccel vaapi -hwaccel_output_format yuv420p -vaapi_device /dev/dri/renderD128 -i "$vids" -vf 'curves=all='0/0 0.5/0.58 1/1',setpts=2*PTS,format=nv12,hwupload,scale_vaapi=w=2560:h=1440:format=nv12' -strict experimental -c:v hevc_vaapi -b:v 20M -video_track_timescale 90000 "a_${vids/.*}.mp4"; done;

Version 0, edited 9 hours ago by elias tsolis (next)

comment:5 by MasterQuestionable, 7 hours ago

͏    Your Unix Shell syntax is invalid: bad quoting.
͏    To embed literal `'` within such quoting: use `'\''`.
͏    E.g. "a'b", as 'a'\''b'.

͏    You may also look at:
͏    https://www.shellcheck.net/
͏    https://www.gnu.org/software/bash/manual/bash.html#Quoting
͏    https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html
͏    https://pubs.opengroup.org/onlinepubs/9799919799/xrat/V4_xcu_chap01.html#tag_23_02_02
͏    ; for reference.

Last edited 7 hours ago by MasterQuestionable (previous) (diff)

comment:6 by elias tsolis, 5 hours ago

dont work

ffmpeg  -hwaccel vaapi -hwaccel_output_format yuv420p -vaapi_device /dev/dri/renderD128 -i b.mp4 -vf 'curves=all='\"0/0 0.5/0.58 1/1'\",format=nv12,hwupload,format=nv12'             -strict experimental   -c:v hevc_vaapi cp.mp4
'curves=all=‘\’0/0 0.5/0.58 1/1‘\’
'curves=all='\'0/0 0.5/0.58 1/1'\'
'curves=all=\'0/0 0.5/0.58 1/1\'
'curves=all='\"0/0 0.5/0.58 1/1\"'
'curves=all=''0/0 0.5/0.58 1/1\''

comment:7 by MasterQuestionable, 3 hours ago

͏    You typed wrong content.
͏    `''` is not `"` even if they may look the same under some fonts.

͏    Or use `"` as the outer quote to avoid the havoc.
͏    (but caveat its implication on "$" alike)

͏    Hint: Try with `echo` first.

Last edited 3 hours ago by MasterQuestionable (previous) (diff)
Note: See TracTickets for help on using tickets.