Log in

View Full Version : Append MPEGs without decoding


gamez
1st November 2005, 14:39
Sorry if this is not the right forum, then please move.

I would like to append to each other (AKA merge, join, concatenate) two or more MPEG videos which have identical characteristics (besides their length, of course). It's the kind of thing you do with TMPGenc, menu 'MPEG Tools'.

Questions:
1. any freeware around that can do the job in batch mode (via command line parms)?
2. I sometimes see progs that just bluntly perform a binary join; is this really a reliable method - does the MPEG format support this?
3. alternately, I could program a little bit... seeing that I don't need to uncompress anything, I just would have to do some counting and indexing... but I would need to know the MPEG file layout . Any hints about where to find?

Thank you for reading and any advice you may have.

CU,
gamez

mpucoder
1st November 2005, 15:22
I sometimes see progs that just bluntly perform a binary join; is this really a reliable method - does the MPEG format support this?
Yes, it is a streaming format. All streaming formats allow splicing, even if the characteristics are different.
To join mpegs you can use the DOS command:
copy /b file1.mpg+file2.mpg output.mpg

Internally authoring programs do the same thing when joining source files, when one ends the next one is opened and loaded into the buffer. Of course for DVD key characteristics must match.

gamez
1st November 2005, 15:51
Unbelievable - it just can't be so simple!?!

What the hell is then TMPGEnc doing during the join... it seems to walk all files and then completely (re)build (or at least re-index) the video and audio streams...

Be that as it may, can you point me to a doc that just describes the essentials of the MPEG1/MPEG2 file structure (blocks and indeces I suppose - without going into the details of a single frame). That would be really very helpful...

Thanks a lot for your help!

gamez

mpucoder
1st November 2005, 17:28
mpeg is a streaming format, therefore there is no beginning or end, and no indices. Authoring programs sometimes map the logical structure of video files for planning purposes, since there are constraints in DVD use. And program streams (combined audio and video) very often have to be taken apart and put back together again to meet DVD spec.

Technical docs can be downloaded from neuron2's site (http://neuron2.net/) , in the library.