Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
460 stars 61 forks source link

Feature Request: Adding support for writing /mp42/isom m4a tags #259

Closed GOATS2K closed 6 months ago

GOATS2K commented 6 months ago

The problem

I just attempted to write tag some m4a files containing AAC audio and found that it wasn't being picked up by Mp3tag or foobar2000. I compared the file tagged by ATL with some files tagged by foobar2000 and found that the codec ID was different between both of them. They also look drastically different in a hex editor.

Here's some mediainfo for the file that both foobar2000 and Mp3tag is able to read:

General
Complete name                            : P:\Syncthing\Music\2001 - Musique Concrete\01 - Calibre - Deep Everytime.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /mp42/isom)
File size                                : 6.89 MiB
Duration                                 : 7 min 43 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 125 kb/s
Album                                    : Musique Concrete
Album/Performer                          : Calibre
Part/Position                            : 1
Part/Total                               : 2
Track name                               : Deep Everytime
Track name/Position                      : 1
Track name/Total                         : 21
Performer                                : Calibre
Genre                                    : Drum & Bass
Recorded date                            : 2001
Encoded date                             : UTC 2019-05-15 00:25:00
Tagged date                              : UTC 2019-05-15 00:25:17
Writing application                      : qaac 2.67, CoreAudioToolbox 7.9.8.3, AAC-LC Encoder, TVBR q91, Quality 96
Cover                                    : Yes
Comment                                  : CRSE002CD
SOURCE                                   : WEB
Encoding Params                          : (Binary)

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 7 min 43 s
Bit rate mode                            : Variable
Bit rate                                 : 109 kb/s
Maximum bit rate                         : 137 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.04 MiB (88%)
Encoded date                             : UTC 2019-05-15 00:25:00
Tagged date                              : UTC 2019-05-15 00:25:17

Menu
00:00:00.047                             : Deep Everytime

Versus the file tagged by ATL

General
Complete name                            : E:\m2\ST Files & Calibre - Astral Plane (2023) [BRINK002] [WEB M4A]\01 - ST Files & Calibre - Astral Plane.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /isom/iso2)
File size                                : 13.0 MiB
Duration                                 : 5 min 39 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 321 kb/s
Album                                    : Astral Plane
Album/Performer                          : ST Files & Calibre
Part/Position                            : 1
Part/Total                               : 1
Track name                               : Astral Plane
Track name/Position                      : 1
Track name/Total                         : 1
Performer                                : ST Files & Calibre
Genre                                    : Drum & Bass
Recorded date                            : 2023-10-27
Writing application                      : Lavf59.27.100
ISRC                                     : GXB532300003
LABEL                                    : Br:nk
SOURCE                                   : WEB
CATALOGNUMBER                            : BRINK002

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 5 min 39 s
Bit rate mode                            : Constant
Bit rate                                 : 320 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 12.9 MiB (100%)
Default                                  : Yes
Alternate group                          : 1

I would love to use ATL to write m4a tags that can be read by the other tools that I use.

Zeugma440 commented 6 months ago

I would love to use ATL to write m4a tags that can be read by the other tools that I use

We both share that goal 😉

I compared the file tagged by ATL with some files tagged by foobar2000 and found that the codec ID was different between both of them.

I'm sorry but the two examples you just posted cannot be compared... as they come from two different files and have different metadata

I just attempted to write tag some m4a files containing AAC audio and found that it wasn't being picked up by Mp3tag or foobar2000.

I've tested many MP4/M4A files tagged by ATL, that can be successfuly read on fb2k and mp3tag.

I think we should work over a sample file to make some progress. Could you send me one of the files that has problems through a 3rd party hosting service (e.g. dropbox or mega) ? My e-mail is (my Github username) [at] (not-cold) mail [dot] com

Thanks~

GOATS2K commented 6 months ago

I'll send you some sample files as soon as I can!

Zeugma440 commented 6 months ago

Thanks for the file!

Your issue is caused by a bug when processing fields whose code has less than 4 characters (the UPC field in your case).

The problem has been solved and the fix will be available in next release ✅

Zeugma440 commented 6 months ago

Available on today's v5.21. Please close the issue if it works on your side~

GOATS2K commented 6 months ago

Woah, that was fast, I'll give it a try later today. Thank you!

On Wed, 27 Mar 2024 at 07:53, Zeugma440 @.***> wrote:

Available on today's v5.21. Please close the issue if it works on your side~

— Reply to this email directly, view it on GitHub https://github.com/Zeugma440/atldotnet/issues/259#issuecomment-2022148456, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANI5XURO7CSEKYVSGD26FJLY2JUGNAVCNFSM6AAAAABFEZ7CJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRSGE2DQNBVGY . You are receiving this because you authored the thread.Message ID: @.***>

GOATS2K commented 6 months ago

That worked, thank you for the quick fix!