IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Prefer flac over mp3 for the same title in media library, [Support is not for how-to questions/TOS #6]
olfab
post Jan 27 2013, 23:23
Post #1





Group: Members
Posts: 3
Joined: 27-January 13
Member No.: 106234



Hi forum,

I ripped all my CDs into flac files for playback on my stereo on transcoded the flac files to mp3 for playback on the radio on my car. The folder structure is like this: Artist/Album/["flac files", Mp3/"mp3 files"]. Consequently each title shows up twice in the media library once as flac file and once as mp 3 file.

Is there a way to setup a filter that prefers flac files over mp3 files if there are two files with the same name?

If there is no way, any suggestions how to cope with the problem?

Thanks,
Fabian
Go to the top of the page
+Quote Post
Midiman
post Jan 28 2013, 03:53
Post #2





Group: Members
Posts: 39
Joined: 6-April 12
Member No.: 98463



An answer was provided last week:

http://www.hydrogenaudio.org/forums/index....showtopic=99031

Go to the top of the page
+Quote Post
olfab
post Jan 29 2013, 00:03
Post #3





Group: Members
Posts: 3
Joined: 27-January 13
Member No.: 106234



Thank you for your answer, Midiman.

But this is not the solution I'm looking for. Your solution means I have to duplicate my whole folder structure for every audio file type. For example I would need these folders for every album:
/Music/Flac/"Artist A"/"Album A"/"Track 1.flac"
/Music/Mp3/"Artist A"/"Album A"/"Track 1.mp3"
/Music/"Artist A"/"Album A"/[Cover Art, etc]

And for Apple I would also need:
/Music/Alac/"Artist A"/"Album A"/"Track 1.mp4"

Fabian

This post has been edited by olfab: Jan 29 2013, 00:04
Go to the top of the page
+Quote Post
kode54
post Jan 29 2013, 05:27
Post #4





Group: Admin
Posts: 4618
Joined: 15-December 02
Member No.: 4082



You could make autoplaylist/media library queries which filter against %codec%, but that doesn't actually handle the case of duplicates, but merely lets you restrict a query to files which either match or do not match a particular codec or codecs.

Maybe a query operator could be implemented, like PREFER (string) IS/HAS/IN (value/value set), which would be able to pick one track out of sets of tracks where all the metadata is the same except for what (string) resolves to. Of course, I don't know what sort of nightmare overhead that would incur on a query operation, especially since it already calls for the operation of multiple tracks per single track query, in order to find the almost complete tag duplicates.

Closest I could think of how something like this would be implemented is that all other operators of the query except for PREFER would be sorted out into a list first, or if no other operators, then the entire input list. Then the entire list would have its meta/info text fields hashed except for the fields specified by any PREFER operators. The query would automatically pass out any unique hashes. Any duplicate hashes would pass through the PREFER operator to pick out a single preferred track.

I can think of how this sort of thing may end up being an O(N^2) nightmare, or could be abused all sorts of ways for other types of queries. Maybe it should only be a PREFER_CODECS type query instead, since it really doesn't make any sense for any other purpose.
Go to the top of the page
+Quote Post
Midiman
post Jan 29 2013, 08:03
Post #5





Group: Members
Posts: 39
Joined: 6-April 12
Member No.: 98463



QUOTE (olfab @ Jan 29 2013, 09:03) *
Thank you for your answer, Midiman.

But this is not the solution I'm looking for. Your solution means I have to duplicate my whole folder structure for every audio file type. For example I would need these folders for every album:
/Music/Flac/"Artist A"/"Album A"/"Track 1.flac"
/Music/Mp3/"Artist A"/"Album A"/"Track 1.mp3"
/Music/"Artist A"/"Album A"/[Cover Art, etc]

And for Apple I would also need:
/Music/Alac/"Artist A"/"Album A"/"Track 1.mp4"

Fabian


Well, that is not quite true. If you look at what I said, you only need 3 main directories - one for master FLAC - one for copy MP3 - one for everything else. Everything else contains any files you can possibly think of that you do not have FLAC master copies of. You only need one copy of the "Cover Art" files, surely? For use with fb2k? The iPod won't be using the Cover Art JPG files etc.

As for your Apple directory above, please explain why you need an MP4 (M4A/AAC?) copy of a FLAC for your iPad/iPod. iPad/iPod can quite happily play the MP3 files. If you bought an "Apple" file off iTunes, it is the "master" so it goes in the "Everything Else" folder structure.

Your only advantage of your folder structure is less high level directories? However, if you use the folder structure I suggest, then you can mass convert - using fb2k - FLAC to MP3 with one click of a button - and not redo MP3 conversion for any file that already exists as MP3. There is no way to do that via your folder structure using a recursive technique.

You choose what is easiest for you. I thought long and hard about this problem before I devised my folder structure - and it has worked so far ;-)

