Log in

View Full Version : null packet vs padding stream


ranchu
11th October 2015, 22:10
Hello,

Can someone help me understand the difference between these two definitions. I could not find it documented anywhere.
Null packets - related to mpeg-2 transport stream, as a way to achieve constanct bit rate (CBR).
Padding Stream - related to PES.

Is the null packets payload is actually the padding stream ?

Regards,
Ran

foxyshadis
12th October 2015, 09:31
They're just different layers: Padding frames may be inserted into the PES, especially in PS-muxed streams like DVD VOBs, but are otherwise normally used at the TS level.

Say you have an mp3, which is a ES stream. Older encoders with lousy quantization would insert padding bits to bump the bitrate up to 320, since MPEG Audio defines its own padding, but when packetizing for muxing, that could be stripped and converted to PES padding frames with Stream ID 0xBE, to more conveniently signal to other muxers what packets could be skipped. PS padding piggybacks on PES padding with additional headers; stream 0xBE must be defined in the header and can be used from then on. (Also apparently legal is a bunch of zero bytes instead of a packet; I've seen this on real DVDs.)

TS, being insanely flexible and incorporating much more than just MPEG streams, has to be able to define its own padding mechanism, which it does through PID 0x1FFF, so you can have as many empty 188-byte packets (or 204-/208-byte) as you need to make your bandwidth target. A stream can simultaneously use TS and PES padding if it for some crazy reason wants to.

ranchu
12th October 2015, 09:57
Thank you for making it clear !