ffmpeg Common commands

1.hue:Adjust video hue, saturation, brightness
h:Hue angle degree (0 to 360), default value is 0

s:Saturation (-10 to 10), default is 1

b:Brightness (-10 to 10), default value is 0

Command format:ffmpeg -i "source video address" -vf hue=s=1:b=1:h=90 -b 320k "output video address"
Use example:ffmpeg -i d:\2.flv -vf hue=b=1 -b 600k d:\outTemp.flv(adjust saturation)


2.colorbalance:Color balance, adjust the weight of RGB values, divided into three levels, used to adjust the saturation and adjust the color offset value
rs、gs、bs:Adjust red, green, and blue shades (darkest pixels) (range: -1 to 1)

rm、gm、bm:Adjust red, green and blue intermediate colors (medium pixels) (range: -1 to 1)

rh、gh、bh:Adjust the red, green, and blue highlights (brightest pixels) (range: -1 to 1)

Command format:ffmpeg -i "input video address" -vf colorbalance=rh=.3:gh=.3:bh=.3 -b 320k "output video address"
Use example:ffmpeg -i d:\2.flv -vf colorbalance=rh=.3 -b 600k d:\outTemp.flv(increase red weight)


3.Add background music to the video
Command format:

ffmpeg -y -i input.mp4 -i back.wav -filter_complex "[0:a] pan=stereo|c0=1*c0|c1=1*c1 [a1], [1:a] pan=stereo|c0=1*c0|c1=1*c1 [a2],[a1][a2]amix=duration=first,adelay=3000|3000,pan=stereo|c0<c0+c1|c1<c2+c3,pan=mono|c0=c0+c1[a]" -map "[a]" -map 0:v -c:v libx264 -c:a aac -strict -2 -ac 2 output.mp4