0

I am trying to concatenate 2 videos but my ffmpeg command must be wrong. The output is only the second video video2.avi.

from ffmpy import FFmpeg
ff = FFmpeg(inputs={'video1.avi': None, 'video2.avi': None}, outputs={'output.avi': None })
ff.cmd
'ffmpeg -f concat -i video1.avi -i video2.avi output.avi'
ff.run()
Joe T. Boka
  • 6,554
  • 6
  • 29
  • 48

1 Answers1

0

You shouldn't have to use python library instead of that use shell command

ffmpeg -i video1.avi -vcodec copy -vbsf h264_mp4toannexb -acodec copy part1.ts
ffmpeg -i video2.avi -vcodec copy -vbsf h264_mp4toannexb -acodec copy part2.ts
cat part1.ts part2.ts > parts.ts
ffmpeg -y -i parts.ts -acodec copy -ar 44100 -ab 96k -coder ac -vbsf h264_mp4toannexb output.avi 
karan patel
  • 93
  • 1
  • 7
  • Thanks for your answer. Can you please explain what these lines do? I tried this solution, but it's not working. – Joe T. Boka Jul 11 '18 at 13:12