[Live-devel] MPEG2 Transport Stream Packet ID

Piers Hawksley piers.hawksley at panogenics.com
Wed Oct 30 16:02:35 PDT 2013


Hi Ross,

Can the MPEG2 transport stream packet ID be set ? The code appears (in 
MPEG2TransportStreamFromESSource::addNewVideoSource) to set this to 
0xE0. Changing this causes 
MPEG2TransportStreamMultiplexor::handleNewBuffer to fail 'if 
((stream_id&0xF0) == 0xE0) { // video', and thus set 'streamType = 0x81; 
// private'.

For test purposes I've hard coded:
   u_int8_t streamId = 0x20 | (fVideoSourceCounter++&0x0F);
in MPEG2TransportStreamFromESSource::addNewVideoSource and changed the 
if statement mentioned above (in 
MPEG2TransportStreamMultiplexor::handleNewBuffer) to:
       if (((stream_id&0xF0) == 0xE0)||((stream_id&0xF0) == 0x20)) { // 
video
to get the packet ID to be 0x20.

Am I understanding the code or the MPEG transport stream format wrongly ?

I realise 0xE0 if the first stream in a Packetized Elementary Stream, 
but I *think* this is separate from the Transport Stream Packet ID.

Best Regards,

Piers Hawksley


More information about the live-devel mailing list