Mike


Go to the top of the page
+Quote Post
kode54
post Jan 29 2013, 09:25
Post #6





Group: Admin
Posts: 4618
Joined: 15-December 02
Member No.: 4082



Ooh, excellent, a reply that doesn't involve some insane coding solution like I proposed. Bravo, sir.
Go to the top of the page
+Quote Post
MrEnergizer
post Jan 29 2013, 16:36
Post #7





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



Thanks Midiman. I have been looking for a solution for this for a long time as well. I already have seperate 'FLACS' and 'MP3s' folders but my problem is how to seperate the mp3s that are unique from the ones that I have FLAC copies of
Is there an easy way to find the unique mp3s so I can put them into a seperate folder?
Thanks
Go to the top of the page
+Quote Post
BenB
post Jan 29 2013, 20:18
Post #8





Group: Members
Posts: 744
Joined: 17-April 12
Member No.: 98921



QUOTE (olfab @ Jan 27 2013, 16:23) *
Is there a way to setup a filter that prefers flac files over mp3 files if there are two files with the same name?

Not exactly. I know of no way for foobar to prefer a file type.

QUOTE (olfab @ Jan 27 2013, 16:23) *
If there is no way, any suggestions how to cope with the problem?

If I'm understanding your folder structure correctly, you have a folder named "Mp3" (containing the mp3 duplicates) within your album folders. If so, you could create a new view in Album List (or if you use Facets, a new filter/column) which filters out those mp3 duplicates. Something such as the following should work:

QUOTE
$if($not($strcmp(%directoryname%,Mp3)),display this)

where "display this" would be replaced with additional title formatting of your choosing. Basically, what it should do is return all files not in a folder named "Mp3". It should not filter out any files that have "Mp3" in their directory name.

edited for clarification

This post has been edited by BenB: Jan 29 2013, 20:36
Go to the top of the page
+Quote Post
olfab
post Jan 29 2013, 23:06
Post #9





Group: Members
Posts: 3
Joined: 27-January 13
Member No.: 106234



Thank you for your answers!

@Mike: I really appreciate your solution since it circumvents the limitations of foobar in an easy way. But I just don't want to cope with twice the directory structures. If I listen at home to music (flac file) and decide to include it on the next cd for the radio in my car I would have to go all the way to the correspondent mp3 file. This is pretty tedious.

@BenB: I think this doesn't work since I use the DarkOne theme. What a pity.
Go to the top of the page
+Quote Post
Midiman
post Jan 30 2013, 00:42
Post #10





Group: Members
Posts: 39
Joined: 6-April 12
Member No.: 98463



QUOTE (MrEnergizer @ Jan 30 2013, 01:36) *
Thanks Midiman. I have been looking for a solution for this for a long time as well. I already have seperate 'FLACS' and 'MP3s' folders but my problem is how to seperate the mp3s that are unique from the ones that I have FLAC copies of
Is there an easy way to find the unique mp3s so I can put them into a seperate folder?
Thanks

A good question ;-) I fixed my entire directory structure with some VB.NET coding - however it may be possible to code something with VB SCRIPT, I suppose. My VB.NET app compares 2 directories recursively and reports differences where each sub folder is different. To do this, the file extension is ignored - thus if I have a FLAC sub folder with 15 .FLAC files I will report as a warning any folder which does not have 15 .MP3 files - all with exactly the same name of course!

When I was writing the original code, I actually wrote a separate routine along the lines of:

MP3 folder is "master" - FLAC folder is "copy" - if xxx.MP3 exists in "master" and xxx.FLAC does not exist in "copy" then MOVE xxx.MP3 to "\Other" folder structure, retaining the original folder structure. In VB.NET it is easy to get the filenames for all files in a folder and easy to recursively call the same routine for each sub folder in each folder.

