Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to start/split mpeg2-ts

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...

like image 641
Karoly Horvath Avatar asked Jun 16 '11 16:06

Karoly Horvath


2 Answers

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).

like image 69
frank Avatar answered Sep 21 '22 22:09

frank


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

like image 40
aergistal Avatar answered Sep 18 '22 22:09

aergistal