Reputation: 6040
I have a generic intro sequence (no audio) and a main video clip. I want the audio from the main clip to play as the intro sequence is playing then the video to switch from the finished intro sequence to the main video. So almost like playing both videos at the same time but hiding one until the other is finished. Is this possible with ffmpeg? Almost like a send to back function for the video on the main clip (but keep it's audio rolling so it's in sync when it shows as the intro clip finishes).
Upvotes: 0
Views: 533
Reputation: 93048
Looks like you want a J-cut. This can be done using the overlay filter.
ffmpeg -i main.mp4 -i intro.mp4 -filter_complex "[1][0]scale2ref[intro][base]; \
[base][intro]overlay=eof_action=pass[v]" -map "[v]" -map 0:a -c:a copy out.mp4
The scale2ref
filter ensures that the intro is the same resolution as the main video. Then the intro is overlaid on top of the main video, in sync, and vanishes when it ends, leaving the main video on display. The audio is copied over - no processing required.
Upvotes: 2