Command Line Video Editing?
February 11, 2006 9:30 AM   Subscribe

I'm looking for a tool which will allow me to cut MPEG2's from the command line (or programmatically otherwise). Either Windows or Linux/BSD. I've looked through a bunch of programs found via Google, but none seem to work without their GUI's. Bonus if the MPEG2 streams are cut at the GOP marker or if it re-encodes the GOP's at the cuts. Otherwise it'll get messy. Free is preferred, but pay would be fine too as long as it works.
posted by voidcontext to Computers & Internet (10 answers total)
Response by poster: Additional information: MPGTX works sometimes but not always. Any other suggestions?

There are so many random editors and programs out there, I would love it if someone had some experience with any of them.

posted by voidcontext at 9:41 AM on February 11, 2006

MEncoder probably does what you need. It's part of MPlayer.
posted by jclovebrew at 10:43 AM on February 11, 2006

ReplayTV Tools are a handy set of (windows) command line utilities for MPEG2's generated by ReplayTV's - don't know if they'd work on your particular files, but may be worth trying-
posted by bemis at 11:47 AM on February 11, 2006

Best answer: If nothing else, your first attempt and failure with MPGTX may be recoverable since it's open-source and reasonably accessible code. A failure cause shouldn't be too hard to detect. If you don't get and/or can't find a better solution, and you want to continue pursuing the issue, send me a failing MPEG2 file. The MPGTX author accepts source patches, so possibly I can implement a corrective modification.

Also, there are a few user patches post-last release available on SourceForge, should one of them sound related to your problem.
posted by mdevore at 12:34 PM on February 11, 2006

You can script VirtualDub and initiate from the command-line. Does that work?
posted by meehawl at 12:58 PM on February 11, 2006

Response by poster: Thanks everyone. I am going into work tomorrow morning and will check your suggestions out and report back.
posted by voidcontext at 4:59 PM on February 11, 2006

Best answer: I swear by videoredo for mpeg2 video editing on Windows. If you do even a small amount of editing, the time it saves it is worth it ($50).

Although it normally uses it's own GUI, it does have a command line batch mode which can read cutlists from an XML file, which you can generate programatically (or from the GUI).

Alternatively: ffmpeg with a command line such as:

ffmpeg -i input.mpg -ss startsecs -t duration -vcodec copy -acodec copy out.mpg
posted by nielm at 4:08 AM on February 13, 2006

Response by poster: Still evaluating some of these, but so far so good. Thanks everyone!
posted by voidcontext at 3:09 PM on February 14, 2006

Response by poster: mdevore: I found a way around my problems with MPGTX on sourceforge, thanks for the help.

nielm: ffmpeg worked great too. I don't know how I missed it in my original search, I had some preconcieved notion that it wouldn't do what I wanted and overlooked it.

Sorry for the delay in giving results. Had to be thorough in my testing though before I could know for sure. I tried some of the other suggestions, but not in depth.

Thanks again!
posted by voidcontext at 6:56 AM on February 25, 2006

Response by poster: Just in case anyone stumbles on this thread:

ffmpeg works really well, and the fact that it re-encodes the edges of the cut file make the file much easier to work with in other programs.

mpgtx works also, but the fact that it just slices the file at the VOB boundaries sometimes make other programs choke.

Go with ffmpeg. That's been my experience over many uses the last several months.
posted by voidcontext at 9:08 AM on April 25, 2006

« Older Nordic Combined   |   Insurance for a first-time car buyer Newer »
This thread is closed to new comments.