ffmpeg merging 3 different streams

ffmpeg merging 3 different streams

Author
Discussion

paul.deitch

Original Poster:

2,145 posts

263 months

Wednesday 26th October 2022
quotequote all
So I am making a composite video to project during a party.
I have copy of Macbeth, a horror video and an erotic video.
Using ffmpeg I have split each of them into 5 sec segments.
I want to splice them all together as one stream as video1 5 secs, video2 5 secs, video3 5 secs, and I want the horror video running backwards.
Anyone know how to do all that? Thinking about it here is probably not the best place to ask but it's a start.

Hanslow

809 posts

251 months

Wednesday 26th October 2022
quotequote all
Something like this should work:

ffmpeg -i concat:"<vid1>|<vid2>|....|<vidN>" <output filename>

You might run into issues if they're not the same res/bitrate so you might want to first transcode them all to the same standard. Have a look at the help for concat anyway, that should lead you in the right direction.

To reverse it, I assume you're happy the audio will be backwards too, just run:

ffmpeg -i <source video> -vf reverse <output filename> (if you don't want reverse audio)
ffmpeg -i <source video> -vf reverse -af areverse <output filename> (if you do want reverse audio)

eltawater

3,156 posts

185 months

Wednesday 26th October 2022
quotequote all
If you're not wedded to using ffmpeg on the command line, you can do this in something like OpenShot in about 30 seconds by dragging each of three video segments into the track timeline and then setting the "Time" submenu of the horror segment to "Normal" "Backward".


paul.deitch

Original Poster:

2,145 posts

263 months

Saturday 29th October 2022
quotequote all
Thanks for the feedback. I got it "working" but the variety of video formats used caused some bad output. In the end I used OBS with a plug in that cycles through the input media without problems. Can thoroughly recommend it for what I was trying to do.