After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 94113 - spider doesn't detect type of mp3 stream
spider doesn't detect type of mp3 stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.6.0
Other Linux
: Normal normal
: 0.6.x
Assigned To: Ronald Bultje
GStreamer Maintainers
: 111428 115124 119159 119272 119911 120086 120306 121439 122924 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-09-24 21:29 UTC by Mark Finlay
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that backports 0.7 mp3 typefinding to 0.6 branch (8.52 KB, patch)
2003-04-10 02:42 UTC, Benjamin Otte (Company)
none Details | Review
patch to fix iradio code path (1.66 KB, patch)
2003-04-21 16:35 UTC, Colin Walters
none Details | Review
bla (2.16 KB, patch)
2003-08-13 18:35 UTC, Ronald Bultje
none Details | Review
gstreamer core patch for new typefinding (43.23 KB, patch)
2003-09-29 14:46 UTC, Ronald Bultje
none Details | Review
gstreamer plugins patch for new typefinding (94.22 KB, patch)
2003-09-29 14:46 UTC, Ronald Bultje
none Details | Review
New patch for plugins (97.25 KB, patch)
2003-09-30 14:38 UTC, Ronald Bultje
none Details | Review

Description Mark Finlay 2002-09-24 21:29:44 UTC
The following command sucessfully recognises and plays a stream:
gst-launch gnomevfssrc location="http://mp3.chemlab.org:8000/betasex" ! mad
! osssink

This command does not
gst-launch gnomevfssrc location="http://mp3.chemlab.org:8000/betasex" !
spider ! osssink

it just prints 
gnomevfssrc0: filesize = 0
gnomevfssrc0: offset = 4096
gnomevfssrc0: offset = 8192
gnomevfssrc0: offset = 12288

I am relatively ignorant of these things but it looks like spider isnt
autodetecting the stream format. I can provide more output if necessary.
Comment 1 Christian Fredrik Kalager Schaller 2002-09-25 18:57:18 UTC
Yeah, Spider needs some love or maybe even to be replaced.
Comment 2 Ronald Bultje 2003-04-06 22:38:47 UTC
Isn't this the same as in 104854?
Comment 3 Benjamin Otte (Company) 2003-04-10 02:41:59 UTC
Yes it's the same as 104854, but that is marked as fixed for some
reason ;)

However, I have just fixed this bug in HEAD, attaching patch for 0.6.1
and changing fields to represent that.
Comment 4 Benjamin Otte (Company) 2003-04-10 02:42:56 UTC
Created attachment 15607 [details] [review]
Patch that backports 0.7 mp3 typefinding to 0.6 branch
Comment 5 Ronald Bultje 2003-04-11 09:41:39 UTC
Got it - applied to 0.6.1.
Comment 6 Colin Walters 2003-04-19 08:50:35 UTC
I'm still having trouble with this actually with 0.6.1.  Here's the
commands I'm using to test:

 (/build/gstreamer-0.6/bin/gst-launch -v gnomevfssrc iradio-mode=1
location=http://205.188.209.193:80/stream/1003 ! spider ! esdsink 2>&1)

The pipeline does work if I replace "spider" with "mad".  And spider
*does* work with 0.7.x. 

Spider is much better at least for local files, so I'm just going to
hardcode mad for iradio in netRhythmbox when we're using GStreamer
0.6.x for now.
Comment 7 Mark Finlay 2003-04-19 11:56:07 UTC
Would be "really" great to get this fixed in the 0.6.x
series as it is causing problems getting net-rhythmbox
unforked.

I'm going to look into this tonight, see if I can come
up with anything useful.
Comment 8 Mark Finlay 2003-04-21 10:48:53 UTC
I can confirm Colin's test case...
Comment 9 Mark Finlay 2003-04-21 10:54:00 UTC
bug 
gst-launch gnomevfssrc
location="http://205.188.209.193:80/stream/1003" ! spider ! esdsink
does work. It seems that what was breaking Colin's test case was
the iradio-mode=1 1 part.

I'm not sure what exactly this means but hopefully it will
help the bug get fixed.
Comment 10 Mark Finlay 2003-04-21 10:55:23 UTC
above: /r/bug/but
Comment 11 Benjamin Otte (Company) 2003-04-21 14:20:37 UTC
Colin, did the fix we made to gnomevfssrc's iradio mode make it into
0.6.1 or is that fix only in HEAD?
This one:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/gnomevfs/gstgnomevfssrc.c.diff?r1=1.30&r2=1.31
Comment 12 Colin Walters 2003-04-21 16:35:30 UTC
Created attachment 15880 [details] [review]
patch to fix iradio code path
Comment 13 Colin Walters 2003-04-25 02:43:42 UTC
May I apply this patch to the 0.6.x CVS?
Comment 14 Ronald Bultje 2003-04-28 08:56:04 UTC
Yes, go ahead.
Comment 15 Ronald Bultje 2003-04-28 08:58:25 UTC
*** Bug 111428 has been marked as a duplicate of this bug. ***
Comment 16 Colin Walters 2003-04-28 17:55:07 UTC
Ok, applied.

Ideally though we wouldn't have to use this hack to make typefinding
work.  I think people were discussing having spider try pulling until
it had "enough" data to make a decision.

So we could keep this bug around as a wishlist to implement that.  Or
we could open a new one and close this one.  Up to you.
Comment 17 Benjamin Otte (Company) 2003-04-30 15:55:54 UTC
Problem is that nobody knows how much data we need for typefinding.
If somebody puts everything he can (complete with images of the 
cover) into an IDv2 tag at the beginning of the file, we could easily 
need 50k of data before we know what kind of data (mp3, flac, 
something else?) we have.

Another thing is that lots of mp3s have garbage at the beginning of 
the file, for example loads of zeroed bytes. If we wanted to support 
these (invalid) mp3s we would have to look quite far into the file 
(no idea how far).

However proper typefinding requires a redesign of the API for 
typefinding functions, the current API doesn't support this. (It 
should allow for some other things like ranks for sorting which 
typefind function to use first, confidence values, ...)
I did a bit of design on that one in Oslo but lost it somwhere.
Comment 18 mark.a.robson 2003-07-15 22:02:45 UTC
Could somebody please clarify the status of this bug. I'm a bit lost
following all the comments. Is it true that all 0.6.x versions are
broken? Does the above patch fix the problem? Is there a fix anywhere
for this bug?
Comment 19 Benjamin Otte (Company) 2003-07-16 13:34:52 UTC
a) Yes. Older 0.6 releases are more broken, newer are less broken. We 
still find cases where it doesn't work, but they've become less.
b) Both patches are applied in 0.6.2 I think, both fix some issues, 
buit not all.
c) No. But I'm aware of what needs to be done.
Comment 20 Benjamin Otte (Company) 2003-08-07 08:07:38 UTC
*** Bug 119272 has been marked as a duplicate of this bug. ***
Comment 21 Ronald Bultje 2003-08-13 18:35:05 UTC
Created attachment 19187 [details] [review]
bla
Comment 22 Ronald Bultje 2003-08-13 18:36:42 UTC
One of my mp3s refused to play, so I fixed spider to properly use
gst_buffer_merge(). It needed 4,2kB data and only fetched 4,0kB, so it
fetches 8kB typefind buffers now. This doesn't fix anything except my
specific mp3s.  We can probably extend this to 50k to make
99,99999999999999% of all songs work if anyone cares.

Patch is against 0.6.x, btw.
Comment 23 Colin Walters 2003-08-17 19:18:06 UTC
*** Bug 119911 has been marked as a duplicate of this bug. ***
Comment 24 Colin Walters 2003-08-17 19:18:31 UTC
*** Bug 120086 has been marked as a duplicate of this bug. ***
Comment 25 Ronald Bultje 2003-08-17 19:30:00 UTC
Patch applied to 0.6.x. Benjamin wants it *not* in HEAD so he'll fix
it "the right way" (I'm guessing for a new typefind system here? ;) ).
Comment 26 Ronald Bultje 2003-08-22 10:08:57 UTC
*** Bug 120306 has been marked as a duplicate of this bug. ***
Comment 27 Mark Finlay 2003-08-26 17:07:55 UTC
MMM, a lot of my mp3's still break this. That patch only applied 
to that guy's mp3s. And since this still exists on HEAD I'm going
to re-open...
Comment 28 Ronald Bultje 2003-08-26 18:45:14 UTC
Mark, we'll need examples of each and every mp3 file that breaks, I'm
affraid...
Comment 29 Mark Finlay 2003-08-26 20:02:32 UTC
I've got entire albums that don't work. I think it might be because
they have extra data in them like album covers. I'll upload a sample
somewhere...
Comment 30 Mark Finlay 2003-09-02 20:33:41 UTC
Trying to play http://sisob.tuxfamily.org/screenshots/broken.mp3

[sisob@localhost sisob]$ gst-launch filesrc location="broken.mp3" !
spider ! osssink
INFO (31660: 0) Initializing GStreamer Core Library version 0.6.3.1
INFO (31660: 0) CPU features: (c1c3f9ff) MMX SSE 3DNOW MMXEXT
INFO (31660: 0) registry: loaded user_registry in 0.000172 seconds
          (/home/sisob/.gstreamer/registry.xml)
INFO (31660: 0) registry: loaded global_registry in 0.155349 seconds
         
(/home/sisob/Software/gnome24/var/cache/gstreamer-0.6/registry.xml)
GStreamer-INFO: 0 live buffer(s)
GStreamer-INFO: 0 live bufferpool(s)
GStreamer-INFO: 0 live event(s)
RUNNING pipeline
ERROR: /pipeline0/spider0/sink_ident: Could not find media type
execution ended after 1 iterations (sum 96701000 ns, average 96701000
ns, min 96701000 ns, max 96701000 ns)
GStreamer-INFO: 0 live buffer(s)
GStreamer-INFO: 0 live bufferpool(s)
GStreamer-INFO: 0 live event(s)


Replacing spider with mad in the pipeline makes the mp3 play.

> Mark, we'll need examples of each and every mp3 file that breaks, 

I'm pretty sure that they are all breaking for the same reason as they
were all ripped within a few weeks of eachother using the same piece
of software.
Comment 31 Ronald Bultje 2003-09-03 07:44:46 UTC
Oh, but this is allright. I simply meant that when you find one that
breaks, I'd love to get a sample of it so I can reproduce it locally. :).

Thanks for the file, I'll look into it.
Comment 32 Ronald Bultje 2003-09-03 07:59:36 UTC
As I guessed, the typefind buffer is (again) too small. It has a JPG
image attached at the beginning of the file. The actual data only
starts around position 0x11CE0. The proper way to fix this is to let
the typefind function pull more data if needed. That's work for HEAD
though. Short-term solution (for 0.6.x) is - again (...) - to increase
the typefind buffer to something above 0x12000 (say, ~75kB) in spider.

And no, I don't like this either. :).
Comment 33 Ronald Bultje 2003-09-03 08:20:55 UTC
Oh, we could also consider to make 49 44 33 (ID3) be enough for
typefinding in 0.6.x, though that has some issues too because we'll
have one mismatch for every 2^24 (16M) files.
Comment 34 Kjartan Maraas 2003-09-06 20:49:24 UTC
There's an mp3 that fails to play at http://www.gnome.org/~kmaraas -
the massive attack one.
Comment 35 Ronald Bultje 2003-09-18 16:55:20 UTC
*** Bug 121439 has been marked as a duplicate of this bug. ***
Comment 36 James Kahn 2003-09-22 20:31:17 UTC
*** Bug 122924 has been marked as a duplicate of this bug. ***
Comment 37 Benjamin Otte (Company) 2003-09-26 14:45:08 UTC
I'm flagging this as our general "typefinding sucks and needs a 
rewrite - especially because of mp3" bug now.
Dear Rhythmbox guys, please mark all "mp3 could not be detected bugs 
as duplicates of this one.
Comment 38 Benjamin Otte (Company) 2003-09-26 14:46:38 UTC
*** Bug 119159 has been marked as a duplicate of this bug. ***
Comment 39 Ronald Bultje 2003-09-29 14:37:10 UTC
*** Bug 115124 has been marked as a duplicate of this bug. ***
Comment 40 Ronald Bultje 2003-09-29 14:45:42 UTC
I've got a new typefind system! :).

General explanation: instead of providing the typefind buffer with a
buffer, we let it pull buffers itself, so it always has enough data.
However, it doesn't read. Instead, it peeks, so we don't actually lose
data (that'd kill playback after typefinding).

typedef (GstCaps *) (* GstTypeFindFunc) (GstByteStream *bs, gpointer
data);

This has several effects:
* bytestream is now part of the core
* all plugins have been modified to use this new typefind system
* asf typefinding added
* mpeg video stream typefiding removed because it's broken
* duplicate typefind entries removed
* extra id3 typefinding added, because we've seen 4 types of files
(riff/wav, flac, vorbis, mp3) with id3 headers and each of these needs
to work. Instead, I've added an id3 element and let it redo typefiding
after the id3 header. this needs a hack because spider only typefinds
once. We can remove this hack once spider supports multiple typefinds.
* with all this, mp3 typefinding is semi-rewritten
* id3 typefinding in flac/vorbis is removed, it's no longer needed
* fixed spider and gst-typefind to use this, too.
* Other general cleanups

Patches follow. The resulting system works for me locally. I'd love
some people to test this. I want to commit this to HEAD asap.

Apart from the patches below, gstreamer/libs/gst/bytestream/*,
gst-plugins/gst/mpegaudioparse/gstmp3types.c,
gst-plugins/gst/mpegtypes/gstmpeg[12]types.c can be removed.
Comment 41 Ronald Bultje 2003-09-29 14:46:09 UTC
Created attachment 20353 [details] [review]
gstreamer core patch for new typefinding
Comment 42 Ronald Bultje 2003-09-29 14:46:31 UTC
Created attachment 20354 [details] [review]
gstreamer plugins patch for new typefinding
Comment 43 Ronald Bultje 2003-09-30 14:38:58 UTC
Created attachment 20385 [details] [review]
New patch for plugins
Comment 44 Ronald Bultje 2003-09-30 14:41:29 UTC
The new patch above differs in two respects:

* id3 plugin moved to its own directory. Dependency on libid3tag (mad)
is optional, though without it, metadata won't be read from the id3 tag.
* added a query() function to the id3types elements, this should make
it totally transparent to the pipeline.

I'd like to commit this asap, please make comments if things aren't
ok, else I'll commit it.
Comment 45 Ronald Bultje 2003-10-01 13:15:32 UTC
New stuff committed. If any problems arise, please open a new bug. I
consider this bug fixed for now, this is all we can do for both HEAD
and 0.6.x...