Very odd behaviour

Support for macOS users
Post Reply
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Very odd behaviour

Post by UKenGB »

Constructing a suitable format for some audio files and came across this aberration:-

Code: Select all

TALB=72 Jazz Classics
TBPM=2
TCMP=1
TCON=Jazz
TIT2=Marching Through Georgia
TLEN=198200
TPE1=Acker BILK
TPE2=VARIOUS ARTISTS
TPOS=1/4
TRCK=1
TSOP=BILK•Acker

Mediainfo says:
Complete name                            : /Volumes/JukeBox/Media/Music/Compilations/72 Jazz Classics/1-01 Marching Through Georgia.mp3
Format                                   : MPEG Audio
File size                                : 3.18 MiB
Duration                                 : 3 min 18 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 134 kb/s
Album                                    : 72 Jazz Classics
Album/Performer                          : VARIOUS ARTISTS
Part/Position                            : 1
Part/Total                               : 4
Track name                               : Marching Through Georgia
Track name/Position                      : 1
Compilation                              : Yes
Compilation                              : Yes
Performer                                : Acker BILK
Performer/Sorted by                      : BILK•Acker
Genre                                    : Jazz
Writing library                          : LAME3.93 
BPM                                      : 2
Comment                                  : <RDate=1993>
Another file shows this:-

Code: Select all

TALB=A Christmas Gift For You
TBPM=2
TCMP=1
TCON=Christmas
TIT2=White Christmas
TPE1=Darlene LOVE
TPE2=VARIOUS ARTISTS
TRCK=1
TSOP=LOVE•Darlene
TYER=1963

Mediainfo says:
Complete name                            : /Volumes/JukeBox/Media/Music/Compilations/A Christmas Gift For You/01 White Christmas.mp3
Format                                   : MPEG Audio
File size                                : 6.73 MiB
Duration                                 : 2 min 56 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 320 kb/s
Album                                    : A Christmas Gift For You
Track name                               : White Christmas
Track name/Position                      : 1
Performer                                : Darlene LOVE
Accompaniment                            : VARIOUS ARTISTS
Genre                                    : Christmas
Recorded date                            : 1963
Writing library                          : LAME3.91
BPM                                      : 2
To save you from searching, both of these MP3 files have the [Album Artist] set to 'VARIOUS ARTISTS' in iTunes and both show this as the correct TPE2 code in the first tag checker above. But Mediainfo says different and shows these in the first file as the normal Album/Performer, but in the second file, it appears as Accompaniment. WTF?

FileBot obviously can only use what Mediainfo supplies, but why is MI using 2 different tag descriptions for the same tag. When trying to set up a format that matches and uses data based on the tag description, this sort of carry on is hopeless. Why on earth is MI so mixed up about this?

Is there any way we can bind to a tag using the short code for the tag, so I could simply use TPE2 and always get the right data?
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Re: Very odd behaviour

Post by UKenGB »

Mediainfo obviously has some problems. Only one of the files above shows it, but both those tracks are set as Compilations in iTunes, so the TCMP tags is set and this shows for both files in the first tagger output above and also in GUI apps that provide the same function - including the GUI version of MediaInfo. This not only shows Compilation set in both, but it also shows Album/Performer in both files. So the CLI version has a problem and that is obviously what FileBot is using.

Sigh.

Any suggestions?
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

It gets worse

Post by UKenGB »

I added something to [Sort Album Artist]. This fixed the problem above and Mediainfo now reports [Album Artist] as Album/Performer and not confusing itself with Accompaniment. But...

Code: Select all

TALB=A Christmas Gift For You
TBPM=2
TCMP=1
TCON=Christmas
TDRC=1963
TIT2=White Christmas
TPE1=Darlene LOVE
TPE2=VARIOUS ARTISTS
TRCK=1
TSO2=vVarious Arts
TSOP=LOVE•Darlene

