Search code examples
audioaacmpeg2-ts

MPEG Transport Stream Audio data information


I am writing a code to extract AAC audio data from mpeg ts stream. I want to get stream properties like sampling frequency, number of channels, Audio type, Audio profile type etc. from Transport stream, without decoding the actual data. How much of the information will be available from stream?

Also I want to know is there any way to find the total duration of the stream without actually finding the last PTS value in the file

Thanks


Solution

  • AAC frames packed in TS use ADTS headers. Its 7 (or 9) bytes, and very easy to parse. ADTS header format is documented well online.