Will MusicBrainz Picard Work for My Specific Music Video Use Case?

I’ve got pretty particular needs and I might have to create a custom script to make it happen, but I’m curious if MusicBrainz Picard can do what I need to get there.

I’m starting with music videos that are cut from analog tape captures. I need to be able to manually look up matches for these files. Some of them will automatically match with Acoustdb, but most will not. I need something that will allow me to manually search for songs and choose a match by hand. FileBot would match to some video automatically, but it doesn’t offer a way to manually search music metadata.

The next hurdle is that these files are MKV files. I’m remuxing from DVD files, and DVD audio can’t remux into MP4, so I’m pretty stuck with MKV. But I’m seeing conflicting information regarding support for MKV files. I see that it was removed, but I found another post saying that it was removed temporarily due to the shift to Python3 and that there might be a full-fledged MKV plugin in the future.

Then the last part is really more specific and this is probably where I’ll need to write my own script, as long as Musicbrainz Picard allows for me to do that. For my video scheduling software, I need the metadata written into NFO files. Would it be possible to write a script to do this inside of Picard, or would I have to use Picard to write the metadata somewhere, and then write an external script to extract that metadata and put it in an NFO file?

I know this is a bit complicated, but the ability to create custom scripts for Picard makes it seem like this might be possible.

1 Like

The first part is easy: Picard allows you to tag your files against any release or recording entry in the MB database.

Matroska support is a problem, as Picard does not support this format. There used to be a videotools plugin for Picard 1, but it did not support writing tags to the files (but it had some very limited support for reading some tags) and it doesn’t work with Picard 2.

If this is only about being able to load Matroska files without any ability to load and save tags then a very simple file format plugin can do the job:

PLUGIN_NAME = "Matroska"
PLUGIN_AUTHOR = "..."
PLUGIN_DESCRIPTION = "Allows loading and renaming Matroska files"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0']
PLUGIN_LICENSE = "CC0"

from picard.file import File
from picard.formats import register_format
from picard.metadata import Metadata

class MatroskaFile(File):
    EXTENSIONS = [".mkv", ".mka"]
    NAME = "Matroska"

    def _load(self, filename):
        metadata = Metadata()
        metadata['~format'] = self.NAME
        return metadata

    def _save(self, filename, metadata):
        pass

register_format(MatroskaFile)

If this is saved as e.g. matroska.py in Picard’s plugin folder and enabled in Options > Picard then Matroska files can be loaded and renamed.

Regarding NFO files (I assume this is about the Kodi metadata files) Picard does not support those.

If you know some Python again a plugins could be created that creates or updates NFO files when saving. This could be implemented using a file_post_save_processor.

4 Likes

Okay, I need to dig into the specifics of how Picard works, but as I’m understanding, it seems like it could do what I want. Would you mind to let me know if my understanding here is correct?

So, you say I can find entries manually? That’s important for me. FileBot doesn’t do manual matches for music because I’m told that acoustdb doesn’t work with text matches, just audio fingerprints.

As for loading the MKV files, I don’t need to write tags to the files themselves, so that should be okay. The only thing I really need done to the MKV file itself is to rename it following a consistent scheme that would likely use the artist, song title, and year. And you said this simple plugin will allow for renaming of the MKV file.

Then for the NFO files, yes, I need Kodi format NFO files for ErsatzTV. I’ve written Python scripts before, so I could stumble my way through it. So I can pass the retrieved metadata to a file_post_save_processor script, even if the metadata isn’t saved to the initial file, correct?

Thank you very much for your help!