LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Programatically remove chunks from a video file? (https://www.linuxquestions.org/questions/linux-software-2/programatically-remove-chunks-from-a-video-file-763796/)

neocookie 10-22-2009 02:20 PM

Programatically remove chunks from a video file?
 
I need to remove sections from video files (from the middle and the end) on the command-line. Generally these will be mp4 and avi files.

For instance, I have a .mp4 file which is 32:30 minutes long. I'd like to remove from 2:49 to 3:20, and remove the last 60 seconds.

Any ideas on how I can achieve this?

neonsignal 10-22-2009 06:34 PM

You can use mencoder for this. You can extract pieces from the file, eg:

Code:

mencoder input.mp4 -oac copy -ovc copy -ss 0 -endpos 169 -o piece1.mp4
mencoder input.mp4 -oac copy -ovc copy -ss 200 -endpos 1200 -o piece2.mp4

(-ss is the skip time, -endpos is the end point)

You can then use mencoder to join the result pieces together, eg:

Code:

mencoder piece1.mp4 piece2.mp4 -oac copy -ovc copy -o output.mp4
You can do the same thing with ffmpeg.

You could also consider using mpgtx.
_______________

the problem with google isn't the lack of useful results, it is just finding them amid all the flotsam.


All times are GMT -5. The time now is 03:51 AM.