Thursday, May 06, 2010

Splitting MPEGs On The Command Line

I was cleaning out the basement, and came across a box of old VHS tapes. Needless to say, they went in the go to the dumpster pile. Along with a VCR, an old video capture board, and a PIII. Then it occurred to me: hey, that's a video encoding system sitting in the garbage heap.

A couple hours later, everything was assembled, and I transferred my first tape. A problem, though: it was too much effort to get the file to start and end at the right place. I spent some time screwing with some of the worthless video editing software, when I found a couple posts that solved the problem.

And, yes, its a command line solution. Your GUIs are so over rated.
ffmpeg -vcodec mpeg2video -r 29.97 -b 2000k -ab 224k
  -i Cap00.mpg -ss 00:00:37 -t 2:06:30 jurassicPark.mpg
These settings will take an input file encoded at the cards native settings, and chop off everything before 37 seconds and after 2 hours (plus change). I used Mplayer to get the time values.

2 comments:

  1. Was it really Jurassic Park?

    ReplyDelete
  2. Absolutely. All my kid's favorite VHS tapes: Men in Black, Independence Day, Jurassic Park. Of course, I'm keeping the tapes. These files are only... back-ups. In case the tapes every decay.

    I'll keep a blank tape, play the file to the blank tape, then move the media into the original case.

    Yep. That's the plan.

    ReplyDelete