indexinghttp-live-streamingtransport-stream

HLS MPEG Transport Stream Index File


I am currently looking to add Trick and Play functionality to HTTP Live Streaming (HLS) Server. For Trick and Play functionality to work, generally MPEG Transport Streams are pre-indexed. What is the general format of the Transport Stream Index files and how can I determine the I-frame in Transport Stream using the Index files?

I am using Transport Stream and Index file from here.


Solution

  • Each live555 TS index record is 11 bytes long:

    - Record Type:              1 byte
    - Start Offset:             1 byte
    - Size:                     1 byte
    - PCR (integer part):       3 bytes (little-endian)
    - PCR (fractional part):    1 byte
    - Transport Packet Number:  4 bytes (little-endian)
    

    Your sample is H.264 so the Record Type to look for is:

    RECORD_NAL_H264_IFRAME = 9, // H.264
    

    Source