Thank you for your awesome write, quick question is it possible to join a video to another at a specific time? Say for example video1.mp4 is 30s long and video2.mp4 is 10s long, I want to join video2 to video1 at exactly 00:00:20s. So in the final output the first 20s are from video1 then the next 10s from video2 and the final 10s from video1. The final video output should be 40s long
-t before the first input is indicating we only want 20 seconds of this stream -ss before the third input indicates to start reading from the stream at twenty seconds in
There might be some overlap when the first section of video 1 end and starts back up again after video 2. With most formats, ffmpeg can't seek exactly to what time you specify, only the closet seek point.
This will add a fade out to the end of the first section, a fade in to the start of the second section, a fade out at the end of the second section, and finally a fade in to the start of the last section.
This should mimic the effect of an actual scene transition
Thank you for your awesome write, quick question is it possible to join a video to another at a specific time? Say for example video1.mp4 is 30s long and video2.mp4 is 10s long, I want to join video2 to video1 at exactly 00:00:20s. So in the final output the first 20s are from video1 then the next 10s from video2 and the final 10s from video1. The final video output should be 40s long
Try something like this and see what you get, this does a re-encode though:
-t
before the first input is indicating we only want 20 seconds of this stream-ss
before the third input indicates to start reading from the stream at twenty seconds inThere might be some overlap when the first section of video 1 end and starts back up again after video 2. With most formats, ffmpeg can't seek exactly to what time you specify, only the closet seek point.
thank you, this works perfectly final question how can I introduce a fadeIn and fadeOut to the video being inserted?
Try something like this, might need tweaking.
This will add a fade out to the end of the first section, a fade in to the start of the second section, a fade out at the end of the second section, and finally a fade in to the start of the last section.
This should mimic the effect of an actual scene transition
You notice that the argument I passed in for the
st
value of the fade filters for the fade out effects is basically equal to