MediaInfo says:
Complete name                            : /Volumes/JukeBox/Media/Music/Compilations/A Christmas Gift For You/01 White Christmas.mp3
Format                                   : MPEG Audio
File size                                : 6.73 MiB
Duration                                 : 2 min 56 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 320 kb/s
Album                                    : A Christmas Gift For You
Album/Performer                          : VARIOUS ARTISTS
Track name                               : White Christmas
Track name/Position                      : 1
Compilation                              : Yes
Compilation                              : Yes
Performer                                : Darlene LOVE
Performer/Sorted by                      : LOVE•Darlene / vVarious Arts
Genre                                    : Christmas
Recorded date                            : 1963
Writing library                          : LAME3.91
BPM                                      : 2
Comment                                  : 0000072A 00000754 000022B0
The [Sort Album Artist] is now listed as 'Performer/Sorted by' which is incorrect as it lists the contents as 'LOVE•Darlene / vVarious Arts' which is a concatenation of the [Sort Artist] and the [Sort Album Artist] with a slash between.

Whichever way you look at it, MediaInfo is making a complete hash of this and I cannot rely on it to get anything right. This is a bit disappointing as it means FileBot is going to be useless at making the renamed symlinks of 25,000 audio tracks that I planned and need it to do.

What now?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Very odd behaviour

Post by rednoah »

Ha! Research reveals that TPE2 is "band/orchestra/accompaniment" by specification, but also repurposed for "Album Artist" for which there is no ID3 tag. ID3 tagging is messed up alright. :D

@see http://stackoverflow.com/a/5958664/1514467

This one is probably intended behaviour though. Like interpreting ID3 tags differently depending on who wrote that tags? No idea. Ask MediaInfo developers. There's probably a good reason behind this, or at least one user who requested this behaviour.


As for FileBot, just do this:

Code: Select all

any{media.Accompaniment}{media.AlbumPerformer}
:idea: Please read the FAQ and How to Request Help.
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Re: Very odd behaviour

Post by UKenGB »

It's a shame there isn't greater standardisation, but the mess exists only because it was all originally set up by those who didn't really understand how music data needs to be organised and it's had to be bodged ever since then.

Seems to me that any app that uses tags just needs to identify by the short code. The TPE2 tag is what it is and doesn't really matter what any particular app uses that for. But in this case, with 2 tracks, each with TPE2 set to the same data, MediaInfo reports the name of the TPE2 tag differently. Since that long name is how anyone can actually access that tag, it's a disaster.

I am also unable to understand why after editing the tags, MI then decides on a completely different strategy and concatenates the contents of 2 tags with a slash, under the name of one of those tags. The developer(s) of MI seem to have gone out of their way to make it unreliable in use. The actual tag data is correct and separate as it should be. It's only the way MI reports on this that is screwed up, but that's what FileBot uses.

After much editing by various means, I've finally got MI to stop that concatenation malarky and I now have the individual tags being reported, but even though I can allow for this naming variation (using 'any' or other means), I am still concerned about it occasionally doing something weird when supplying the tag data and ruining the file naming. How confident am I that it will now get it right and allow FileBot to create 25,000 names, 100% correct. Not very is the answer :-(
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Re: Very odd behaviour

Post by UKenGB »

Yet more bizarre MediaInfo behaviour and I'm not sure how to get around this.

Here's the MI CLI output for a particular file:-

Code: Select all

Format                                   : MPEG Audio
File size                                : 3.95 MiB
Duration                                 : 3 min 11 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 173 kb/s
Album                                    : Jools Holland Introduces…
Album/Sorted by                          : Jools Holland Introduces…
Album/Performer                          : Jools HOLLAND
Part/Position                            : 1
Part/Total                               : 3
Track name                               : Pinetop's Boogie Woogie
Track name/Position                      : 15
Grouping                                 : Boogie Woogie Piano
Compilation                              : Yes
Compilation                              : Yes
Performer                                : Clarence 'Pinetop' SMITH
Performer/Sorted by                      : HOLLAND•Jools / SMITH•Clarence 'Pinetop'
Writing library                          : LAME3.93 
BPM                                      : 2
iTunPGAP                                 : 0

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Duration                                 : 3 min 11 s
Bit rate mode                            : Variable
Bit rate                                 : 173 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 3.94 MiB (100%)
Writing library                          : LAME3.93 
Encoding settings                        : -m j -V 2 -q 2 -lowpass 19 --vbr-old
But this is how it is reported in FileBot:-

Code: Select all

Video_Format_List	MPEG-4 Visual
Video_Format_WithHint_List	MPEG-4 Visual
Video_Codec_List	MPEG-4 Visual
Format	MPEG-4 Visual
Format/String	MPEG-4 Visual
Format/Extensions	m4v mp4v
Format_Commercial	MPEG-4 Visual
InternetMediaType	video/MP4V-ES
Codec	MPEG-4 Visual
Codec/String	MPEG-4 Visual
Codec/Extensions	m4v mp4v
FileSize	4146497
FileSize/String	3.95 MiB
FileSize/String1	4 MiB
FileSize/String2	4.0 MiB
FileSize/String3	3.95 MiB
FileSize/String4	3.954 MiB
Both the above are the same (MP3) audio file, yet in FileBot it is being seen as a video file with no tags and hence not being named correctly. Is this a MediaInfo or FileBot problem?

Although the CLI output correctly figures it's an audio file, it still has the dreaded Performer/Sorted by concatenation.

This is getting beyond frustrating.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Very odd behaviour

Post by rednoah »

1.
FileBot just passes the path to MediaInfo and every bit of data you get is from MediaInfo. So if MediaInfo says it's a video type for an mp3 file, then that's definitely a strange bug in libmediainfo. Maybe it's fixed with the latest version of the library? If not, then sending in that file with a bug report would be helpful so Jerome can fix it.


2.
I see your frustration. At this point wouldn't it be easier to just have some other tools export all the ID3 tags for each file in an easily readable format (e.g. csv) and then just use that in the format instead of the MediaInfo bindings?

See last example from here: viewtopic.php?f=3&t=2072

e.g.

Code: Select all

{csv("${file}.tags").TPE2}
/path/to/track.mp3.tags

Code: Select all

KEY;My Value
TPE2;My Album Artist
...
:idea: Please read the FAQ and How to Request Help.
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Re: Very odd behaviour

Post by UKenGB »

I've sent some files to Jerome for him to look at. He says he's found a couple of issues. But it leads on to another couple of questions:-

First of all, I was already using MediaInfo, both GUI and CLI before I ever installed FileBot. Do either of those use the same lib as you or is yours completely self contained within FileBot (as I suspect it is for the GUI ver). What about filebotCLI?

Both the GUI and CLI versions I'm using are v0.7.91. What version is the lib you're using?

How can I update your lib to a later one now (if exists) or when Jerome fixes some stuff?

I'm fairly convinced FileBot is using an old version. That MP3 file which gets reported as a video, only has this problem in FileBot. In the GUI and CLI versions of MediaInfo, it is correctly identified as audio. Hence my desire to insert an updated libmediainfo into FileBot.

I don't want to have to create additional steps in this process as it is something that will be repeated on a regular basis so the fewer steps the better. I just want things to work as they are supposed to. Creating the suitable formatting strings (and learning a bit of Groovy and more js in the process) is tricky but acceptable and always useful for the future, but when things simply don't do what they are supposed to and I have no direct control over that, it is truly exasperating.

Anyway, if you could let me know about the libs...
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Very odd behaviour

Post by rednoah »

All FileBot packages (except for portable) bundle libmediainfo.dylib which is based on the same code that the MediaInfo packages are built on.

The filebot sysinfo script will tell you the libmediainfo version that FileBot is using. You can call this script from the CLI and from the GUI. See FAQ for details.

Code: Select all

$ filebot -script fn:sysinfo
FileBot 4.7.7 (r4678)
JNA Native: 4.0.1
MediaInfo: 0.7.88
...
Replacing libmediainfo.dylib in the FileBot package should allow you to update the library manually, so you'll be fine as far as the brew package is concerned.

:!: However, the Mac App Store version cannot be modified manually due to codesigning. You can get around the MAS entirely though by launching filebot from the command-line.
:idea: Please read the FAQ and How to Request Help.
Post Reply