How can you concatenate two or more video files?
by bt101 from LinuxQuestions.org on (#4Y6MR)
Hi - I have several video files (let's say f1.mov, f2.mov, f3.mov, etc).
I need to concatenate them into one video file, and I have these requirements:
Code:mencoder -really-quiet -oac copy -ovc copy -idx -o - f1.mov f2.mov etcNB - the above did not bring over the audio stream, but I don't care because it is just a surveillance camera.
Now I upgraded my server to 18.04 and the latest software (MEncoder 1.3.0) and it causes the following problems:
Like anything linux, I spent a week going down blind alleys trying to fix it or try alternatives ;-) So I'm hoping someone with knowledge can end my pain.
I tried using ffmpeg, and I could get the following working:
Code:ffmpeg -f concat -safe 0 -i files.txt -c copy output.movThe bonus of the above command was that it brought over the audio track, but as you can see:
If I try to get the output to go to stdout with a dash, I get the following error:
Code:Unable to find a suitable output format for 'pipe:'As for trying to specify the input files on the command line, you are supposed to use:
Code:-i concat:"f1.mov|f2.mov|f3.mov"However this absolutely positively does not work as only the first file is brought over (concat just does nothing - grrr!) ;-)
So I'm not married to ffmpeg even though we've spent a week together. If you know of *any* solution, pls let me know.
Thanks


I need to concatenate them into one video file, and I have these requirements:
- copy only (no transcoding, I need speed)
- I need to specify the input files on the command line (no intervening files containing file names)
- I need the output stream to go to stdout (not to a file or intervening files)
Code:mencoder -really-quiet -oac copy -ovc copy -idx -o - f1.mov f2.mov etcNB - the above did not bring over the audio stream, but I don't care because it is just a surveillance camera.
Now I upgraded my server to 18.04 and the latest software (MEncoder 1.3.0) and it causes the following problems:
- Everything that moves in the videos has bad artifacts (it is definitely NOT copying)
- VLC won't even play the resulting video
- Xplayer eventually plays the video, but it always gives an error saying (pk-gstreamer-install requires to install plugins to play media files of the following type: audio/x-avi-unknown decoder
Like anything linux, I spent a week going down blind alleys trying to fix it or try alternatives ;-) So I'm hoping someone with knowledge can end my pain.
I tried using ffmpeg, and I could get the following working:
Code:ffmpeg -f concat -safe 0 -i files.txt -c copy output.movThe bonus of the above command was that it brought over the audio track, but as you can see:
- I had to specify the input files in an intervening file (files.txt)
- The output goes to a file (not stdout)
If I try to get the output to go to stdout with a dash, I get the following error:
Code:Unable to find a suitable output format for 'pipe:'As for trying to specify the input files on the command line, you are supposed to use:
Code:-i concat:"f1.mov|f2.mov|f3.mov"However this absolutely positively does not work as only the first file is brought over (concat just does nothing - grrr!) ;-)
So I'm not married to ffmpeg even though we've spent a week together. If you know of *any* solution, pls let me know.
Thanks