Bug 1002

Summary: Support OGG-packed video files.
Product: shared-mime-info Reporter: Petr Tomasek <tomasek>
Component: freedesktop.org.xmlAssignee: Christian - Manny Calavera - Neumair <cneumair>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: high CC: f, s.loeuillet
Version: unspecified   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: proof of concept patch
Committed patch

Description Petr Tomasek 2004-08-06 12:48:05 UTC
Hello!

1) I think there's missing support for .ogm files (OGG based videos with DIVx
streams inside). Any pln to support them?

2) There was a discussion (last month I think) on the theora mailing list about
separate extensions and mime-types for Ogg based audio and video files. The
conclusion was:

 a) officially only .ogg and application/ogg was supported, since this was
accepted by IETF, for BOTH audio and video.

 b) most people do want to have sepparate audio and video extensions/mime-types,
because both are opened by different players. Most people agreed on .ogv and
application/x-ogg-video (although some suggested .oggv as well). Some proposed
.oga resp. application/x-ogg-audio leaving .ogg for generally describing Ogg
streams.
So, my question is: since it seems, that (at least some) people will start using
.ogv for Theora files, would it make sense for the freedesktop.org mime-database
to support this?

Thanks!
Comment 1 Stéphane Loeuillet 2004-09-18 12:26:37 UTC
well well well, the eternal debate between container and content

ogg can contain tags, audio stream (including vorbis), video stream (including
thora), subs
riff is a container too (avi/wav/mid), like matroska (mkv)
mpeg streams were pure before id3 shit came in and did a terrible mess
ogm is a bad hack from the windows world
Comment 2 Stéphane Loeuillet 2004-09-18 12:35:17 UTC
see bug #397 about the same issue for asf (container) and wma/wmv (classic
extensions)
Comment 3 Christophe Fergeau 2004-12-10 11:34:04 UTC
Created attachment 1508 [details] [review]
proof of concept patch

This patch adds various glob patterns to try to fix what is explained in this
bug. However, there's still a problem with mime sniffing, ogm files will be
sniffed as application/ogg files :-/
Comment 4 f 2005-01-18 02:54:45 UTC
Hi!

At least the way ogg files are handled right now in xdg is wrong!
The file from shared-mime-info-0.15 /usr/share/mime/packages/freedesktop.org.xml
contains:

  <mime-type type="application/ogg">
    <comment>Ogg Vorbis audio</comment>
   [...]

And this is wrong! ogg is not Ogg Vorbis audio only e.g. ogg media streams
containing video get the same.

Please correct at least this error until a better solution is found.

thanks, Fabian
Comment 5 Christophe Fergeau 2005-05-18 02:00:55 UTC
http://bugzilla.gnome.org/show_bug.cgi?id=302757 has comments related to this
issue, in particular magic patterns we could use (though I guess this is an ugly
hack, but it seems to work...)
Comment 6 j^ 2005-05-21 06:41:53 UTC
to my idea was to use the mime magic paterns to match all known codecs 
and fallback to application/ogg if not known.
the problem with the attached version is that it matches "Ogg Multimedia"
in the list view until one selects the file. than it will do an exact match.
is this a bug in nautilus not using the priortiy?

---
  <mime-type type="application/ogg">
    <comment>Ogg Multimedia</comment>
    <magic priority="40">
      <match type="string" value="OggS" offset="0"/>
    </magic>
    <glob pattern="*.ogg"/>
  </mime-type>
  <mime-type type="audio/vorbis">
    <comment>Ogg Vorbis audio</comment>
    <magic priority="50">
      <match type="string" value="OggS" offset="0">
        <match type="string" value="\x01vorbis" offset="28"/>
      </match>
    </magic>
    <glob pattern="*.ogg"/>
  </mime-type>
  <mime-type type="audio/x-oggflac">
    <comment>Ogg FLAC audio</comment>
    <magic priority="50">
      <match type="string" value="OggS" offset="0">
        <match type="string" value="fLaC" offset="28"/>
      </match>
    </magic>
    <glob pattern="*.ogg"/>
  </mime-type>
  <mime-type type="audio/x-speex">
    <comment>Ogg Speex audio</comment>
    <magic priority="50">
      <match type="string" value="OggS" offset="0">
        <match type="string" value="Speex  " offset="28"/>
      </match>
    </magic>
    <glob pattern="*.ogg"/>
  </mime-type>
  <mime-type type="video/x-theora">
    <comment>Ogg Theora video</comment>
    <magic priority="50">
      <match type="string" value="OggS" offset="0">
        <match type="string" value="\x80theora" offset="28"/>
      </match>
    </magic>
    <glob pattern="*.ogg"/>
  </mime-type>
  <mime-type type="video/x-ogm">
    <comment>OGM video</comment>
    <magic priority="50">
      <match type="string" value="OggS" offset="0">
        <match type="string" value="video" offset="29"/>
      </match>
    </magic>
    <glob pattern="*.ogm"/>
  </mime-type>
Comment 7 Christian - Manny Calavera - Neumair 2005-12-02 09:01:48 UTC
Created attachment 3969 [details] [review]
Committed patch

Patch that was committed to shared-mime-info, and fixes the issue together with
recent xdgmime updates.

Distributors: Don't blindly distribute it. Ensure that you also ship the recent
update-mime-database.c changes and Matthias Clasen's work on xdgmime if you
want to backport this one. It won't break, but doesn't improve the situation.
Comment 8 Sebastien Bacher 2006-04-08 03:53:55 UTC
should that bug be marked as fixed?
Comment 9 Christian - Manny Calavera - Neumair 2006-04-08 05:54:24 UTC
Yes, thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.