I am writing a server which live streams mpeg2-ts on HTTP and I wondered what's the best position to split an mpeg transport stream. The stream is going to be played by iptv set-top boxes and I have no idea how these devices behave.
I would think that the best place to start a stream is before an I-Frame, but the device might need the PAT and PMT packets before it starts to decode video stream data...
You can start with every 188-byte TS packet (0x47 is the start code). The MPEG decoder automatically jumps in at the first I frame. You can do tricks like MS Mediaroom does with sending burst I-frames, but this requires heavy changes to your client (and patent royalities).
To be safe you should use self-initializing TS segments. Such segment must include the PAT/PMT and start with an IDR-frame.
For example this is a requirement in the HTTP Live Streaming pantos draft when using I-Frame playlists.
See more: GPAC - Apple HLS Introduction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With