title: How do I determine the video codec used in a file
body: <p>The HTML5  tag exposes a canPlayType() method to JavaScript. It takes a MIME type for the media to be played, and returns an indication as to whether the browser thinks it can actually play the media.</p>
  
  <p>Unfortunately, most of the common media types ('video/mp4', for example) are container types, and the media type itself isn't enough to determine whether the content can actually be played. In response to this, RFC 4281 defines a "codecs" parameter that can be added to the MIME type to identify the specific codec.</p>
  
  <p>So, for example, a type of "video/3gpp2; codecs='mp4v.20.9, mp4a.E1'" is (according to the RFC) "MPEG-4 Visual Simple Profile Level 0 plus 13K voice".</p>
  
  <p>I've found a variety of places that tell me what values to use if I know the codec, but I often find myself in the position of receiving a video file with unknown provenance -- all I know is that it's got an .mp4 filetype.</p>
  
  <p>How can I determine from the actual file what the correct "codecs" value is for canPlayType()?</p>