Hello,
I'm an ampache user and I found some troubles. Their are linked to getid3.
This file for examples is said to have a 144239.41380115 bitrate.
All other tools I have reports a 128K bitrate.
The example file : http://konilope.linuxeries.org/tmp/a.mp3
The sample basic code that shows the trouble :
http://fw/tmp/getid3/demos/demo.basic.php
Can this be fixed ?
Cheers,
Erwan
getid3 reports a wrong bitrate on some files
-
- User
- Posts:6
- Joined:Wed Jul 30, 2008 9:34 pm
Re: getid3 reports a wrong bitrate on some files
sorry for the wrong url.
please read : http://konilope.linuxeries.org/tmp/geti ... .basic.php
please read : http://konilope.linuxeries.org/tmp/geti ... .basic.php
-
- User
- Posts:6
- Joined:Wed Jul 30, 2008 9:34 pm
Re: getid3 reports a wrong bitrate on some files
I also have same oggs that plays nearly the same :
http://konilope.linuxeries.org/tmp/geti ... ic.ogg.php
http://konilope.linuxeries.org/tmp/b.ogg
This ogg is a 192kbps and shown as 189228.97733435
Any ideas why ?
http://konilope.linuxeries.org/tmp/geti ... ic.ogg.php
http://konilope.linuxeries.org/tmp/b.ogg
This ogg is a 192kbps and shown as 189228.97733435
Any ideas why ?
-
- User
- Posts:6
- Joined:Wed Jul 30, 2008 9:34 pm
Re: getid3 reports a wrong bitrate on some files
I made also some others tests.. The demo.browse reports lots of different bitrates whereas all of them are strict 128k as mplayer or mpeginfo reports.
-
http://konilope.linuxeries.org/tmp/geti ... browse.php
-
http://konilope.linuxeries.org/tmp/geti ... browse.php
-
- User
- Posts:6
- Joined:Wed Jul 30, 2008 9:34 pm
Re: getid3 reports a wrong bitrate on some files
The very simple code reports the correct 128Kbps bitrate on my files. If this can helps...
-
http://www.phpcs.com/codes/FONCTION-PHP ... 25034.aspx
-
http://www.phpcs.com/codes/FONCTION-PHP ... 25034.aspx
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: getid3 reports a wrong bitrate on some files
No, because it's right :)erwan wrote:Can this be fixed ?
The file is in fact a VBR file of approx 144kbps. You can verify this with a simple calculation -- the playtime is 5:35 (335 seconds), and the filesize is ~5.8MB (6055936 bytes).
Since there is 8 bits in 1 byte, you get:
(6055936 * 8) / 335 = 144619bps
Note: this number is slightly off since it's not taking into account the space used by ID3v2, ID3v1, VBR header, and the playtime is rounded, but you can see it's very close to the actual bitrate of 144239bps.
More simplistic programs might simply examine the first frame of the file and see 128kbps (or 192kbps or whatever) and report that as the bitrate for the entire file, which is incorrect.
This file was encoded with a nominal (i.e. target) bitrate of 192kbps. The actual encoded bitrate is ~189kbps which is pretty close to the target. The encoder tries to match the target bitrate as best it can; for single-pass encoding a deviation of 1.5% from target is perfectly normal.erwan wrote:This ogg is a 192kbps and shown as 189228.97733435
getID3 is reporting correct values for both files.
-
- User
- Posts:6
- Joined:Wed Jul 30, 2008 9:34 pm
Re: getid3 reports a wrong bitrate on some files
That's at least very surprising to see a bitrate such 144239.41380115
Does all external code that uses getid3() must round your bitrate calculation ?
Does all external code that uses getid3() must round your bitrate calculation ?
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: getid3 reports a wrong bitrate on some files
If you want the actual bitrate, rounding is not neccesary. If you want to display the bitrate to the user (for example), in most cases the displayed bitrate would likely be shown in kbps, so you'd display it as
Code: Select all
round($info['bitrate'] / 1000);