FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Song length detection in vbr mp3s
- This topic has 13 replies, 3 voices, and was last updated 17 years, 8 months ago by rpedde.
-
AuthorPosts
-
12/03/2007 at 3:01 PM #9528CCRDudeParticipant
Lame 3.96 does this as well? In this case I can probably find it myself, let me take a look… yes, I found it!
Btw, here is a description of the Xing header I just found and used for implementing:
http://www.codeproject.com/audio/MPEGAudioInfo.aspSomething interesting: the files I ripped using CDex show a different default TLEN than this field! (only a few milliseconds, but still)…
Well, code has already been implemented roughly, just need to give it a short test with a few more files.
12/03/2007 at 6:31 PM #9529rpeddeParticipant@CCRDude wrote:
Lame 3.96 does this as well? In this case I can probably find it myself, let me take a look… yes, I found it!
Btw, here is a description of the Xing header I just found and used for implementing:
http://www.codeproject.com/audio/MPEGAudioInfo.aspSomething interesting: the files I ripped using CDex show a different default TLEN than this field! (only a few milliseconds, but still)…
Well, code has already been implemented roughly, just need to give it a short test with a few more files.
That’s the page I used as a reference too. Currently to determine song duration I use TLEN first, then Xing (if present), then frame counts (if mode 1 or 2), and if all else fails, data length and bitrate.
12/03/2007 at 9:45 PM #9530CCRDudeParticipantA quick command line solution for now (I’m out of the house for most of the week, so I don’t have time for more right now), which parses all specified mp3 files in a folder, and adds or updates TLEN fields in existing ID3v2 tags.
Usage:
trMP3Length *.mp3 /recursive /debug
Would show actions that would be done on all mp3 files in the current folder and subfolders. Add /udpate to not only add TLEN where its missing, but also correct TLEN where it’s different from the Xing field. And if everything looks ok, use /write as well to actually have it write the changes, so once you’ve verified everything is correct, use:
trMP3Length *.mp3 /recursive /debug /update /write
Disclaimer: Trying this on a copy of a single folder first is recommended, just to make sure it doesn’t conflict with your style of tags. It won’t do anything if it doesn’t recognize the tag (e.g. it won’t deal with ID3v2.2, only with ID3v2.3 and ID3v2.4) and understands even unsynchronizing and unknown fields, but who knows, the ID3v2 standard has been interpreted in a lot of different ways by some.
Oh, and since Ron mentioned the nightlies already know even more methods to determine it, just regard this as “tag beautification”, not as something important, if you’re using a nightly 😉
If I find the time, I’ll probably see if I could implement the other ways as well if Xing tags are not present (like I just saw with iTunes-generated MP3 files), as well as VBRI frames.
13/03/2007 at 12:12 AM #9531rpeddeParticipant@CCRDude wrote:
Click for trMP3Length.zip (Windows only currently, didn’t find the time to port to FreePascal/Linux yet)
Beauty. Nicely done, sir.
— Ron
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.