[Matroska-devel] Re: CodecPrivate for MPEG-1 and MPEG-2 video

Steve Lhomme steve.lhomme at free.fr
Wed Nov 17 11:23:37 CET 2004


John Cannon a écrit :
> Paul Bryson wrote:
> 
>> I'm sure we've had this discussion before.  I don't feel like actually 
>> tracking it down in the ML, but it was early in the year, February 
>> maybe? Anyway, It should be optional.  If the headers are identical 
>> for each GOP, then why would a decoder need them repeated all the time?
> 
> 
> It _IS_ optional.  The MPEG-2 spec allows the headers to be repeated as 
> often as the encoder desires. The only requirement is that there be 1 
> somewhere and also that the parameters stay basically the same except 
> for a few elements.  The spec recommends they be placed before each GOP 
> for faster seeking and easier editing but AFAIK there is no requirement. 
>    I don't want to have to reconstruct the stream on demux though.  So I 
> vote for leaving the stream intact.

OK, let me see what we have :
- The data are needed for decoding
- It can be multiple times in the stream
- It can change during the stream (unimportant data only ?)
- DirectShow decoders need it (separated from the stream ?)

If the only reason to have it is because of DirectShow, maybe we can 
find other ways to do it. It depends if the data are needed when the pin 
is connected or only during playback. If it's during playback then we 
can put the first frame in the codec data and that's it.

IMO it doesn't make sense to have codec private data stored in tracks if 
that data can change during playback ! In this case it should be in the 
Block, but so far we haven't used this.



More information about the Matroska-devel mailing list