Tebe
Tebe

Reputation: 3214

MPEG ADTS format identification

I need detect whether file is MPEG ADTS file. I've searched for it around but whether I seek badly or something else but I can't find signature using which I could have said surely that certain file has MPEG ADTS format.

E.g. we can say for sure that file is MP4 if it begins with such signature 00 00 00 nn 66 74 79 70 6D 70 34. How can it be done with MPEG ADTS?

Thanks in advance for any help!

Upvotes: 0

Views: 3283

Answers (1)

rajneesh
rajneesh

Reputation: 1749

ADTS header is typically used in stand alone aac,mpeg-ts file.(streaming scenario) ADIF is used mainly in MP4 file

adts file header starts with 12bits "sync work" which is always (111111111111) next 1 bits is ID - next 2 bits (always 0)

http://developer.longtailvideo.com/trac/browser/providers/adaptive/doc/adts.pdf?rev=1460 (provide the full header)

so your algo to detect would be -

  1. search for 12 bits sync work
  2. validate that next fields contain valid values

Upvotes: 2

Related Questions