Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Approximate duration doubled on mp3 files #160

Open
Domi250 opened this issue Oct 26, 2022 · 5 comments
Open

Bug: Approximate duration doubled on mp3 files #160

Domi250 opened this issue Oct 26, 2022 · 5 comments

Comments

@Domi250
Copy link

Domi250 commented Oct 26, 2022

Hi, I think I found a bug in exiftool version 12.16 concerning mp3 metadata. I don't know if its already fixed in newer versions, I'm sorry if that's the case.

exiftool "Mono Inc. - Voices of Doom.mp3"
prints
Duration : 0:10:03 (approx)
Which is twice the correct amount of time (0:05.01). This happens to me with any mp3 file downloaded with spotdl (I don't have any other mp3s to test it with). ffprobe delivers the correct time for this file: duration=301.272000
I'm not sure if I can share this file due to copyright, otherwise I would.

Thank you!

@Domi250 Domi250 changed the title Bug: Approxamate duration doubled on mp3 files Bug: Approximate duration doubled on mp3 files Oct 26, 2022
@boardhead
Copy link
Contributor

Can you tell me the value of these tags?:

AudioBitrate
VBRFrames
SampleRate
MPEGAudioVersion

ExifTool calculates the approximate duration from these tags.

Also, is the file mono or stereo?

  • Phil

@Domi250
Copy link
Author

Domi250 commented Oct 27, 2022

Sure.

According to exiftool V12.16:

MPEG Audio Version              : 1
Audio Bitrate                   : 64 kbps
Channel Mode                    : Stereo
MS Stereo                       : Off

However, my exiftool doesn't print any VBRFrames tag. I don't know what this tag does, but I think it might not be set, since
strings "Mono Inc. - Voices of Doom.mp3" | grep -i VBR
doesn't print any meaningful results.


My whole exiftool output (with cut lyrics) is:

$ exiftool Mono\ Inc.\ -\ Voices\ of\ Doom.mp3 

ExifTool Version Number         : 12.16
File Name                       : Mono Inc. - Voices of Doom.mp3
Directory                       : .
File Size                       : 4.7 MiB
File Modification Date/Time     : 2022:10:26 12:33:01+02:00
File Access Date/Time           : 2022:10:26 12:33:01+02:00
File Inode Change Date/Time     : 2022:10:26 12:33:01+02:00
File Permissions                : rw-r--r--
File Type                       : MP3
File Type Extension             : mp3
MIME Type                       : audio/mpeg
MPEG Audio Version              : 1
Audio Layer                     : 3
Audio Bitrate                   : 64 kbps
Sample Rate                     : 48000
Channel Mode                    : Stereo
MS Stereo                       : Off
Intensity Stereo                : Off
Copyright Flag                  : False
Original Media                  : False
Emphasis                        : None
ID3 Size                        : 74388
Title                           : Voices of Doom
Artist                          : Mono Inc.
Track                           : 1/16
Album                           : Voices of Doom
Part Of Set                     : 1/1
Warning                         : [minor] Frame 'TDRC' is not valid for this ID3 version
Recording Time                  : 2009:09:17
Genre                           : dark rock
Original Release Time           : 2009
Encoded By                      : NoCut
Band                            : Mono Inc.
Copyright                       : (C) 2013 NoCut/SPV
Source URL                      : https://www.youtube.com/watch?v=neSUm1zd9wA
Comment (xxx)                   : https://www.youtube.com/watch?v=neSUm1zd9wA|https://open.spotify.com/track/3b0Q1AmCQIbFFILC73jH7D
Lyrics                          : (desc) [Intro].Sing..[Verse 1].Here's my...
Picture MIME Type               : image/jpeg
Picture Type                    : Front Cover
Picture Description             : Cover
Picture                         : (Binary data 64238 bytes, use -b option to extract)
Duration                        : 0:10:03 (approx)

- Dominik

@boardhead
Copy link
Contributor

The VBRFrames is only used for variable bitrate encoding, which this file is apparently not.

I think that ffprobe probably analyzes the audio stream to exactly determine the duration. ExifTool doesn't analyze the whole stream, and just calculates an approximate duration from the header information. Taking the extracted information at face value, if the bitrate really is 64 kbps you would get about 10 minutes out of a 4.7 MiB file, so the calculation makes sense. Either the extracted bitrate is wrong, or half of the file doesn't contain audio information. I can't say which without analyzing the sample carefully.

  • Phil

@Domi250
Copy link
Author

Domi250 commented Oct 27, 2022

You are right, ffprobe indeed shows a framerate of about 129 kbit/s, pretty much double of exiftool.
I've found sone audio without copyright, once again downloaded it with spotdl, and attached it here:
song.zip
(mp3 are not supported on github, therefore it's a zip)
This file has the same problem.

- Dominik

@v0h0ang
Copy link

v0h0ang commented Apr 4, 2023

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants