Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Using a low-budget card as a secondary card.



"Marcus O.C. Metzler" wrote:
> 
> Klaus Schmidinger writes:
>  > What would help here would be some "official" standard text
>  > that describes how exactly two separate video and audio streams
>  > are to be multiplexed. So far it appears to me like remultiplexing
>  > is some sort of "black magic"... ;-)
>  >
>  > Is there any document that I could consult regarding this?
> 
> The only thing I found is the source code of mplex, i.e. the muxing
> part of bbmpeg, which I used for the mplex program in the mpegtools.
> As far as I can understand the code, they use a "faked" buffer that
> represents the buffer of the player. they "write" the PES data into
> the buffer according to the PTS and check if the PTS is less than the
> SCR which they also simulate. Then they use some coditions depending
> on buffer filling and PTS of audio and video to write into the buffer
> and read out of buffer, i.e. write to disk. They only rule you can
> make out of this is that you have to have the data out of the buffer
> before it needs to be displayed, i.e. PTS < SCR. The audio and video
> buffer size acts are the boundary conditions for that. I didn't have
> time to take all that stuff apart, so I just used it as is.
> Maybe theres is a scientific paper or maybe a some kind of thesis
> about that on the net.

Well, *the* official document is, of course, ISO-13818-1 (MPEG-2
Systems). Unfortunately, the MPEG-2 standard does not define how
*multiplexing* has to be done, but rather define how *demultiplexing*
and decoding of MPEG streams works. For that purpose, a detailed
model of such a decoder, called System Target Decoder (STD), is
descibed (really two of them, one for TS and one for PS).
This description is quite involved, and further obfuscated by the
fact that some buffer and timing constants depend on the MPEG "profile"
and "level".
Usually the MPEG "main profile at main level" is used, which is
suitable for broadcasting and consumer equipment, but for HDTV or studio
requirements one may use other profiles/levels.

An MPEG stream is muxed "right" if it can be properly decoded by the STD.


Johannes

PS: No, I haven't read the MPEG standard too closely. Don't ask me for details.


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index