quick tip: open web video and mime types

A quick note if you’re going to be using OGG open web video hosted on web servers.  There’s an important configuration change that you should make so that Firefox recognizes it as video.  In my Apache configuration I’ve added this directive:

AddType application/ogg .ogg
AddType application/ogg .ogx
AddType video/ogg .ogv
AddType audio/ogg .oga

Most web servers are likely to return the mime type as “text/plain” which Mozilla will not show as video.  If you don’t set it, and it’s served up as text/plain then Firefox is likely to show either an error or endless buffering.  (Although I suspect that the endless buffering is actually a bug in our internal player and will likely be fixed.)

Update 1: This should have been video/ogg for .ogv, application/ogg for .ogg, and audio/ogg for .oga files.

Update 2: You should look at this post from Silvia for the correct information. Thanks, Frank.

This entry was posted in howto, OGG, Open Web, Video. Bookmark the permalink.

10 Responses to quick tip: open web video and mime types

  1. Frank Hecker says:

    I think recommended practice is now per RFC 5334, i.e., to use video/ogg and .ogv, audio/ogg and .oga, and application/ogg and .ogg/.ogx. Using video/ogg seems to work fine with Firefox and the video tag, this is what I did at http://hecker.org/mozilla/hfoss09

    See also Silvia Pfeiffer’s blog post at http://blog.gingertech.net/2008/09/05/new-ogg-mime-types-ratified/

  2. Pingback: video tag, Dreamhost and Firefox 3.5 | On the blink

  3. Sam Morris says:

    Will video/ogg work? I ask since it’s the default entry for .ogv in Debian’s /etc/mime.types.

  4. James Henstridge says:

    .ogg should be audio/ogg according to Xiph.org — not application/ogg.

  5. Frank Hecker says:

    James Henridge: You’re right, I was misremembering. Per section 10.3 of RFC 5334 the .ogg extension should indeed map to audio/ogg, for backwards compatibility with existing .ogg audio files.

    Sam Morris: I’m not sure what you mean by “Will video/ogg work?” It works fine in Firefox 3.0 in terms of downloading Ogg Theora files; for my personal web server .ogv gets mapped to video/ogg, and then my copy of Firefox is configured to launch VLC for video/ogg to view the files.

  6. Livio says:

    Most web servers are likely to return the mime type as “text/plain” which Mozilla will not show as video.

    And this is the badness of Mozilla products. It should confrontate extension with local system to check whether it is openable – or not.

    Also, Mozilla products, when a link clicked, don’t propose opening file inside, they always propose external programs, even when the file is only an image.

  7. Ian M says:

    Are these being made as defaults in the current version of Apache?

  8. @Livio – file extensions don’t have anything to do with what’s being served up. HTML can come in any form with any extension. Same with images, video, audio, etc. Some browsers sniff more than others, but that often leads to incorrect configurations by servers and clients and more compatibility problems down the road.

  9. Sam Morris says:

    Frank Hecker: Never mind, I see you said yourself that video/ogg worked with Firefox’s implementation. :)

  10. Noccy says:

    I found your page as I was looking for info on how to stream OGG video from VLC. It works between clients, but when streaming to a container it doesn’t. The reason is that VLC is sending out the application/octet-stream content type, which made me think; why doesn’t the tag has a type attribute for overriding content type? Would make sense :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">