>I've got now a DVD-conform MPEG2 file (well, I hope so), and I wanted to
>know if I could use transcode to trim the file without re-encoding the
>whole thing?
Unfortunately, there's no easy way to do it, but you can use the
development version from the HG repository to clip a specified range of
frames from a raw MPEG2 file (you'll still have to handle the audio
separately):
transcode-1.2 \
-i infile \ (Input pathname)
-o outfile \ (Output pathname)
-c start-end \ (First and last-plus-one frame number)
-P 1 \ (Pass video frames through untouched)
-y V=copy,A=null,M=raw (Write frames directly to output file)
You can also use time values (HH:MM:SS.FF -- that's frames, not a
fraction, after the decimal point) for the -c option, but transcode
isn't smart enough to start at a keyframe, so you may have to tweak the
start point until you find one. You can tell whether you started at a
keyframe by looking at the first few bytes of the output file (try
"hexdump -C outfile"); if you see "00 00 01 B3" or "00 00 01 B8" near
the top of the file, then it's a keyframe, while if it starts with e.g.
"00 00 01 00" or "00 00 01 01" followed by a bunch of random data, it's
not a keyframe.
--Andrew Church
[email protected]
http://achurch.org/