[mythtv] A prelude to transcoding MPEG2->MPEG2

Jim Paris jim at jtan.com
Sat Dec 6 02:40:26 EST 2003

Yeah, seems like MPEG really just wasn't designed for cutting.
What we really need is a way to say "here's a frame, decode it to use
as a reference but don't display it".  Could you pull some trickery
like giving a bogus PTS to make that happen?

> There is also the question of how audio and video are muxed together.  My
> understanding is that the 'PES' consists of a series of GOPs and audio
> sections.  So I am not sure how to get frame accuracy without building
> new PES and possibly needing to reencode the audio.

Yeah, audio sync could be a pain.  Are you even guaranteed that the
cut for both audio and video will occur in the same PES?

> Considering the complexiity of keeping an MPEG2 stream compliant, I think
> the easier approach will be the GOPchop approach.

GOPchop still has issues with audio sometimes, I've heard.  It doesn't
really handle audio -- it apparently just keeps all non-video data
along for the ride while doing his chopping and hopes that it works.

> However, if anyone knows where I can find a reasonable spec for the MPEG2
> stream format, I'd be much obliged.  My google searching has turned up
> lots of useful stuff, but not enough for me to really understand how to
> begin (for instance I've been able to find zilch on the actual PES and
> GOP formats.

I think that there was useful info at http://www.mpucoder.com/dvd/
(like "MPEG Quick Reference" and "PES headers"), but apparently it's
no longer freely accessible, so you'll have to make something like a
$5 donation to get it.  I remember mirroring it once, but I don't
think I still have it.

In case you haven't seen it already, there might also be some info
in this thread:


More information about the mythtv-dev mailing list