1

Im new to ffmpeg and the documentations are overwhelming.

Would like to "Glue" 2 FLV movies together (ascii art does not work here so)

[ 1 ] [ 2 ]

[1][2] <= create 1 new movie with the 2 video's playing next to each other

Rubytastic
  • 15,001
  • 18
  • 87
  • 175

2 Answers2

1

Please consider converting them to mp4 (since Flash supports it and its more compact) The use this:

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

Taken from Concatenating media files

Boris Ivanov
  • 4,145
  • 1
  • 32
  • 40
  • Ah great! is it also possible to make sure they are both the same length? perhaps use the shortest movie and limit the longer one to that? I test and accept – Rubytastic Oct 30 '13 at 12:50
  • Same duration you mean? – Boris Ivanov Oct 30 '13 at 12:51
  • Yes the same duration, so movie1 = 0:30, movie2 = 0:32, how to combine them both and make the movie quit at 0:30 ( so 2 seconds of movie 2 get lost ) – Rubytastic Oct 30 '13 at 13:19
  • To select just the relevant portions of the video, I used the -ss (start/seek position) and -t (time/duration) flags, e.g.: ffmpeg -f h264 -i input-video-file.264 -ss 180 -t 8 output-video-file.mp4 The above example takes 8 seconds of the input video starting at the 3-minute (180-second) mark. – Boris Ivanov Oct 30 '13 at 13:24
  • Sorry I didn't test correctly your answer is not solution to problem, it puts the movies *behind* each other i want them to be tiled next to each other. – Rubytastic Oct 30 '13 at 15:00
0

After more digging the docs this seems to work:

ffmpeg -i stream1.mp4 -i stream2.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS, pad=iw*2:ih[bg]; [1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=w; amerge,pan=stereo:c0<c0+c2:c1<c1+c3" output.mp4
Rubytastic
  • 15,001
  • 18
  • 87
  • 175