up vote 2 down vote favorite
3
share [g+] share [fb]

I have a divx video of 10 mins. I want to copy two parts from it , minutes 2 to 6 and 8 to 10 and create another video by merging the two. how can I do it using lightweight command line tools. Either on Windows or Linux?

link|improve this question

65% accept rate
feedback

2 Answers

up vote 3 down vote accepted

Perhaps ffmpeg/mencoder (available on either platform)

to split:

ffmpeg -sameq -ss [start_seconds] -t [duration_seconds] -i [input_file] [outputfile]

ffmpeg -sameq -ss 2 -t 4 -i input.avi video1.avi
ffmpeg -sameq -ss 8 -t 2 -i input.avi video2.avi

to merge:

mencoder -ovc copy -oac copy video1.avi video2.avi -o output.avi
link|improve this answer
does it work on divx encoded videos? let me check.. – iceman Nov 26 '09 at 20:20
small corrections ; -t duration' : Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[.xxx] syntax is also supported. -ss position' : Seek to given time position in seconds. hh:mm:ss[.xxx] syntax is also supported. Itried this and it worked but the video and the audio are time shifted and also there's a big difference in the original and output quality.The output's very degraded. DivX is a variant of MPEG4 hence we can ffmpeg as it can produce MPEG4 on its own – iceman Nov 26 '09 at 21:03
I left out the hh:mm:ss given the context of your answer. I admit, I tried this in a ssh connection to home. Didn't verify the quality. Perhaps try doing it all w/ mencoder? – basszero Nov 28 '09 at 14:35
the video and the audio are time shifted – iceman Dec 27 '09 at 9:01
feedback

To split the video there's a hand command line tool called jumptheshark.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.