Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How about mpgtx?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How about mpgtx?
Authored by: maguirer on Jul 30, '02 12:10:49PM

split could probably do what you want, but I think the results would be messy. A better solution would be to use "mpgtx" which can join, split, and/or trim mpeg files (including mpeg 1 layer 3 audio, i.e. mp3s).

It can split into equal pieces, split based on byte offsets or (my personal favourite) based on time offsets. Since it understands mpegs, it's slightly more intelligent about splitting (but not perfect), nor will it reencode the file. It can demux mpeg streams, too.

For example:
mpgtx -s -b TEST some.mp3 "[-00:00:10]"

Will create a file called TEST.mp3 that's the first 10 seconds (actually came out to 10.0049 seconds, but close enough) of some.mp3.

Had to put quotes around the time spec, otherwise tcsh thinks I'm doing a file glob.

I think someone even wrote a cocoa front-end to mpgtx, but I'm not 100% sure.

Only thing is, time offsets aren't accurate for VBR mp3s, and as more and more mp3s are VBR, time offsets in their current form will eventually become useless for mp3s. It estimates time offsets by multiplying filesize with time offset and dividing by duration.



[ Reply to This | # ]