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

MP4 File's bitrate return 0 #961

Closed
TheRealNox opened this issue Jun 18, 2020 · 4 comments
Closed

MP4 File's bitrate return 0 #961

TheRealNox opened this issue Jun 18, 2020 · 4 comments

Comments

@TheRealNox
Copy link

TheRealNox commented Jun 18, 2020

When a M4A file is written using refalac64, taglib always return a bitrate of 0.
Here is the MediaInfo of the file

General
Complete name                            : D:\Music\Electro\Progressive House\Deadmau5\2010 - 4x4=12\01 - Some Chords.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /mp42/isom)
File size                                : 51.4 MiB
Duration                                 : 7 min 27 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 964 kb/s
Album                                    : 4x4=12
Track name                               : Some Chords
Track name/Position                      : 1
Track name/Total                         : 12
Performer                                : Deadmau5
Genre                                    : Progressive House
Recorded date                            : 2010
Encoded date                             : UTC 2018-11-15 11:49:54
Tagged date                              : UTC 2018-11-15 11:50:02
Writing application                      : refalac 1.64, Apple Lossless Encoder
Cover                                    : Yes
VENDORID                                 : reference libFLAC 1.3.0 20130526

Audio
ID                                       : 1
Format                                   : ALAC
Codec ID                                 : alac
Codec ID/Info                            : Apple Lossless Audio Codec
Duration                                 : 7 min 27 s
Duration_LastFrame                       : -59 ms
Bit rate mode                            : Variable
Bit rate                                 : 960 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Stream size                              : 51.2 MiB (100%)
Encoded date                             : UTC 2018-11-15 11:49:54
Tagged date                              : UTC 2018-11-15 11:50:02

If I convert it back using ffmpeg, it's all fine again.
Here is the new MediaInfo when converted with ffmpeg:

General
Complete name                            : C:\Users\Nox\Desktop\2010 - 4x4=12\01 - Some Chords.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /isom/iso2)
File size                                : 52.7 MiB
Duration                                 : 7 min 27 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 989 kb/s
Album                                    : 4x4=12
Track name                               : Some Chords
Track name/Position                      : 1
Track name/Total                         : 12
Performer                                : Deadmau5
Genre                                    : Progressive House
Recorded date                            : 2010
Writing application                      : Lavf58.43.100
Cover                                    : Yes

Audio
ID                                       : 1
Format                                   : ALAC
Codec ID                                 : alac
Codec ID/Info                            : Apple Lossless Audio Codec
Duration                                 : 7 min 27 s
Duration_LastFrame                       : -59 ms
Bit rate mode                            : Variable
Bit rate                                 : 984 kb/s
Nominal bit rate                         : 1 411 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Stream size                              : 52.5 MiB (100%)
Default                                  : Yes
Alternate group                          : 1

Not sure if the issue lies in taglib or refalac, but WIndows Explorer and iTunes can read the bitrate properly.

Thanks!

ufleisch added a commit to ufleisch/taglib that referenced this issue Dec 8, 2020
If the "alac" atom of an MP4 file has a zero bitrate, it is calculated.
@ufleisch
Copy link
Contributor

ufleisch commented Dec 8, 2020

I could reproduce this by generating an ALAC file using refalac. The files generated by this tool have zero in the bitrate field of the alac atom. Other tools - I checked mediainfo and AtomicParsley - calculate the bitrate in this case. I have made a patch to do the same in TagLib. Although I do not have any ALAC files with zero bitrate, I nevertheless compared the calculated bitrate with the nominal bitrate stored in the alac atom of all my ALAC files, and the numbers were the same, or the calculated bitrate was only one lower.

@TheRealNox
Copy link
Author

Thanks for that @ufleisch I'll be sure to give it a try as soon as I get access back to my desktop machine (might take a while, thanks covid-19!)

@TheRealNox
Copy link
Author

Ah looking at your fix, that's pretty much what I was doing in my code when encountering a 0 for the bitrate :)

ufleisch added a commit to ufleisch/taglib that referenced this issue Dec 21, 2020
If the "alac" atom of an MP4 file has a zero bitrate, it is calculated.
ufleisch added a commit to ufleisch/taglib that referenced this issue Dec 31, 2020
…rate

Calculate bitrate for ALAC files without it (taglib#961)
ufleisch added a commit that referenced this issue Jan 2, 2021
Calculate bitrate for ALAC files without it (#961)
@ufleisch
Copy link
Contributor

Fixed with #981.

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

2 participants