Skip to main content

Topic: Detecting codec in a stream (Read 1298 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • stigc
  • [*][*][*]
Detecting codec in a stream
How does e.g. VLC detects the codec when opening a http stream?

Both AAC and MP3 has a very short sync mark which often appears in other streams.

http://www.flickr.com/photos/52807817@N00/4423485655/
http://www.mp3-tech.org/programmer/frame_header.html
  • Last Edit: 07 October, 2012, 07:53:12 AM by stigc

  • stigc
  • [*][*][*]
Detecting codec in a stream
Reply #1
I guess VLC parses the frame length number and sees if it matches the next sync mark?

  • benski
  • [*][*][*][*][*]
  • Developer
Detecting codec in a stream
Reply #2
The first four bytes of an ADTS AAC frame header look exactly like an MPEG-1/2 "Layer 4" frame.  So it's quite easy to detect the difference.