ALAC music file and Rating

Started by AllanMarcus, August 17, 2021, 07:15:44 PM

Previous topic - Next topic

AllanMarcus

Hello,

I've used exiftool for years with images, but recently tried to use it with music files. I'm trying to set the rating for an ALAC (M4A) file.  Before I try to set the rating with exiftool, there is already a rating there

exiftool -s -listg /media/content/music/ALAC/Adele/Adele\ -\ 21/06\ -\ Adele\ -\ He\ Wont\ Go.m4a | grep -i rating
RATING                          : 6


Then I try this command:

exiftool -RATING=4 /media/content/music/ALAC/Adele/Adele\ -\ 21/06\ -\ Adele\ -\ He\ Wont\ Go.m4a

and the results:

exiftool -s -listg /media/content/music/ALAC/Adele/Adele\ -\ 21/06\ -\ Adele\ -\ He\ Wont\ Go.m4a | grep -i rating
RATING                          : 6
Rating                          : 4


Any ideas how to change the existing tag? When I use Picard, it sees the RATING tag.

Phil Harvey

See FAQ 3 for help with this.

Also, it would be useful to see the output of the -v3 option for this file.  Could you post it here?  I would like to see how an all-capitals RATING tag is stored -- this is a bit odd.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

AllanMarcus

 exiftool -V /media/content/music/ALAC/Adele/Adele\ -\ 21/06\ -\ Adele\ -\ He\ Wont\ Go.m4a
  ExifToolVersion = 11.88
  FileName = 06 - Adele - He Wont Go.m4a
  Directory = /media/content/music/ALAC/Adele/Adele - 21
  FileSize = 33335266
  FileModifyDate = 1629242440
  FileAccessDate = 1629242443
  FileInodeChangeDate = 1629242440
  FilePermissions = 33252
  FileType = M4A
  FileTypeExtension = M4A
  MIMEType = audio/mp4
  FileType (SubDirectory) -->
  + [BinaryData directory, 16 bytes]
  | MajorBrand = M4A
  | MinorVersion = .
  | CompatibleBrands = isomiso2
  Free =
  Movie (SubDirectory) -->
  + [Movie directory]
  | MovieHeader (SubDirectory) -->
  | + [BinaryData directory, 100 bytes]
  | | MovieHeaderVersion = 0
  | | CreateDate = 0
  | | ModifyDate = 3712028089
  | | TimeScale = 1000
  | | Duration = 277947
  | | PreferredRate = 65536
  | | PreferredVolume = 256
  | | MatrixStructure = 1 0 0 0 1 0 0 0 16384
  | | PreviewTime = 0
  | | PreviewDuration = 0
  | | PosterTime = 0
  | | SelectionTime = 0
  | | SelectionDuration = 0
  | | CurrentTime = 0
  | | NextTrackID = 2
  | Track (SubDirectory) -->
  | + [Track directory]
  | | TrackHeader (SubDirectory) -->
  | | + [BinaryData directory, 84 bytes]
  | | | TrackHeaderVersion = 0
  | | | TrackCreateDate = 0
  | | | TrackModifyDate = 3712028089
  | | | TrackID = 1
  | | | TrackDuration = 277947
  | | | TrackLayer = 0
  | | | TrackVolume = 256
  | | | MatrixStructure = 1 0 0 0 1 0 0 0 16384
  | | | ImageWidth = 0
  | | | ImageHeight = 0
  | | Unknown_edts = .elst..=..
  | | Media (SubDirectory) -->
  | | + [Media directory]
  | | | MediaHeader (SubDirectory) -->
  | | | + [BinaryData directory, 24 bytes]
  | | | | MediaHeaderVersion = 0
  | | | | MediaCreateDate = 0
  | | | | MediaModifyDate = 3712028089
  | | | | MediaTimeScale = 48000
  | | | | MediaDuration = 13341440
  | | | | MediaLanguageCode = 21956
  | | | Handler (SubDirectory) -->
  | | | + [BinaryData directory, 37 bytes]
  | | | | HandlerClass =
  | | | | HandlerType = soun
  | | | | HandlerVendorID =
  | | | | HandlerDescription = SoundHandler
  | | | MediaInfo (SubDirectory) -->
  | | | + [MediaInfo directory]
  | | | | AudioHeader (SubDirectory) -->
  | | | | + [BinaryData directory, 8 bytes]
  | | | | | Balance = 0
  | | | | DataInfo (SubDirectory) -->
  | | | | + [DataInfo directory]
  | | | | | DataRef (SubDirectory) -->
  | | | | | + [DataRef directory]
  | | | | | | URL = .
  | | | | SampleTable (SubDirectory) -->
  | | | | + [SampleTable directory]
  | | | | | AudioSampleDesc (SubDirectory) -->
  | | | | | + [BinaryData directory, 44 bytes]
  | | | | | | AudioFormat = alac
  | | | | | | AudioVendorID =
  | | | | | | AudioChannels = 2
  | | | | | | AudioBitsPerSample = 16
  | | | | | | AudioSampleRate = 48000
  | | | | | + [AudioSampleDesc directory]
  | | | | | | Unknown_alac = ..(...@..p..
  | | | | | TimeToSampleTable = ......
  | | | | | SampleToChunk = .....|..x..t..r..n..f..e..b..e..h..b..^.._..V..X..Y..b..^..[snip]
  | | | | | SampleSizes = ..  .0..#K.................q.......R.m.'..#."F...H...<.v....$[snip]
  | | | | | ChunkOffset =  ....8 .$0p.@R.P:.`&qp.l.....:.._.....;.....S.jo.Z0..>...3../[snip]
  | UserData (SubDirectory) -->
  | + [UserData directory]
  | | Meta (SubDirectory) -->
  | | + [Meta directory]
  | | | Handler (SubDirectory) -->
  | | | + [BinaryData directory, 25 bytes]
  | | | | HandlerClass =
  | | | | HandlerType = mdir
  | | | | HandlerVendorID = appl
  | | | | HandlerDescription =
  | | | ItemList (SubDirectory) -->
  | | | + [ItemList directory]
  | | | | Title = He Won't Go
  | | | | Artist = Adele
  | | | | Album = 21
  | | | | Genre = Pop/Rock
  | | | | TrackNumber = ..
  | | | | DiskNumber = ..
  | | | | ContentCreateDate = 2011
  | | | | BeatsPerMinute = 162
  | | | | Encoder = Lavf58.20.100
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = HDCD
  | | | | | Data = .0
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = RATING
  | | | | | Data = .6
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Dynamic Range (DR)
  | | | | | Data = .7
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MEDIA
  | | | | | Data = .CD
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = initialkey
  | | | | | Data = .Cm
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Album Release Country
  | | | | | Data = .ZA
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = originalyear
  | | | | | Data = .2011
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = ~length
  | | | | | Data = .4:40
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = SCRIPT
  | | | | | Data = .Latn
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = replaygain_track_gain
  | | | | | Data = .-8.38
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = replaygain_track_peak
  | | | | | Data = .1.000
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = ARTISTS
  | | | | | Data = .Adele
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Album Type
  | | | | | Data = .album
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Tool Version
  | | | | | Data = .27.0.85
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Album Status
  | | | | | Data = .official
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = CATALOGNUMBER
  | | | | | Data = .CDJUST439
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = originaldate
  | | | | | Data = .2011-01-19
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = ISRC
  | | | | | Data = .GBBKS1000353
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Tool Name
  | | | | | Data = .Media Center
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = BARCODE
  | | | | | Data = .6009143461239
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = LABEL
  | | | | | Data = .XL Recordings
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Volume Level (ReplayGain)
  | | | | | Data = .-8.3822898864746094
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Dynamic Range (R128)
  | | | | | Data = .11.1847496032714844
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Volume Level (R128)
  | | | | | Data = .-13.3822898864746094
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Peak Level (Sample)
  | | | | | Data = .+0.0 dB;+0.0 Left;+0.0 Right
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Peak Level (R128)
  | | | | | Data = .+0.7 dBTP;+0.5 Left;+0.7 Right
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Track Id
  | | | | | Data = .4dd209b9-80fd-4e11-8093-3bab2db810fc
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Release Track Id
  | | | | | Data = .58580c2f-2d44-330a-97f7-06d80c60a373
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Acoustid Id
  | | | | | Data = .6caee767-1412-49ca-af97-9e70d2ceecf2
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Album Id
  | | | | | Data = .70c6a7dd-9f01-428a-a89e-ce843bcf9432
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Album Artist Id
  | | | | | Data = .cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Artist Id
  | | | | | Data = .cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MusicBrainz Release Group Id
  | | | | | Data = .e4174758-d333-4a8e-a31f-dd0edd51518e
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = MOOD
  | | | | | Data = .Acoustic
  | | | | | Data = .Not aggressive
  | | | | | Data = .Electronic
  | | | | | Data = .Not happy
  | | | | | Data = .Not party
  | | | | | Data = .Relaxed
  | | | | | Data = .Not sad
  | | | | + [iTunesInfo directory]
  | | | | | Mean = com.apple.iTunes
  | | | | | Name = Waveform
  | | | | | Data = ..0073;.0035;.0472;.0352;.0061;.0325;.0362;.006;.0511;.0402;.0064;.0[snip]
  | | | | CoverArt = .....JFIF......C..................................................[snip]
  | | | | AlbumArtist = Adele
  | | | | SortAlbumArtist = Adele
  | | | | SortArtist = Adele
  | | | Free =
  XMP (SubDirectory) -->
  + [XMP directory, 2781 bytes]
  | XMPToolkit = Image::ExifTool 11.88
  | Rating = 2
  MediaDataSize = 33291796
  MediaDataOffset = 43470
  MediaData =  ........................... ........................... ...............*[snip]


AllanMarcus

#3
oh, the way I got this file was a FLAC rip of the CD, then used MediaHuman Audio Converter to convert to ALAC. Oh, forgot to mention I ran the file through Picard after converting to ALAC

Phil Harvey

Unfortunately ExifTool doesn't yet write these iTunesInfo tags.  There are a number of tags in this file that I have never seen before.  Would it be possible to send me the file so I can analyze it further?  My email is philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

AllanMarcus

Quote from: Phil Harvey on August 18, 2021, 06:30:17 AM
Unfortunately ExifTool doesn't yet write these iTunesInfo tags.  There are a number of tags in this file that I have never seen before.  Would it be possible to send me the file so I can analyze it further?  My email is philharvey66 at gmail.com

- Phil

sent (via Google Drive). I did a little more checking, and the iTunes tags are all added by Musicbrainz Picard. 

Phil Harvey

I got the file, thanks.

I'll add better support for reading these tags, but unfortunately the ability to write them isn't something that would be easy to do.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

AllanMarcus

ok, thanks. It was worth a shot.