HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: kmitch on 2008-02-23 02:12:53

Title: Reflacer
Post by: kmitch on 2008-02-23 02:12:53
Based on configuration file or command line parameters, offers the following functionality: Taking the following types of input: This program is just a wrapper around functionality available in other programs. It makes use of the following executables: Change Log

09/13/2008 v2.0308/14/2008 v2.0208/06/2008 v2.0106/03/2008 v2.0003/08/2008 v1.0402/22/2008 v1.0302/09/2008 v1.0202/06/2008 v1.0102/02/2008 v1.00The home page for the software is on Google Code (http://code.google.com/p/reflacer).
Title: Reflacer
Post by: kmitch on 2008-02-23 22:19:55
Original discussions of Reflacer are here:
http://www.hydrogenaudio.org/forums/index....showtopic=50993 (http://www.hydrogenaudio.org/forums/index.php?showtopic=50993)
Title: Reflacer
Post by: rubix on 2008-02-28 09:35:27
how come reflacer is able to create slightly smaller flac files than foobar using the same source file and same flac.exe? reflacer uses --best and foobar uses -8, but that is the same thing right?

also, i noticed in reflacer's log file that it says it detects flac v1.2.0 even though i am pointing it to flac v1.2.1b (which is the only flac.exe on my computer). the encoded files even say they are v1.2.1 in foobar/mr questionman but reflacer thinks it used v1.2.0 and therefore the version check setting will skip re-encoding v1.2.0 files to v1.2.1.
Title: Reflacer
Post by: kmitch on 2008-02-28 11:51:30
how come reflacer is able to create slightly smaller flac files than foobar using the same source file and same flac.exe? reflacer uses --best and foobar uses -8, but that is the same thing right?


To the best of my knowledge, --best is the same as -8

also, i noticed in reflacer's log file that it says it detects flac v1.2.0 even though i am pointing it to flac v1.2.1b (which is the only flac.exe on my computer). the encoded files even say they are v1.2.1 in foobar/mr questionman but reflacer thinks it used v1.2.0 and therefore the version check setting will skip re-encoding v1.2.0 files to v1.2.1.


Here's a little explanation of how version numbers are determined from the program and the .flac file:

The is a function in Reflacer (GetFLACProgramVersion) that simply runs the flac.exe program with the "-v" parameter and parses the output (which for my exe file is "flac 1.2.1"), it then takes the last part of this string and uses it as the version of the program.

To determine the version of the .flac file (function GetFLACEncodeVersion), metaflac is run with the "--show-vendor-tag" parameter.  The returned data (for example "reference libFLAC 1.2.1 20070917") is then parsed, and the third value from the string is used as the version number of the file.
Title: Reflacer
Post by: jamesbaud on 2008-02-28 20:42:46
how come reflacer is able to create slightly smaller flac files than foobar using the same source file and same flac.exe? reflacer uses --best and foobar uses -8, but that is the same thing right?

also, i noticed in reflacer's log file that it says it detects flac v1.2.0 even though i am pointing it to flac v1.2.1b (which is the only flac.exe on my computer). the encoded files even say they are v1.2.1 in foobar/mr questionman but reflacer thinks it used v1.2.0 and therefore the version check setting will skip re-encoding v1.2.0 files to v1.2.1.


You can change the parameter from --best to -8 in the configuration file, which is what I did, for my own peace of mind, even though they are the same. See:

http://flac.sourceforge.net/documentation_...ncoding_options (http://flac.sourceforge.net/documentation_tools_flac.html#encoding_options)
Title: Reflacer
Post by: A_Man_Eating_Duck on 2008-02-28 22:26:20
how come reflacer is able to create slightly smaller flac files than foobar using the same source file and same flac.exe? reflacer uses --best and foobar uses -8, but that is the same thing right?
I'm pretty sure this is caused with foobar piping the audio in to flac with out making an intermediate wav file, if i recall correctly it makes more seekpoints if the file is piped in to Flac thats why the file is a little bigger. I'm sure there was a thread about it on HA.
Title: Reflacer
Post by: jamesbaud on 2008-02-28 22:35:34

how come reflacer is able to create slightly smaller flac files than foobar using the same source file and same flac.exe? reflacer uses --best and foobar uses -8, but that is the same thing right?
I'm pretty sure this is caused with foobar piping the audio in to flac with out making an intermediate wav file, if i recall correctly it makes more seekpoints if the file is piped in to Flac thats why the file is a little bigger. I'm sure there was a thread about it on HA.


If this is true, can reflacer offer the same option to not make an intermediate wav file, if we want the flac file to have more seekpoints?
Title: Reflacer
Post by: A_Man_Eating_Duck on 2008-02-28 23:02:53
If this is true, can reflacer offer the same option to not make an intermediate wav file, if we want the flac file to have more seekpoints?
You don't need to create more seekpoints, it just that when piping with foobar it creates more seekpoints than are needed.
Title: Reflacer
Post by: jamesbaud on 2008-02-28 23:05:05
If this is true, can reflacer offer the same option to not make an intermediate wav file, if we want the flac file to have more seekpoints?
You don't need to create more seekpoints, it just that when piping with foobar it creates more seekpoints than are needed.


Sorry if I seem clueless about this.
Are you saying foobar creates unnecessary seekpoints?
Title: Reflacer
Post by: A_Man_Eating_Duck on 2008-02-28 23:17:24
Sorry if I seem clueless about this.
Are you saying foobar creates unnecessary seekpoints?
Yes, but only when piping. If you set foobar to create an intermediate file instead of piping, the filesizes should match.
Title: Reflacer
Post by: tylast on 2008-02-29 00:12:44
How about an option to encode to M4A keeping the tag & image file. 
Title: Reflacer
Post by: kmitch on 2008-02-29 01:04:04
How about an option to encode to M4A keeping the tag & image file. 


This has a few implications... I don't have anything against using other codecs/formats... I just didn't plan on including anything other than MP3 in the original script. 

The problem I run into is that I'm limited in what I can do in a script and still be able to read and debug the code.  In order to add the amount of code that would be required to suport multiple codecs, I'd really have to separate the code out into classes (Could be done in VBScript, but there isn't much point).  I'd have to move the code to Visual Basic.  If I did, I would still target the .Net Framework 2.0...

The whole point of VBScript was to allow for making tweaks here and there... if the community doesn't mind moving to an EXE (I would still use external EXEs for encoding, decoding, and tagging; I don't have any interest in trying to pull in external code), I can explore that.

I am currently working on some enhancements to run multiple scripts on a multi-processor/core machine and some tagging when encoding from a WAV based on directory/filenames.
Title: Reflacer
Post by: noorotic on 2008-02-29 10:41:56
Hi, I think this is great.  It would be great if more codecs could be added as well.  I do not know any VBScript, nor whether it would be feasible to maybe allow a user to supply his/her own encoder & command-line, similar to foobar?

I cooked up something in Autohotkey a while back, under XP, and am now using Vista so some day some re-coding.  It transcodes mostly lossless.  I have not really looked at a config file hmm configuration for something like this, but it really would work better as the user does what he likes, and it saves us from some decisions.  I was also encodeing to mp3 and using Metamp3.exe.

To do multi-core encoding, I had only run two concurrent threads.  Actually, three, which balanced out to two.  This was pretty difficult to figure out, for me.        I think a user could simply specify number of concurrent threads?

What I really liked, and might be nice in your app, is that I used a sort of title-formatting for output directories.  It read (using TAG.exe) specified tags, such as 'year' or could provide the encoding date, etc, as part of the created directory structure.  Maybe a good feature?  I had also planned to allow option of copying other filestypes present, such as jpg/png.    This is one of the main things I'd like to see in such a program, and would be simple.  My mp3 from flac directory is lacking a lot of the album art due to my laziness in copying it.

I use dbpoweramp convertor some (quite a bit, actually) but I was able to provide for myself some special features this way, and copy those features from it which I like.  Right now I really use foobar quite a bit.

I think TAK would be great for adding. If you decide to go that route.      Anyway, you'd be welcome to see what it does as far as the directory-creation, if you like.  Or I'm sure you'd have your own ideas.

Looking again at your notes, it looks like you've done some of my ideas already.

Thanks, and Respectfully,
Title: Reflacer
Post by: bilbo on 2008-03-02 23:07:11
Nice program. Wpuld it be possible to add a mode to convert Flac images with Cue to individual MP3 files?
Title: Reflacer
Post by: Jose Hidalgo on 2008-03-03 15:40:49
You can already use a splitter for that (foobar, or Medieval Cue Splitter), then any converter (dBpowerAMP for instance) will do the FLAC->MP3 conversion of the generated files. All this takes just a few clicks.
Title: Reflacer
Post by: bilbo on 2008-03-04 01:22:47
You can already use a splitter for that (foobar, or Medieval Cue Splitter), then any converter (dBpowerAMP for instance) will do the FLAC->MP3 conversion of the generated files. All this takes just a few clicks.

Thanks!! Medieval Cue Splitter is just what I needed.
Title: Reflacer
Post by: Tirade on 2008-03-04 12:39:04
Damn this is exactly what I was looking for!

Couple of questions.

1. Is there any limit to the # of songs you can convert at once? Ive got around 50000 flac files that were all done previous to 1.2.1b.

2. Can the image resizer be used to take an existing folder.jpg and and change it to say 300X300? I tried last night but it did not seem to work. Maybe the imageresizer only resizes when imbedding into MP3?


Could someone quickly edit a CFG file to do those 2 things if its possible?

I just want to ReFLAC everything into the same directory, same output structure/name/tags using the best FLAC parameters for archiving and normalize all of my covert art into 300X300 images (or 250X250).

My folder structuce is E:\Music\Artist - Album\*.flac

Thanks!

P.S. You need a donate link
Title: Reflacer
Post by: kmitch on 2008-03-04 19:00:00
1. Is there any limit to the # of songs you can convert at once? Ive got around 50000 flac files that were all done previous to 1.2.1b.


No, that was one of the problems I had with other programs that performed a similar job.  It's reading the directory structure as it goes to pick up the next file... no limit there

2. Can the image resizer be used to take an existing folder.jpg and and change it to say 300X300? I tried last night but it did not seem to work. Maybe the imageresizer only resizes when imbedding into MP3?


No, that's just a quick and dirty image resizer I built.  Its only used when you're putting the image into an MP3.  And based on the command line I built in, it can't name the image result file the same as the source.  If I end up converting this to an EXE, the separate image resize program will go away.  I may be able to add the image resize into a later version... give me an idea of what you're looking for...

I wouldn't touch images that are already in the FLAC file, just individual files that are in the directory.  Would you specify something like the CopyFileMasks parameter to indicate the image files that should be resized, specify a max size... I wouldn't think you'd want to up-size images that are smaller that the one specified.

Could someone quickly edit a CFG file to do those 2 things if its possible?

I just want to ReFLAC everything into the same directory, same output structure/name/tags using the best FLAC parameters for archiving and normalize all of my covert art into 300X300 images (or 250X250).


Once you have the other exe files setup in the CFG file, it's ust a matter of changing the MODE=REFLAC and DIR=[your directory].

I'm not sure if you have a dual core/dual processor machine, if you do, you may want to wait a little while... I hope to release a "multi-threaded" (or as multi-threaded as I can get in VBScript) version in the near future.
Title: Reflacer
Post by: Tirade on 2008-03-04 19:50:27
No, that's just a quick and dirty image resizer I built.  Its only used when you're putting the image into an MP3.  And based on the command line I built in, it can't name the image result file the same as the source.  If I end up converting this to an EXE, the separate image resize program will go away.  I may be able to add the image resize into a later version... give me an idea of what you're looking for...

I wouldn't touch images that are already in the FLAC file, just individual files that are in the directory.  Would you specify something like the CopyFileMasks parameter to indicate the image files that should be resized, specify a max size... I wouldn't think you'd want to up-size images that are smaller that the one specified.


I dont believe any of my art is saved into the FLAC tags. I only have a folder.jpg saved in each folder (roughly 4000 CD folders).

Id like to have some sort of uniformity to my covers. Some are 120X120, some are 300X300 and some are 500X500 or bigger (or much smaller in some cases). Some are as small as 4k where others are 200-700k. Id like them all to be say 250X250 and perhaps no more than 5-50k in size. Because some of the images are so large/big my music players sometimes take a while to load the thumbs. The covers alone together are a few hundred MB.

I was just going to use a batch image resizer for this, but I figured if ReFLAC could do it while Im reflacing everything, why not?

I may just spend some evening and try to find better cover art. Any suggestions on an automated program that can handle a lot of albums at once?

Thanks!

Quote
I'm not sure if you have a dual core/dual processor machine, if you do, you may want to wait a little while... I hope to release a "multi-threaded" (or as multi-threaded as I can get in VBScript) version in the near future.


Its a dual-core yes, but I plan for it to run overnight as its only a media server and not a general use machine.
Title: Reflacer
Post by: kmitch on 2008-03-04 23:44:08
I may just spend some evening and try to find better cover art. Any suggestions on an automated program that can handle a lot of albums at once?


I use Album Cover Art Downloader v1.6, it's home page is no longer available... I haven't tried it yet, but it looks like AlbumArtDownloader XUI is a replacement for it written in .Net 3.0... it's available here:  http://www.hydrogenaudio.org/forums/index....showtopic=57392 (http://www.hydrogenaudio.org/forums/index.php?showtopic=57392)
Title: Reflacer
Post by: Jose Hidalgo on 2008-03-06 18:10:43
Use iTSfv. For getting crystal-clear artwork it's the best there is, period. 

It also includes an AlbumArtDownloader XUI plugin to use only when iTSfv itself can't find the art.

There is a thread on it on HA forums.

Last but not least, McoreD, the developer of iTSfv, is just like the nicest guy on earth. Give it/him a try.
Title: Reflacer
Post by: kmitch on 2008-03-08 23:51:13
Reflacer v1.04 has been released, you can get it here: http://code.google.com/p/reflacer/ (http://code.google.com/p/reflacer/)

Here are the changes for this version:

03/08/2008 v1.04
Title: Reflacer
Post by: Heliologue on 2008-03-10 20:44:11
Running into a bug with the multiprocessor.

Code: [Select]
Reflacer.vbs(121, 20) (null): 0x80041014


If I comment out that line (Declares the variable objWMIService) and set the MultiProcessor toggle to 'N', the script works fine.

WinXP SP2.  Running as an administrator.  Using latest (1.04) reFLACer.
Title: Reflacer
Post by: dagordon on 2008-03-10 21:23:54
kmitch,

Thank you! This is a terrific program.

One question: could you incorporate an option to the ReFLAC mode that will simply overwrite the source file in the source directory, as opposed to putting the reencoded file in a new directory? (For example, as Synthetic Soul's script does.)

Thank you,
David
Title: Reflacer
Post by: kmitch on 2008-03-11 00:22:19
kmitch,

Thank you! This is a terrific program.

One question: could you incorporate an option to the ReFLAC mode that will simply overwrite the source file in the source directory, as opposed to putting the reencoded file in a new directory? (For example, as Synthetic Soul's script does.)

Thank you,
David


If you set the TARGETDIR to blank, or set the TARGETDIR = DIR, the file will be reflaced to the same filename.
Title: Reflacer
Post by: dagordon on 2008-03-11 15:55:41
If you set the TARGETDIR to blank, or set the TARGETDIR = DIR, the file will be reflaced to the same filename.


OK, that was easy. Again, thank you so much, this rocks.
Title: Reflacer
Post by: mattross on 2008-04-12 17:58:16
I am using v1.04 of this excellent tool to upgrade about 200GB of 1.1.3 FLACs to 1.2.1 and have encountered a problem.

Some FLAC files are being skipped. It says they are being processed in the main output but the sub-window for the cores of my CPU are not processing all the files supposedly being allocated to that thread. The complete.lst file also skips the files.

A segment of my complete.lst reads:

D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\02 - My Secret Bliss.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Aerosmith\Big Ones\16 - Dude (Looks Like A Lady) - Live.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\04 - Sene (Working The Land).flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\06 - Anatomic.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\03 - Mojave.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\05 - Beautiful Rain.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\07 - Mother.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Air\Talkie Walkie\01 - Venus.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\08 - Dhol Dogs.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Air\Talkie Walkie\02 - Cherry Blossom Girl.flac
D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\09 - Drake.flac

I have checked above and below this area of the log and there is no sign of the missing track 1 of the Anatomic album. The output file does not exist.

The main window outputs:

Create Folder  F:\NewFLAC\A\Afro Celt Sound System
Create Folder  F:\NewFLAC\A\Afro Celt Sound System\Anatomic
CP1: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\01 - When I Still Needed You.flac
CP1: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\02 - My Secret Bliss.flac
CP2: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\03 - Mojave.flac
CP1: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\04 - Sene (Working The Land).flac
CP2: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\05 - Beautiful Rain.flac
CP1: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\06 - Anatomic.flac
CP1: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\07 - Mother.flac
CP2: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\08 - Dhol Dogs.flac
CP2: D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\09 - Drake.flac
  Copying D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\Afro Celt Sound System - Anatomic.m3u
  Copying D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\Anatomic.CUE
  Copyuing D:\Filez\Stuff\Music\Files\FLAC\A\Afro Celt Sound System\Anatomic\cover.jpg

But the core 1 window never processes track 1.

As I'm running on both cores of my AMD CPU it is completely hammering my system. Could it be this overloading causing it to skip? I have manually set the CSCRIPT.EXE process priorities to Low to improve the responsiveness of my system. It doesn't prevent files being skipped though.

Any ideas?
Title: Reflacer
Post by: kmitch on 2008-04-13 14:19:07
Some FLAC files are being skipped. It says they are being processed in the main output but the sub-window for the cores of my CPU are not processing all the files supposedly being allocated to that thread.


The "Multi-Threading" in that version is a very rudimentary attempt at multi-threading.  I will be releasing a new version that has been rewritten in Visual Basic that is an executable in the next week or so.  This new version doesn't add much as far as functionality goes, but it does use real multi-threading.

--K
Title: Reflacer
Post by: CoyoteSmith on 2008-04-23 12:39:26
does this transfer metadata like comments, album name, artist name etc?
Title: Reflacer
Post by: kmitch on 2008-04-23 12:42:56
does this transfer metadata like comments, album name, artist name etc?


Yes.
Title: Reflacer
Post by: Balnes on 2008-04-25 22:27:49
Hello.
Thank you for a great script.

I have one suggestion:
I use a folderstructure as following: X:\"Artist"\"Album"\"Track #". "Title"
Would it be possible to add an option for adding albumgain for all files in one folder when "reflacing"?
(I have several hundred "old" albums using old flac versions and not using albumgain)

Also, is it possible to make a log file for each folder after reflacing or recoding to Mp3?

Keep up the good work!
Title: Reflacer
Post by: likeatree on 2008-06-03 02:17:17
keep up the good work, can't wait for vb version!
Title: Reflacer
Post by: kmitch on 2008-06-04 00:15:45
Version 2.0 has just been released.  This version is an executable Visual Basic program.

This version has the same functionality as the script, the only additional functionality is a tray icon.  While it's processing, if you click on the icon, a status window will open, clicking it again will close the status window.

Enjoy!

http://code.google.com/p/reflacer/ (http://code.google.com/p/reflacer/)
Title: Reflacer
Post by: likeatree on 2008-06-04 17:33:33
I'm using vista 64-bit and version 2 hangs:

Searching D:\Music\#\!!!
D:\Music\#\!!!\2000 - !!!\01 - The Step.flac

I checked the folder it's encoding too and there's the temp file 01 - The Step.flac.tmp,fl-ac+en'c half way written, so it seems like it would be a problem with flac but this doen't happen with the vbs script version. So it's very confusing to me.

It'd also be great to bring FlacGetV.exe into the mix :-) for re-encoding.
Title: Reflacer
Post by: JJZolx on 2008-06-12 00:36:55
Very nice idea.  I also have a couple of VBScripts that I've developed and use for essentially the same thing.  Like yours they utilize external EXEs - flac, metaflac, LAME, metamp3, touch.

I have mine as two different scripts:

2flac.vbs - Will "re-flac" Flacs, encode WAVs to Flac, and transcode APE files to Flac.  I use it mostly to re-encode downloaded Flacs to my desired compression level and to transcode APEs.  Integrated into Windows Explorer with a couple simple registry additions, just right-click the folder and select '2flac'.

flac2mp3.vbs - Transcodes Flac folder (or entire tree) to Mp3.  Used for keeping a mirror Mp3 library of my Flac library for portable players.  Unlike 2flac, which most often puts the output files in the same folder, flac2mp3 will have a separate output folder.  I run it nightly to pick up any new or edited Flacs and mirror them in the Mp3 library.  It examines file timestamps to determine if a Flac file is new or changed and it skips any where the Mp3 and the Flac have the same mtime.

  • Tag v2.0.52 Makes use of Tag to identify and remove ID3v2 tags.


If this is for the Flac files, I found this wasn't necessary.  I occasionally run into Flacs with id3v2 tags (damned EAC).  If you attempt to use Flac's native re-encoding you'll get an error.  But you can examine the program's exit code and then use the conventional (slower) process of decoding to WAV and then encoding the WAV to Flac.

Code: [Select]
    ' If installed Flac version is >= 1.1.3, use native re-encoding
    If FlacVersion >= "1.1.3" Then
        exitcode = shell.Run("""" & flac & """ " & flacoptions & " -f -s -o """ & ofile & """ """ & ifile & """", 0, True)
    End If
        
    ' If older Flac version, or if the above attempt failed, use old method
    If (FlacVersion < "1.1.3") Or (exitcode <> 0) Then
        Set tags = GetFlacTags(ifile)
        tmpwavfile = fso.BuildPath(fso.GetParentFolderName(ofile), fso.GetBaseName(ofile) & ".wav")
        exitcode = shell.Run("""" & flac & """ -d -f -s -o """ & tmpwavfile & """ """ & ifile & """", 0, True)
        Wav2Flac tmpwavfile, ofile, tags
    End if
Title: Reflacer
Post by: dagordon on 2008-07-02 23:42:34
I just tried out version 2 and it crashes on my system (Vista 32 SP1). Reflacer.exe opens but I immediately get a "Reflacer has stopped working" error and I have to end it. I tried running with administrator priveleges, and running under compatibility modes with previous Windows version, to no avail...

This is with the same script I use with 1.04, which works great.

Thanks
david
Title: Reflacer
Post by: kmitch on 2008-07-02 23:50:18
I just tried out version 2 and it crashes on my system (Vista 32 SP1). Reflacer.exe opens but I immediately get a "Reflacer has stopped working" error and I have to end it. I tried running with administrator priveleges, and running under compatibility modes with previous Windows version, to no avail...

This is with the same script I use with 1.04, which works great.

Thanks
david


I don't have a PC with Vista, so I don't have a way to debug the issue you're encountering.
Title: Reflacer
Post by: agentk7 on 2008-07-03 03:53:07
I really appreciate the work put into this tool.

That being said, I think a problem that FLAC has is that there is no dedicated GUI tool for more casual users to use.  The closest thing is the FLAC Frontend which is very outdated and doesn't allow any FLAC->FLAC actions (updating version, adding replaygain, etc).

I believe it was asked earlier in the thread, but are there any plans to add albumgain to a folder with existing FLAC files? (see post 31)
Title: Reflacer
Post by: mrinferno on 2008-07-28 21:13:45
thanks for the cool script/app.

i have Vista 32-Bit and had issues with v2.0 as well.  it locks up randomly during file processing and errors out randomly.

i've been playing with 1.04 for a week or so, which works fine as long as I turn parallel processing off.

i have a lot of custom tags in my flac files that i've been unsuccessful in getting reflacer/metamp3 to work correctly.  however i'm not really concerned that much, because i can easily use Mp3Tag to manually copy/paste the flac tags to the mp3 files.


what i'm curious about is if there would be an easy way to manually edit the script to turn off the v1.04 script's tag read/write parsing and the image resizing functionality?
an even better option would be if you could consider it as an option in the reflacer.cfg file?

in effect, what i'm trying to do is use your script or exe to strictly parse the directory structure, doing only the flac to mp3 transcoding plus the "additional file masks to copy".  skipping the tag processing entirely.
Title: Reflacer
Post by: kmitch on 2008-07-29 00:09:16
i have a lot of custom tags in my flac files that i've been unsuccessful in getting reflacer/metamp3 to work correctly. however i'm not really concerned that much, because i can easily use Mp3Tag to manually copy/paste the flac tags to the mp3 files.


Which tags exactly?  You can't get them to work by adding information to the Reflacer.tag file?

what i'm curious about is if there would be an easy way to manually edit the script to turn off the v1.04 script's tag read/write parsing and the image resizing functionality?
an even better option would be if you could consider it as an option in the reflacer.cfg file?

in effect, what i'm trying to do is use your script or exe to strictly parse the directory structure, doing only the flac to mp3 transcoding plus the "additional file masks to copy".  skipping the tag processing entirely.


One of the things you can try is to comment out the path to the Tag program (TagProgram) by adding a ' to the beginning of the line.  This should keep it from performing any tag processing.  The other thing you could do is leave Reflacer.tag empty, or place some tags in the file that don't exist in your FLAC files.
Title: Reflacer
Post by: kmitch on 2008-08-07 00:12:31
v2.01 has just been released on Google Code: http://code.google.com/p/reflacer/ (http://code.google.com/p/reflacer/)

Here's what was fixed/added with this version:
== 08/06/2008 _v2.01_ ==
* Fixed ReFLAC lock up bug
* Fixed early exit (before all operations were complete)
* Fixed issue where FLAC results weren't written to screen/log
* Added FLACReplayGain parameter and functionality

Check out the Reflacer.txt file for more information/limitations of FLACReplayGain.  I may have to think about adding a FLACReplayGain mode, but that would be more involved.
Title: Reflacer
Post by: mrinferno on 2008-08-07 01:10:40
cool...

sorry, i missed your reply to my post on the 28th.  i definitely appreciate the reply.

i did try adding the tag types i use to the reflacer.tag file and didn't have much luck.
specifically it was having trouble with multi-value tags, i use tags like "style", "mood", "situation" (theme), etc
they normally have multiple txxx frames for the same tag name with different values.
if i remember correctly it had some trouble with tags i added with spaces in the name, such as a TXXX for "Album Artist" which is fairly common for foobar2000 users.
i did mess around with a bunch of different variations in the reflacer.tag file, the only ones i could get to work reliably were the default tag frames that you provided.
tag.exe was able to read the tag frames properly when i ran it manually on my test files from the command line.

i was able to stop the image resizing simply by commenting it out, if it doesn't work i'll do the same for the tagging.

either way, i'll try the new version tonight or tomorrow to see if it works better with vista.
Title: Reflacer
Post by: mrinferno on 2008-08-07 23:04:40
just got a chance to try v2.01 on my Vista 32-bit build, I still ran into the random lockup's during the decode step, it looked like something happened with flac.exe near the end of the file.  if i ended the flac.exe process, the reflacer.exe console window would dump a bunch of status txt and say decode failed, then move on to the next file.

I think I was able to resolve it by adding the following parameter to the cfg:
Code: [Select]
' flac parameters to use for decoding
FLACDecodeParams=--force --decode --totally-silent


Since adding the --totally-silent option, I have successfully tested 2 runs with 7 albums and 93 flac's.  Once using the MultiProcessor=Y option and once using the  MultiProcessor=N modes.

I'll try to test more and provide additional feedback.  Any way to turn on a debug option to see what's happening in the background when it fails?
Title: Reflacer
Post by: kmitch on 2008-08-07 23:49:55
just got a chance to try v2.01 on my Vista 32-bit build, I still ran into the random lockup's during the decode step, it looked like something happened with flac.exe near the end of the file.  if i ended the flac.exe process, the reflacer.exe console window would dump a bunch of status txt and say decode failed, then move on to the next file.

I think I was able to resolve it by adding the following parameter to the cfg:
Code: [Select]
' flac parameters to use for decoding
FLACDecodeParams=--force --decode --totally-silent


Since adding the --totally-silent option, I have successfully tested 2 runs with 7 albums and 93 flac's.  Once using the MultiProcessor=Y option and once using the  MultiProcessor=N modes.

I'll try to test more and provide additional feedback.  Any way to turn on a debug option to see what's happening in the background when it fails?


Not really.  I think the code is locking up in the call to FLAC.exe.  When it locks up, can you see flac.exe running, but taking up no CPU?  When I launch flac, I'm creating a hidden window and attaching to the STDERR and STDOUT streams from the command.  This is what was causing the issue with reFLACing files, but I didn't experience an issue with MP3s/decodes.

I got around the issue for reflacing by piping STDOUT and STDERR to a temporary file.  Can you try running the same process to reflac without version skipping and let me know if you experience any lock ups?  While that process is running, you'll see a file in the TEMP directory with the output from the process.  I may have to switch all of my external calls to this way of capturing the output.
Title: Reflacer
Post by: mrinferno on 2008-08-11 22:13:03
Not really.  I think the code is locking up in the call to FLAC.exe.  When it locks up, can you see flac.exe running, but taking up no CPU?  When I launch flac, I'm creating a hidden window and attaching to the STDERR and STDOUT streams from the command.  This is what was causing the issue with reFLACing files, but I didn't experience an issue with MP3s/decodes.

I got around the issue for reflacing by piping STDOUT and STDERR to a temporary file.  Can you try running the same process to reflac without version skipping and let me know if you experience any lock ups?  While that process is running, you'll see a file in the TEMP directory with the output from the process.  I may have to switch all of my external calls to this way of capturing the output.

Yes, I think that may be the answer.  flac.exe definitely locks with 0% CPU.
here's the results of my testing:
ReFLAC mode w/o the "--totally-silent" option:
v2.00 - same lock up's as MP3 mode
v2.01 - successfully processes all files, but errored out after final file was processes
v2.02alpha - successfully processes all files and closes without any errors

MP3 mode w/o the "--totally-silent" option:
v2.01 & v2.02alpha flac.exe lock's up

MP3 mode w/ the "totally-silent" option:
v2.01 & v2.02alpha successfully complete

So, maybe by piping the STDOUT & STDERR to txt files for MP3 mode will solve the problem.
Title: Reflacer
Post by: kmitch on 2008-08-14 12:33:53
Reflacer v2.02 has been released here (http://code.google.com/p/reflacer/).  I know it hasn't been that long since the previous version was released, but I wanted to correct the issues users were having with multi-processor processing. 

Below are the things that were added or fixed in this version:
== 08/14/2008 _v2.02_ ==
* Added FLACReplayGain as an option for the MODE parameter
* Will now skip FLACReplayGain if Synchronize=Y and all files already contain Replay Gain
* Added FLACRGParams parameter for metaflac replay gain parameters
* Fixed a issue that could cause cross-thread contamination
* Fixed bug in Resize code that would cause errors if the original image was smaller than desired size
* Added PAUSE parameter
* Fixed bug that caused an error when process completes and GUI status window is open
Title: Reflacer
Post by: Phixion on 2008-08-27 03:00:09
How do I use this program exactly? I've edited the config file, run the .exe and it's giving me critical errors.

What are the basics that I need in a config file to reflac all my FLAC's to the latest version? There's a hell of alot of options in the default config it's confusing.

I'm getting an error when running the .exe: "The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.
Title: Reflacer
Post by: smw on 2008-08-27 03:20:50
How do I use this program exactly? I've edited the config file, run the .exe and it's giving me critical errors.

What are the basics that I need in a config file to reflac all my FLAC's to the latest version? There's a hell of alot of options in the default config it's confusing.



Make sure you have downloaded the other programs first (flac/metaflac, tag, metamp3, lame).  Either put them within the relfacer folder structure or point the config file parameters to them somewhere else:

Then choose the mode:
Choose the directory you want to read (or the filelist or file):  ** Only do one and comment out the others with an apostrophe ' **  (If your directory has spaces, I'm not sure if you are supposed to put quotes around or not...I couldn't get it to work like that, so I moved my root music directory to one with no spaces.)
Choose the target directory, where you want the files to be saved: (blank means copy to the same directory...assuming if you are reflacing, it will overwrite...I have only done 'mp3' and 'decode' modes)
Everything else can be left alone if you want, or you can tweak them, but the ones above are the ones you need to primarily look at/change.

Hope that helps!
Title: Reflacer
Post by: smw on 2008-08-27 03:38:22
First of all, I think this program is awesome!  It is extremely helpful.  I am about to go through and archive all of my CDs on my home computer (I have ripped to mp3 or wma before, but I want a real archive).  However, for my laptop, I wanted to have mp3 or wma (didn't care) copies [storage issue].  I have used several conversions tools before, but nothing that moved tags across...I love my tags and my album art!

That being said, I have one problem I'm running into with tagging--specifically with the album art.  I have flac'd a couple of CDs for testing.  I have all of the tags in there, as well as album art embedded into the flac file.  When I run reflacer in mp3 mode, it all runs as expected and tags as expected, EXCEPT I get the following error message in the log:

Quote
1-ERROR: you may only specify one FLAC file when using '--export-picture-to'


I have tried using DIR as well as FILE and have had no luck.  The files convert to mp3 and all the tags are there, except the album art.

I have embedded the images into the flac file using MediaMonkey.  They are listed as cover art, so I put 'FLAC:3' in the config file.  I have tried all the following lines:
Any help is appreciated.
Title: Reflacer
Post by: Phixion on 2008-08-27 22:49:00
I think I found my issues, I didn't have .NET framwork installed.
Title: Reflacer
Post by: kmitch on 2008-09-13 15:45:34
Version 2.03 has been released.

== 09/13/2008 _v2.03_ ==
* Fixed bug when resizing images in MP3 mode
* Rewrote code to allow FLACReplayGain to use multiple processors

This version fixes the issue that smw was encountering.
Title: Reflacer
Post by: philaphonic on 2009-01-16 15:26:48
Kmitch, thank you very much for this script!

I have two questions:

(1) Is it possible to force reflacer to update the date and time of the reflac'd files? If so, how?

(2) I seem to be having trouble with some long directory names in the .cfg. Should directories with spaces include "" around them?

Thank you.
Title: Reflacer
Post by: philaphonic on 2009-01-16 15:44:29
Apparently the script has a problem with certain non-FLAC files when reflac'ing. When the script encountered an .MKV file just now on my system, it gave an unhandled exception error and stopped:

Unhandled Exception: System.Data.ConstraintException: Column 'SrcDirectory, SrcF
ilename' is constrained to be unique.  Value 'C:\Downloads\! Keep\Sample (Seaso
n 3), Episode 06.mkv' is already present.
  at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction ac
tion)
  at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRo
w eRow, DataRowAction eAction, Boolean fireEvent)
  at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord
, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Ex
ception& deferredException)
  at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos,
Boolean fireEvent)
  at System.Data.DataRowCollection.Add(DataRow row)
  at Reflacer.DSetControl._AddFileToTable(String Filename)
  at Reflacer.ProcessMaster.ProcessFolder(DirectoryInfo Folder)
  at Reflacer.ProcessMaster.ProcessFolder(DirectoryInfo Folder)
  at Reflacer.ProcessMaster.ProcessFolder(DirectoryInfo Folder)
  at Reflacer.ProcessMaster.ProcessFiles()
  at Reflacer.Reflacer.Main(String[] CommandLineArgs)

Any ideas?
Title: Reflacer
Post by: philaphonic on 2009-01-20 20:43:57
A different Windows x64 installation gave me this error today with Reflacer:

Description:
  Stopped working

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01:   reflacer.exe
  Problem Signature 02:   2.3.0.0
  Problem Signature 03:   48c140f3
  Problem Signature 04:   System.Data
  Problem Signature 05:   2.0.0.0
  Problem Signature 06:   47577a33
  Problem Signature 07:   7f6
  Problem Signature 08:   29
  Problem Signature 09:   System.InvalidOperationException
  OS Version:   6.0.6001.2.1.0.256.1
  Locale ID:   1033

Does Reflacer work on Vista x64?
Title: Reflacer
Post by: kmitch on 2009-01-20 22:00:40
Quote
(1) Is it possible to force reflacer to update the date and time of the reflac'd files? If so, how?

No, the only time date/times are modified are if you create MP3s, Reflacer uses the time stamp to determine if changes have been made to the FLAC file to re-encode the MP3 in synchronize mode.

Quote
(2) I seem to be having trouble with some long directory names in the .cfg. Should directories with spaces include "" around them?

No, the program should place the quotes around the filenames when calling FLAC.  Long directory names could cause issues if they cause the command to be too long for windows to handle.

Quote
Apparently the script has a problem with certain non-FLAC files when reflac'ing. When the script encountered an .MKV file just now on my system, it gave an unhandled exception error and stopped:

Looks like a bug, I've got a few more to address that were posted on Google Code, but am working on another project at the moment.  When I get that one stable, I'll take another look at Reflacer.

Does Reflacer work on Vista x64?

I don't have a Vista x64 environment to test in.  I can't really tell from the error message where the problem might lie.
Title: Reflacer
Post by: paulgj on 2009-01-22 08:50:18
Hello,

I just did a test and ReFLAC'ed a directory of files I had previously clean ripped with EAC+FLAC (just to see if there would be any differences) I received the error shown in the attached screen shot.

Hope this helps.

Thanks!
(http://img105.imageshack.us/img105/1995/screenshot1232613891sa2.png)
Title: Reflacer
Post by: paulgj on 2009-01-22 09:31:14
hmmm, just reripped and tried again and this time ReFLACer completed normally.  Weird.
Title: Reflacer
Post by: probedb on 2009-01-26 21:53:38
Hmm, I've tried this again and it crashes....MSs error says something about system.io directory not found but there's nothing in the log file.

Any thoughts? Rogue characters or something??
Title: Reflacer
Post by: probedb on 2009-02-02 18:29:18
This is still crashing....it crashes whether in Test or ReFLAC. It only happens on certain files but isn't writing anything useful to the logs....any ideas?

The songs themselves play fine.
Title: Reflacer
Post by: flacflac on 2010-04-17 18:14:45
Hey everyone,

is there a single executable that allows a user to simply drag-and-drop a folder of FLAC files onto and get a folder of mp3s in V0-2 quality?  I know Foobar is a great way to take care of conversions but it's not ideal for an elderly friend of mine... .

Thanks.
Title: Reflacer
Post by: BoraBora on 2010-04-18 22:32:50
Hey everyone,

is there a single executable that allows a user to simply drag-and-drop a folder of FLAC files onto and get a folder of mp3s in V0-2 quality?  I know Foobar is a great way to take care of conversions but it's not ideal for an elderly friend of mine... .

Thanks.

Try File Blender (http://sector-seven.net/software/fileblender)?