Article 4Y6MR How can you concatenate two or more video files?

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:
  1. copy only (no transcoding, I need speed)
  2. I need to specify the input files on the command line (no intervening files containing file names)
  3. I need the output stream to go to stdout (not to a file or intervening files)
I had this working fine on my old Ubuntu 14.04 server with the following command:

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
In other words, it is an unusable mess.

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)
I can't for the life of me get the output to go to stdout or specify the input files on the command line.

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.

Thankslatest?d=yIl2AUoC8zA latest?i=XfTcIWiItx4:j6MxBS2vEQc:F7zBnMy latest?i=XfTcIWiItx4:j6MxBS2vEQc:V_sGLiP latest?d=qj6IDK7rITs latest?i=XfTcIWiItx4:j6MxBS2vEQc:gIN9vFwXfTcIWiItx4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments