Kodi Community Forum

Full Version: XBMC Metadata Workflow
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there!

I have choosen XBMC as it seems that it will fit my visions about the system which will be able to manage my multimedia collections... :-) But before I let it to do so, I like to play with it to better understand its priciples, logic and functions. I have also read several forum threads, wiki and other sources and here are my first notes.

First of all I have tried to understand workflows related to metadata processing, as I would like to prepare my collections for it. It seems that there are two main steps:
1. Reading/fetching/digging metadata from media files;
2. Scraping (additional) data from the web.
This workflow attitude make sense to me, as the basic metadata are mostly the same for all media, but details are „region-sensitive“ - someone would like to have descriptions in local language, some „national“ content is not well worldwide known, etc. ;-)

I don't want to go deep into proceses of creation video (movies, TV series, ...) collections (yet). It seems that XBMC just take the filename and go directly to choosen scraper to try to get more data. There is nothing complicated and no support to read metadata from video files/containers (e.g. Matroska) – that is what I have understand from several forum threads...

Afterward I have made some tests with audiofiles – I have found out several oddities. (OK – no current support for Matroska container as mentioned above...). It seems that there are several ways how to provide XBMC with audio metadata. I think that this is the order sorted by importance:
- .NFO file: XML file which can provide all needed metadata (incl. album and artist details).
- .CUE file: TXT file with basic metadata and „play-list“.
- Tags (MP3, OGG/Vorbis): As a part of each audio-file.
I am not sure whether the XBMC is going through these files in this particular order and whether there are any rules what can overwrite what data (I know, there is a possible parameter „clear“ within .NFO XML scheme). I have tested some FLAC and some MP3 files with .NFO and/or .CUE files within the album directory but I don't understand it fully...

Before I will put here my questions, some details and background:
I would like to use FLAC for my audio collections (mostly) – because it is loseless and I can have some albums as one file with .CUE list which is supported by XBMC (instead of Matroska MKA with chapters which is not supported :-( – only MKV is able to work with chapters – I have tried it...). This is because there are many albums without gaps between songs and I hate to divide it into several files (like some soundtracks, electronic music, classical records etc.).
I have played with the current XBMC 12.3 Frodo (on Win and also as XBMCbuntu instaled on USB stick). Mostly I have used fresh and clear instalation ;-)
So...

1. I have had a problems with .NFO files: I was not able to push XBMC to load any data from my .NFO file. I have tried several file names (album.nfo, [album name].nfo). I have also tried to export library data scraped from web (Queen: Innuendo) to have the proper .NFO file but without any success. Is this OK or is it a bug?
2. Import metadata from .CUE file works fine but beside the the right artist it is generating also an „Unknown“ artist where are listed all albums with .CUE file in their directory. I think that XBMC is not reading album metadata from the .CUE file – info about artist is taken from „Performer“ for each song separately...
3. I have noticed no problems with metadata directly from the media files. But these are loaded only if no .CUE file is present. (And also everytime, when I have tried provide it via .NFO file.)
4. Last question for now: During my testing I have never reached a situation where XBMC should automatically load artist and album data using scraper (similar to video). Every time I should manualy click on author/album and run the scraper. Why? :-)

If it is needed, I can provide you with more details and samples...
You are right that XBMC has a video database aka library and a separate music/audio database, and they don't work the same way.

For music, XBMC is dependent on metadata tags. There are two "value-added" scrapers (so-called, as I understand the term, XBMC does not scrape, rather it queries databases via published apis). One is "album", the other is "artist". My experience (mostly on Gotham builds) is that an "album.nfo" file, placed in a folder containing file(s) from a single album, will be read. Artist.nfo, in my experience, is a bit more difficult. I have sometimes gotten it to be used, in other times it won't. I haven't figured out why it only is used sometimes. AFAIK, it has to be located in the parent folder of a folder containing music files. I'm pretty sure it is keyed to the album artist, not the song artist (these are two different entries in the database). A new wrinkle in Gotham is that is possible to use MUSICBRAINZ_ARTISTID and MUSICBRAINZ_ALBUMID tags, and via a setting toggle will use the album or artist name as found on MusicBrainz vice what is in the tag. The MBID is also passed to scrapers for use on sites which allow query by MBID (can solve problems where queries return a list of possible matches when names are used). The ArtistId tag seems to be associated with the first album artist (on a per-file basis), unless the album artist is "Various Artists", in which case the ArtistId is associated with the first song artist. I've never tried CUE files so can't help you there. Individual song files in FLAC format with the Vorbis Comments work well (from metadata tag-reading standpoint).

The general process flow is when "scan item to library" is selected, XBMC looks for file changes or additions recursively in the paths. If a change is identified, a "musicinfoscanner" thread is spawned which extracts metadata and looks for album/artist nfo files (and I assume CUE sheets). If musicinfoscanner finds a new album artist artist or album (not in the database), it will look in the parent folder for artist thumb (folder.jpg) and fanart (fanart.jpg) (filenames searched for can be modified in advancedsettings.xml). Musicinfoscanner will then launch the artist and album scrapers (as configured in the music library settings), providing the name and MBID (if supplied) to the scrapers. Scrapers are addons, not a core function of XBMC.

This is repeated for every new/changed music file found. Missing files are removed from the db.

scott s.
.
Scot, thank you for your post - there are several details which can help me to better understand the workflow.

Anyway - and I will take it from the end:
I have no problems with metadata included directly within mediafiles (it does not matter whether MP3 or Vorbis Comments) - it's working properly.
I have a problem with .CUE files because there is always the "Unknown" artist in the XBMC artist list (beside the real artist listed).
And I have a problem with .NFO files as I was not able to provide metadata via it. (I have tried album.nfo and have no idea whether there are any issues with artis.nfo as you mention.) Probably I should start a separate BUG thread related to album.nfo to get some help ;-)

Maybe I will also test Gotham XBMC instalation to find out differencies.
Often turning on debug logging and looking through xbmc.log will give clues as to what is happening. Search the log for "OnScan" and study from there.

One user has had better results in using the library import feature rather than artist.nfo for updating artist data in the library.

scott s.
.
Windows XP = no Gotham testing... Tongue

Anyway:
I have make another fresh install (windows) and turn the debuging mode on. I have made same tests and look into log files, but found nothing interesting. Only things I already know:
1. During the scan the XBMC is totaly ignoring .NFO file in the album directory (doesn't matter what name it has). It scans ONLY .CUE files and/or original audio files (MP3/FLAC).
2. And I was not able to find any clue why XBMC is adding "Unknown" artist to albums with .CUE file in their directory.

Has anyone idea how to move forward? Huh
Time for short summary

Video library should be "easy" - workflow is based on path and filenames, which are used for "scraping" data from choosen internet source. This will happen imediately if user click on "Add to library".
Or .NFO files can provide these data...

In relation to Audio - it is completly different:
The initial "Scan to the library" is working ONLY with metadata provided via .CUE file (there is some issues with album artists using this way - see my notes before.) If there is no .CUE file, it is going into mediafile themselves (looking for music Tags). During this "initial" scan XBMC is not looking for .NFO file.
It seems to me that there is no automated scan/scrapping for Album and Artist info - I have always to do it manualy. During this "second layer" scan the XBMC is looking for .NFO file before any other (on-line) scrapping. BUT it will not completly rewrite album info - it will keep some information given from metatags (I am trying to identify which exactly).

Maybe I will prepare some visual workflow diagram for better understanding (and for the wiki as well).