Re: severe discrepancies in mp3 frame counts

Ben Winslow <[email protected]>
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
On Sun, 2004-05-23 at 19:49, Anthony DiSante wrote:
> Hello,
> 
> I'm seeing drastic discrepancies (an order of magnitude) between the mp3
> frame counts reported by xmms and the perl module MP3::Info.  This happens 
> with many, but not all, MP3 files I've tried.  Here are some example files:

> "Slow Descent" in the music section here:
> http://straylightrun.com/
> 
> XMMS reports:
> Distance: 6394 frames
> This Family Name: 9078 frames
> Slow Descent: 13535 frames
> 
> But MP3::Info reports:
> Distance: 68174 frames
> This Family Name: 96802 frames
> Slow Descent: 144313 frames
> 
> I'm using xmms version 1.2.10 and MP3::Info version 1.02.  Here's the code
> I'm using:
> 
> #!/usr/bin/perl
> use MP3::Info;
> my $mp3 = new MP3::Info $ARGV[0];
> print	  "$ARGV[0] : framecount is "
> 	. $mp3->frames
> 	. ", fps is "
> 	. sprintf("%.1f",($mp3->frames/$mp3->secs))
> 	. "\n";
> 
> ...and in xmms, I'm just right-clicking on the track in the playlist and
> choosing "View File Info."  My goal is to get an accurate FPS for any given
> mp3, so that my script can resume playback of a paused track, by passing
> --skip <FPS*elapsedtime> to mpg321.
> 
> Can anyone shed any light on this?
> 
> Thanks,
> Anthony
> http://nodivisions.com/

It looks like MP3::Info is barfing on ID3v2 tags--"A Slow Descent" has
one, and I suspect the others do as well (although I didn't check.)

The frame counters xmms is returning appear to be valid (madplay, a
completely separate mp3 decoder, returns the same number of frames, and
mpg321 would likely use the same frame count even if xmms's were wrong,
since the mp3 decoder in xmms and mpg321 both came from mpg123.)

If this is the case, you could strip ID3v2 tags (I think they're a
terrible, terrible hack, and I'm not alone in this sentiment), although
this leaves you with the somewhat restrictive ID3v1 tags; you could look
for an alternative to MP3::Info that knows about ID3v2 tags; or, you
could try to make MP3::Info read enough of the ID3v2 tag to skip it all
and read the real header (the first part of the ID3v2 tag is the encoded
length, IIRC.)

If you're not terribly attached to mpg321, madplay has an option to skip
to a specified time (not frame) in the file and is considered by many to
produce higher quality audio when decoding.

-- 
Ben Winslow <[email protected]>

_______________________________________________
xmms-devel mailing list
[email protected]
http://lists.xmms.org/mailman/listinfo/xmms-devel
signature.asc (application/pgp-signature, 900 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Fingerprint: 17F8 0D02 A7DA 7C7F A661  183D 6E2A 04FD 410A 2DCF

iQIVAwUAQLRMKm4qBP1BCi3PAQLrHhAAl5m5Kefi4Y3PF9jCnFjOnWqko40TwdE+
S260xft8GotapSL7pJv/wQ3G6VadUR70WeGp+UsmRQzFtQu6B3Imje8ktjRdbhpy
Eg0CNKWneyo8mJFS9eg/2QWYiAz2tLkAmm6NptsmwtxU2RE+jdiKyYU9bajotvmw
/ho7XogfdVPIw+Ng0Fnafbd+MCEYqYyqljULlWgmFNtW4O9RVBlnOAAcJoOS8G2i
b2aBS9Vk5upOZt0oID/nLOiE5BpIM3N+XmWTjlJXxuHlCmeo6Uo8HaFitGkE9Ato
3kQ2L0QjzrSma8OlwjBRo0bBqda7UxSMU4530qmMPYz0kh+xrgHJsU+Uq+2ZGq9e
5nr8Shku6SVcmCEUIyYvjPAJ/JZVkFlA/UW4+zp+ogPCgeogQ1jEwegthhatOLVg
89tDOF6j7zZT9PDbecrDTW9Mo1bIJ8eHA/D/H8WKfhyzAoadAU2FfM8YGipLsnV6
eRWDK2/EQJhkz+eKuSD3SSHR2OShXrWf/idQ7MITFH8w1D0ESXjk8NVyf3PWO+0+
jtmc3kHWk50xWQiP+Pp7qbzAJw+tEIN1A6tfjlbdkXhZA50XSC8PoqgtnuRjGR88
+8Kt8LUaznNpcUj/olVN7qzllD+K5J3Qw6qSTgnAlTNwYRXI7taHtLl/fWWnS9TC
GZ5XyBJ8Q4g=
=s08V
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.