I am writing a server which live streams mpeg2-ts on HTTP and I wondered what's the best position to split an mpeg tran开发者_如何学运维sport 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
精彩评论