INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: Zhillsguy on February 18, 2014, 10:24:46 pm

Title: Can MP3 Files Be Sorted From Identical Flac's?
Post by: Zhillsguy on February 18, 2014, 10:24:46 pm
What I want to do is delete any MP3 files from my library if the FLAC (or other lossless format) file exists for that album/song. Is it possible to sort this way with an expression?

Thanks.
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: MrC on February 19, 2014, 03:58:25 am
MC doesn't provide audio fingerprinting, so there's no way to detect if you have the same track in different encodings.  You can only use existing metadata, like Name, Track #, etc.

I haven't tried this out yet, but you could try pscriptor (http://yabb.jriver.com/interact/index.php?topic=85990.0) and the AcousticFingerprint scriptlet to see if it matches IDs for you.  The basic idea is that you'd run the script to analyze your tracks to obtain fingerprint signatures, and then you could use the expression language to find identical signatures.

If you're interested, I'll check it out to see how well it works.
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: Zhillsguy on February 19, 2014, 05:13:07 am
Sounds good MrC......

If you are able to work through it I can create some test folders here to try it.....I really appreciate it.
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: MrC on February 19, 2014, 08:46:32 am
Ok, that was easy.

The Step 1 image shows results after pscriptor ran the AcousticFingerprint scriptlet.  The EN ID values are the ones we care about.

The Step 2 image shows results after applying a quick filter in the MC Search box:

   ~sort=[Bitrate]-d ~nodup=[EN ID]

This sorts by bitrate, and removes duplicates of the [EN ID] field, leaving us with FLAC.  Reverse the filter's bitrate sort to:

   ~sort=[Bitrate] ~nodup=[EN ID]

leaves us with Step 3, which should be OK to delete.

The command I ran was:

    perl pscriptor.pl -E AcousticFingerprint -c pscriptor-config.txt -f 'Name'

Install pscriptor (http://yabb.jriver.com/interact/index.php?topic=85990.0) as per instructions, and also follow the instructions at the top of the file Scriptlets/AcousticFingerprint.pm.

Edit with a simple text editor (like Notepad) the file Scriptlets/AcousticFingerprint.pm and change two lines under %fieldmap:

    artist_name     => 'Artist',
    title               => 'Name',

to

    artist_name     => 'EN Artist',
    title               => 'EN Name',

This will prevent your Artist and track Name's from being overwritten.  I'll have a better way to do this in the future.
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: Zhillsguy on February 20, 2014, 06:19:53 am
Thank you sir......I won't be able to spend much time on this for a few days. I tried to do an install of the ActivePearl for Windows and it gave an error message of "There is a problem with this Windows Installer Package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor".

(running Win 7 x64)
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: HiFiTubes on February 26, 2014, 06:27:59 am
I'd like to get involved in testing this. My pscriptor install is complete.

I'm curious why we can't use MC for some of this, with regard to Album field being identical.

If we have taken care to tag the Album field properly, with no extraneous details (or removed those details), could we safely assume that if a FLAC,APE,ALAC,DFF,DSF,SACD copy exists just delete the MP3?
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: MrC on February 26, 2014, 11:38:22 am
Sure thing.

As far as can you safely delete, that's entirely up to you.  I have no idea about your music collection, and would prefer to leave any decisions such as that to you and the experience you gain from evaluating the results.

Regarding the Album field: think "Greatest Hits".  I have a dozen albums with that title.  AlbumKey(), which is [Album Artist (auto)] - [Album], helps solve that problem almost entirely (an artist may have several identically named albums: Seal's "Seal" album, Frank Sinatra's "Greatest Hits").

It seems reasonable that if you find duplicates across file types in the same AlbumKey(), you can safely remove the mp3 versions when you have better higher definition versions.  The acoustic fingerprint should have very few if any collisions (meaning, same ID for different fingerprints).
Title: Re: Can MP3 Files Be Sorted From Identical Flac's?
Post by: HiFiTubes on February 26, 2014, 10:39:55 pm
I thinking too much about what I want without regard to the design of MC. I've been assuming there was some algorithm behind the "Duplicates" sort feature, maybe a fallback to other fields...now I realize it is simply applying per file, thus Duplicate of specific fields a user chooses as criteria. Thanks for the heads up on what AblumKey actually is. I think I'll just sort through some different View Schemes for now and see how it works.

Since I have a Jaikoz license I could probably run some batches and grab the Acoustic Fingerprint, or I will use the pscriptor. Thanks.