[gst-devel] Some ideas on type detection

Wim Taymans wim.taymans at chello.be
Fri Aug 18 22:35:18 CEST 2000


"Myers W. Carpenter" wrote:
> 
> > needs rethinking:
> >
> > - type detection (too slow, need to load all the codecs)
> > - codec registry (same as type detection, is not scalable)
> 
>         Types are file/stream types (like avi and quicktime) and codec are
> codecs  in the file (like Divx or Sorenson), right?

Yes, they go hand in hand, because for a given type, you need to find the
right codec. Right now there is a typefind function inside the codecs/plugins 
that perform a type detection. The problem is that the typefind function is
available *after* the plugin is loaded. 

> 
>         We have a space in /etc/gstreamer were we have a "types" file.  When we
> add a new typewe run "gstreamer-register" and feed it a file that comes
> with the new plugin that has the mimetype, possible extentions, and
> something like an entry to the /etc/magic file that let's us guess what
> it is.

Right now, we can perform whatever code is needed to detect the type of the
file. Maybe we should add something to that to do the more common case of
a 'first 20 bytes will tell you all' type of detection.

>         When you open a file/streamer, you also pass the mimetype (if you know
> it), or the opening function can look for an extention to the file.
>         If it finds a possible match with the extention/mimetype it loads in
> the plugin for that type and has the plugin check to see if it's a valid
> file.  If it doesn't match it looks for another match (or maybe loads
> all the plugins and trys them one by one).

That would make sense and would solve at least the common case.

>         If no match then it tries all the "magic" entries to try and find out
> what it is.

/etc/mime-magic is quite good... 

> 
>         For codecs you would also run "gstreamer-register" but with --codec or
> something.  The codecs file would give infomation as to what file type
> it knows it's found it and the registry number it has it those files
> (ie. divx encoded files have the "DIV4" in their header).  Each filetype
> would have it's own file. So /etc/gstreamer would look like:

Have to think about it... 

Wim

-- 
There is no likelihood man can ever tap the power of the atom.
		-- Robert Millikan, Nobel Prize in Physics, 1923




More information about the gstreamer-devel mailing list