Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Tags: multiple genres
#21
(04-14-2023, 07:55 AM)Huebi Wrote:
(04-13-2023, 03:24 PM)TheOldPresbyope Wrote: but I don't see an easy way to post an issue to their site.

https://github.com/MediaArea/MediaInfo

Oh, duh Blush 

Just because github isn't mentioned on their website doesn't mean they don't use it!

Looks like the repo of interest is the companion https://github.com/MediaArea/MediaInfoLib.

It's pretty well organized and it's easy to drill down to Source/MediaInfo/Tag/File_Id3v2.cpp but then ya gotta understand the parsing and C++ sources are not my thing. Since I don't use ID3 by choice so I'll leave the issue posting to someone else.

Thanks and regards,
Kent
Reply
#22
@Nutul 

ffprobe (companion to ffmpeg) is already present in the moOde image.

What do you get on your MP3/ID3v2.4 file if you run


Code:
ffprobe -show_format -print_format json  <input file>



Here's what I get for a random MP3/ID3v2.3 file I pulled from the InterWeb™


Code:
{
Input #0, mp3, from 'Run Kid Run - Sing To Me.mp3':
 Metadata:
   title           : Sing to Me
   album           : This is Who We Are
   track           : 4
   artist          : Run Kid Run
   genre           : Rock
   comment         : -
   encoded_by      : Lame
   date            : 2006
   id3v2_priv.AverageLevel: \xcc&\x00\x00
   id3v2_priv.PeakValue: \xff\x7f\x00\x00
 Duration: 00:03:05.18, start: 0.025057, bitrate: 238 kb/s
 Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 238 kb/s
   Metadata:
     encoder         : LAME3.97b
   Side data:
     replaygain: track gain - -8.700000, track peak - unknown, album gain - unknown, album peak - unknown,
   "format": {
       "filename": "Run Kid Run - Sing To Me.mp3",
       "nb_streams": 1,
       "nb_programs": 0,
       "format_name": "mp3",
       "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
       "start_time": "0.025057",
       "duration": "185.182041",
       "size": "5529606",
       "bit_rate": "238883",
       "probe_score": 51,
       "tags": {
           "title": "Sing to Me",
           "album": "This is Who We Are",
           "track": "4",
           "artist": "Run Kid Run",
           "genre": "Rock",
           "comment": "-",
           "encoded_by": "Lame",
           "language": "English",
           "date": "2006",
           "id3v2_priv.AverageLevel": "\\xcc&\\x00\\x00",
           "id3v2_priv.PeakValue": "\\xff\\x7f\\x00\\x00"
       }
   }
}



Regards,
Kent
Reply
#23
Hi Kent,

this is what I get with a .mp3 file with 2 genres separated by \0 (as kid3 does if you separate them with a "|" - pipe)
it just shows the first genre, the second one being - you guessed - "track_genre_2"
 Looks to me both ffprobe and mediainfo use the same tag library...


Code:
{
Input #0, mp3, from '/home/batman/Music/test_tags/01 test genre tags.mp3':
 Metadata:
   artist          : track_artist_mp3
   title           : track_title_mp3
   album           : track_album_mp3
   date            : 1901
   COMMENT         : track_comment
   album_artist    : track_album_artist
   track           : 01
   encoder         : Lavf58.29.100
   genre           : track_genre_1
 Duration: 00:03:52.59, start: 0.025057, bitrate: 128 kb/s
   Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
   Metadata:
     encoder         : Lavc58.54
   "format": {
       "filename": "/home/batman/Music/test_tags/01 test genre tags.mp3",
       "nb_streams": 1,
       "nb_programs": 0,
       "format_name": "mp3",
       "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
       "start_time": "0.025057",
       "duration": "232.594286",
       "size": "3722990",
       "bit_rate": "128050",
       "probe_score": 51,
       "tags": {
           "artist": "track_artist_mp3",
           "title": "track_title_mp3",
           "album": "track_album_mp3",
           "date": "1901",
           "COMMENT": "track_comment",
           "album_artist": "track_album_artist",
           "track": "01",
           "encoder": "Lavf58.29.100",
           "genre": "track_genre_1"
       }
   }
}

I'll have a look at the source code for mediainfo though, I chew C and C++ since when the Berlin Wall was still a thing...
Reply
#24
@Nutul 

Coming to the end of my self-isolation as my Covid bout recedes, but I took advantage of the remaining downtime to explore this multi-genre issue with ID3v2.4.

Finally located the archived work I started some years ago regarding metadata tagging schemes and reinstalled a bunch of editor/validator tools I'd assembled at the time. It all got mothballed as I prepared to downsize and move and never got back to it.

1. Took my synthetic WAV file composed of the 5-note motif from "Close Encounters of the Third Kind" and transcoded it to MP3.
2. Added ID3v2.4 metadata initially using Kid3, touched it up with Mp3tag, with two genre values Genre1 and Genre2.
3. Did an octal dump (od -c) on the front end of the file to convince myself the TCON entry was properly Genre1\0Genre2 at the byte level
4. Examined the file with various tools

GUI-based
  • Mp3tag displays Genre1\\Genre2 on the tag panel while on the Extended Tags panel it shows two GENRE entries, one for each value (this is consistent with my understanding of its internal representation).
  • Kid3 displays Genre1|Genre2
  • MusicBrainz Picard displays Genre1/Genre2
  • Mp3Diags displays Genre1, Genre2
  • foobar2000 displays Genre1; Genre2
  • Qoobar displays Genre1 Genre2
  • EasyTAG displays Genre1 Genre2
Command line-based
  • exiftool displays Genre1/Genre2
  • as we already know, ffprobe/ffmpeg and mediainfo display only Genre1

Bit of a mixed bag but at least most of them properly parse the ID3v2.4 multi-value text frame TCON

Now back to getting my quarterly income tax figured out. It's amazing what I'll do to procrastinate doing that Rolleyes

Regards,
Kent

PS - all the above tool were either native Linux executables or Windows executables installed on Wine using PlayOnLinux.
Reply
#25
(04-16-2023, 05:07 PM)TheOldPresbyope Wrote: Bit of a mixed bag but at least most of them properly parse the ID3v2.4 multi-value text frame TCON
Hi Kent,
yep, I don't have that huge collection of tag parsers in my Linux box, so it's nice to see that most (if not all) of them react consistently.

The main thing is, though, that MPD does know how to parse id3v2.4 tags, and understand that there are several genres in it.

As I said, this will never be an issue for me, as I use only FLACs (no, I don't have any WAV, as I can reconstruct them from the FLACs, obviously), so only Vorbis Comment for me; and since MPD handles them perfectly, that's enough for me.
Reply
#26
@Nutul 

Yeah, I don't use MP3 either. This was just an exercise for me. Like any good workman I like to keep my tools oiled and sharpened.

As for the WAV file, I generated that years ago using only ffmpeg so I'd have a base file which
1) was unencumbered by any RTU issues
2) could be played directly by aplay
3) could be transcoded to any file format I want, whether compressed or uncompressed, lossy or lossless
4) could be loaded up with whatever metadata I wanted for test purposes.

It's served me well.

Regards,
Kent
Reply


Forum Jump: