[FFmpeg-user] Smooth animation with rgbashift

emmanuel martin ask.emmanuel at gmail.com
Thu Dec 21 12:44:54 EET 2023

I want to evolve the values of the rgbashift command over time with a sine wave. I started with the following code :

ffmpeg -loop 1 -i picture.jpg -vf "rgbashift=rh=20*sin(PI*2*t/5):bh=-20*sin(PI*2*t/5)" -pix_fmt yuv420p -t 5 output.mp4

which returns an error. I checked the documentation using the command -h filter=rgbashift, and it seems that T is allowed as a value through the "enable" option. So, I modified the code:

ffmpeg -loop 1 -i participant1.jpg -vf "rgbashift=rh='20*sin(PI*2*t/5)':bh='-20*sin(PI*2*t/5)',enable='between(t,0,5)'" -pix_fmt yuv420p -t 5 output.mp4

But I still encounter an error. Is it possible to have T in the rh and bh value parameters to smoothly animate the shift (from what I understand from the documentation, it seems possible)?
Or is it just to make the effect appear at certain moments of the timeline like here:

ffmpeg -loop 1 -i picture.jpg -vf "rgbashift=rh=20:bh=-20:enable='between(t,1,3)+between(t,4,4.5)+between(t,8,9)',random" -pix_fmt yuv420p -t 5 outputrgb.mp4

More information about the ffmpeg-user mailing list