videofilterffmpegoverlayhue

FFMPEG - Change saturation of my overlay video


I'm just getting starting with FFMPEG & i have a little problem. I have two videos. One is overlay on the left top corner of the other one. Now that I have that, I'm trying to put the small video on top Black & White. I could do it separatly, but i'd like to do it in one line, if possible.

I was able to put the background video (video0.mp4) black&white with this code:

-i video0.mp4 -i video1.mp4 -filter_complex “[0] hue=s=0 [ok] ; [ok] [1] overlay=x=25 : y=25[out] ; [out] scale=1280:720 [final]” -map “[final]” -t 10 -c:v libx264  -b:v 1500k -f mp4 try10.mp4

And i was able to put all videos black&white with his code:

-i video0.mp4 -i video1.mp4 -filter_complex “[0] [1] overlay=x=25 : y=25, hue=s=0 [out] ; [out] scale=1280:720 [final]” -map “[final]” -t 10 -c:v libx264  -b:v 1500k -f mp4 try10.mp4

I'm just changing place of the hue=s=0, but i can find the good place so that it is my video1.mp4 that is black&white and not the video0.mp4

Hope i'm clear enough! Thanks for your help!


Solution

  • I think you are virtually there already. It should look like

    -i video0.mp4 -i video1.mp4 \
    -filter_complex “[1]hue=s=0[ok]; \
                     [0][ok]overlay=x=25:y=25,scale=1280:720 [final]” \
    -map “[final]” -t 10 -c:v libx264  -b:v 1500k -f mp4 try10.mp
    

    Basically, pass the 2nd stream [1] to hue and swap the overlay input.