In this ongoing saga of me putting together a video, I have one more step I’m trying to add.
My requirements look like this:
In these days of COVID, our choir director is recording a video which is the accompaniment, and then each choir member (at home) is listening to the accompaniment in headphones, singing along, and recording their voice and lovely face as a video. I now want to take all these disparate videos and combine them into one video with all the members in small panes, Brady Bunch style. And of course, each choir member has different hardware so the audio levels are all different and need to be normalized. And of course, one person took the video sideways (portrait instead of landscape) so their video has to be cropped before adding it in.
In addition, I need to define the director’s video as the “master” stream. So let’s say the director has 3 seconds of nonsense at the beginning of her video that doesn’t need to be there. I want to start the final video immediately after that nonsense. Then, if choir member #1 started her video 0.4 seconds after the director, I want to discard the first 2.6 seconds of her video. If choir member #2 completely disregarded the instructions and started his video 4.3 seconds after the director, then I need his pane to just be blank for 1.3 seconds in the final video.
And finally, if some of the videos need cropping so they aren’t the right shape, I get this lovely green color filling in the blank spots. How can I get a background image to show up “behind” the videos?
Based on previous answers and other research, I have this command line:
-ss 0.2 -i "One.MOV"
-ss 3.2 -i "Two.MOV"
-loop 1 -i "Image.jpg"
(base)(bg) overlay=shortest=1:x=0:y=0 (tmpx);
(0:v) scale=960x540 (clip0);
(1:v) crop=1080:1000:0:920,scale=583x540 (clip1);
(2:v) scale=960x540 (clip2);
(tmpx)(clip0) overlay=shortest=1:x=0:y=0 (tmp0);
(tmp0)(clip1) overlay=shortest=1:x=1148:y=0 (tmp1);
(tmp1)(clip2) overlay=shortest=1:x=0:y=540 (tmp2);
-c:v libx264 d:scansoutput.mkv
Good news: this works! Bad news: running this takes over 10x longer than it did when I didn’t have the still image in the background.
If I take out the “-loop 1”, it runs much faster, but then my entire output is a still image (the background image plus the first frames of each of the input videos).
How can I add the still image in the background and not take such a performance hit?