Normally, FLAC folder is "master" and MP3 folder is "copy", of course. The program will generate FLAC and LAME commands to convert FLAC to MP3 for all missing MP3 files. The commands are simply written to a BAT file and then executed. However, fb2k can do this action with no programming effort whatsoever and copy the tags from FLAC to MP3 as well. I would be happy to give my VB.NET EXE to anyone who is interested, but I have written no documentation other than tooltips - and the GUI is not the prettiest - however it is functional. So, if you wanted it, you would have to experiment to see how it works ;-)

Mike


Go to the top of the page
+Quote Post
BenB
post Jan 30 2013, 01:56
Post #11





Group: Members
Posts: 744
Joined: 17-April 12
Member No.: 98921



QUOTE (olfab @ Jan 29 2013, 16:06) *
@BenB: I think this doesn't work since I use the DarkOne theme. What a pity.

It (or a modification thereof) would likely still work, but the problem would be locating the relevant title formatting for that skin. If you are inclined to go that route, I suggest contacting the theme's developer on how to go about doing it.

On the other hand, the theme makes use of the Quick Search Toolbar component (it's the search located in the upper right corner). A query such as:

CODE
"$if($strcmp(%directoryname%,Mp3),true,false)" IS false

should filter out your mp3 duplicates and, of course, changing the query to:

CODE
"$if($strcmp(%directoryname%,Mp3),true,false)" IS true

should return only your mp3 duplicates.

EDIT:
You might also try one of the following:

CODE
NOT directoryname IS Mp3
NOT %directoryname% IS Mp3


This post has been edited by BenB: Jan 30 2013, 02:01
Go to the top of the page
+Quote Post
MrEnergizer
post Jan 30 2013, 15:13
Post #12





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



Thanks Midiman....sounds very complicated but I am willing to give it a try. Your .exe would be appreciated
Go to the top of the page
+Quote Post
MrEnergizer
post Jan 30 2013, 15:36
Post #13





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



If I put all my flacs and mp3s in a playlist. Is there a query I could put in a search that would show duplicate files, regardless of their codec?
Go to the top of the page
+Quote Post
EpicForever
post Mar 23 2013, 17:02
Post #14





Group: Members
Posts: 708
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



I found other solution.
1. Open Advaced Properties / Display / Properties Ddialog / Standard fields. Add there something like Keywords=KEYWORDS or anything else that you want (Transcoded=TRANS for example). This will add field named "Keywords" (or Transcoded) to your Properties dialog.
2. For files that have dupliacates in different formats/codecs put in "Keywords" words identificating that fact, like "transcode" (in MP3 files for example) or "Yes" in "transcoded" field. You can also use "Comment" field for the same purposes as proposed "Keywords". It will add tag fields named "TRANS" (or "KEYWORDS" or whatever you choose) to your files, and thus modify them.
3. Install this component: http://www.foobar2000.org/components/view/foo_skip
4. In Advanced Properties / Playback / Skip Tracks put "%keywords% HAS transcode" (without quotations) or "%comment% HAS transcode" or %trans% IS yes". "HAS" and "IS" words are case sensitive and must be all uppercase! You can uncheck all 3 additional checkboxes. I even recommend having the first unchecked.
5. From main window menu choose Playback and then tick "Skip tracks & use bookmarks". In Preferences / Keyboard shortcuts you can add keyboard shortcut for this option, that will allow you to enable it or disbale easily.

This is how it works here. Without any modifications to file system structure. However it require your personal effort to determine files with duplicates and to properly tag them, and to update this information everytime you add new files and their duplicates to your collection and playlist.
Go to the top of the page
+Quote Post
MrEnergizer
post Mar 24 2013, 22:45
Post #15





Group: Members
Posts: 164
Joined: 1-January 05
Member No.: 18757



Sounds like a lot of work, but if it works for you....... I literally want to find the duplicate mp3s and delete them.....not bothered about tagging them. I just want FLAC masters and mp3s of tunes that I haven't got FLAC copies for.
Anyone thought of a simple solution for this yet?
Midiman what happened to the .exe you were going to send me?
Thanks
Go to the top of the page
+Quote Post
Midiman
post Mar 25 2013, 04:09
Post #16





Group: Members
Posts: 39
Joined: 6-April 12
Member No.: 98463



QUOTE (MrEnergizer @ Mar 25 2013, 07:45) *
Midiman what happened to the .exe you were going to send me?
Thanks

Oops - will get a move on re this. I am in the middle of writing some documentation - I will let you know when that is done and all is available for download.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 15th September 2014 - 03:55