PDA

View Full Version : [SOLVED] Merging videos using command line


Shady3D
February 20th, 2009, 09:27 AM
hi all, there was a tutorial in Linux Journal about extracting mp3 from a video, so i was thinking is there a way to merge 2 videos without using avidmux or other editing program.

insineratehymn
February 20th, 2009, 09:31 AM
Like... video a ends and video b begins?

Shady3D
February 20th, 2009, 09:35 AM
no, i don't want to queue them i want both be the same file

insineratehymn
February 20th, 2009, 09:35 AM
Right... like avi1 + avi2 = comlpeteAvi

Shady3D
February 20th, 2009, 09:36 AM
yes

insineratehymn
February 20th, 2009, 09:38 AM
yes

mencoder -oac copy -ovc copy file1.avi file2.avi -o full_movie.avi

Try that out. Mencoder is in the console and it comes with mplayer, so you should already have it. Replace file1 and file2 with appropriate file names and you will get full_movie.avi (you can change the name of that as well).

Don't be surprised if this takes a long time depending on the size of the original files.

detroit/zero
February 20th, 2009, 09:42 AM
or install transcodesudo apt-get install transcodethis will give you avimerge. then it's as easy as avimerge -i movie*.avi -o mergedmovie.aviwhere movie* is going to be part1.avi, part2.avi, etc..

insineratehymn
February 20th, 2009, 09:45 AM
or install transcodesudo apt-get install transcodethis will give you avimerge. then it's as easy as avimerge -i movie*.avi -o mergedmovie.aviwhere movie* is going to be part1.avi, part2.avi, etc..
That will work nicely as well. =)

Shady3D
February 20th, 2009, 09:46 AM
$ mencoder -ovc copy vid1.flv vid2.flv -o full_movie.flv
MEncoder 2:1.0~rc2-0ubuntu17+medibuntu1 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) D CPU 3.40GHz (Family: 15, Model: 6, Stepping: 5)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0 data: 0x0 - 0x84c4c91
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [VP6F] 320x240 0bpp 30.667 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x46365056 size:320x240 fps:30.67 ftime:=0.0326

No audio encoder (-oac) selected. Select one (see -oac help) or use -nosound.

Exiting...



so do u know whats the problem (thats for the first code)

for the second i am downloading the program now

insineratehymn
February 20th, 2009, 09:52 AM
Post the output of this:
file <name of your movie/s>

Replace <name of your movie/s> with one of the two files you have, do this for each.

Shady3D
February 20th, 2009, 09:56 AM
vid1.flv: Macromedia Flash Video

insineratehymn
February 20th, 2009, 12:22 PM
Ahh, ok. That explains it. I thought you were messing with avis.
mencoder -oac copy -ovc copy -o c:\video.flv c:\a.flv c:\b.flv

Try that?

Shady3D
February 20th, 2009, 12:33 PM
i didn't quite understand the last code but anyway, i managed to get over that problem by converting to avi then merged them and both scripts worked fine, and thx for ur help

insineratehymn
February 20th, 2009, 12:34 PM
You're welcome.