Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are similar questions on SU, but I have one ADDITIONAL requirement along with merging the videos.

I need to have a 2 seconds (or whatever seconds) of black screen between two consecutive videos. I'm looking for a free tool like ImageMagik (but for videos) which can easily merge the videos along with that black screen thing.

P.S. I have YouTube videos in Mp4 (tutorial series it is).

What is the fastest method I can use?

share|improve this question
"Merging" in the sense of appending them to one another? I'd probably recommend just creating an empty "black screen" video and then inserting that in between. – slhck May 17 '12 at 12:22
@slhck: that's good idea, but how to add a single file between every two different files? – Kushal May 17 '12 at 13:56
Well, you're gonna have a list of files, I guess. Just insert the blank video between those when feeding this list to your batch. See also: Command-line video editing in Linux (cut, join and preview) – slhck May 17 '12 at 13:57
up vote 1 down vote accepted

Very simple, if these are only MP4 ones. Install MP4Box (comes for every OS).

Then, you can concatenate MP4 videos by using:

mp4box -cat video1.mp4 -cat video2.mp4 -cat … output.mp4

And you're done. Just add as many -cat video.mp4 as you want.

Batch processing is simple too. Let's say you have a file with the blank two seconds, called blank.mp4, and a list of your input files videos.txt

while IFS= read -r line
    command="$command"" -cat $line -cat blank.mp4"
done < "videos.txt"
command="$command output.mp4"
echo $command
eval $command

Save it somewhere, give it execute permissions with chmod +x, and execute it with ./ Obviously, blank.mp4 needs to be in the same folder. But you could easily modify that behaviour.

share|improve this answer
but adding like 200 -cat video.mp4s is really needed? even if I have that blank_screen.mp4 in between every two videos? – Kushal May 17 '12 at 14:10
There was a slight problem with my script, but I updated it so it now executes everything in one line. You can test it if you want. – slhck May 17 '12 at 14:31
I tried installing MP4box in Ubuntu (12.04) using a .deb but having dependency issues, here's entire error: Dependency is not satisfiable: libavcodec52 (>= 4:0.5.1-1) | libavcodec-extra-52 (>= 4:0.5.1-1). After going through Synaptic, I saw both these packages are not available, instead, libavcodec-extra-53 is installed. – Kushal May 18 '12 at 4:53
Hm, I've never used it on Ubuntu, so I'm not an expert on these dependency things. Have you enabled all package sources? – slhck May 18 '12 at 9:50
Okay, I guess I'll have to try using in Windows, as GPAC is known to work until 11.04, status is unknown beyond that. – Kushal May 18 '12 at 14:35

What kind of movies? Mpeg? AVI? FLV? Are you joining a bunch of Youtube Rips? It makes a difference.

For example, here is mpgtx, a simple command line tool that, among other things, joins mpeg video clips. It doesn't work with AVI or other movie file types. So, it would be useless for what you want to do. Thus,, I have no idea if suggesting it to you will work... since I don't know what kind of file type your movie clips are.

Maybe AviDemux is more of what you need. It doesn't operate from a command line, but it does handle a wider range of movie types and it can be automated using projects, a task queue and scripts. Which would mean joining a batch of movie clips, and telling it to add 2 seconds of nothing in between each would not be outside of it's range.

At any rate, is your friend, as it is a website dedicated to providing it's visitors with everything video... and audio. Editing, that is.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .