Skip to main content

Topic: Reflacer (Read 43567 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • dagordon
  • [*]
Reflacer
Reply #25
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.

  • mattross
  • [*]
Reflacer
Reply #26
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?
  • Last Edit: 12 April, 2008, 12:59:32 PM by mattross

  • kmitch
  • [*]
Reflacer
Reply #27
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

  • CoyoteSmith
  • [*][*][*]
Reflacer
Reply #28
does this transfer metadata like comments, album name, artist name etc?

  • kmitch
  • [*]
Reflacer
Reply #29
does this transfer metadata like comments, album name, artist name etc?


Yes.

  • Balnes
  • [*]
Reflacer
Reply #30
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!

  • likeatree
  • [*]
Reflacer
Reply #31
keep up the good work, can't wait for vb version!

  • kmitch
  • [*]
Reflacer
Reply #32
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/

  • likeatree
  • [*]
Reflacer
Reply #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.
  • Last Edit: 04 June, 2008, 04:19:35 PM by likeatree

  • JJZolx
  • [*][*][*][*]
Reflacer
Reply #34
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

  • dagordon
  • [*]
Reflacer
Reply #35
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

  • kmitch
  • [*]
Reflacer
Reply #36
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.

  • agentk7
  • [*]
Reflacer
Reply #37
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)
  • Last Edit: 02 July, 2008, 10:58:49 PM by agentk7

  • mrinferno
  • [*][*][*]
Reflacer
Reply #38
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.

  • kmitch
  • [*]
Reflacer
Reply #39
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.

  • kmitch
  • [*]
Reflacer
Reply #40
v2.01 has just been released on Google Code: 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.

  • mrinferno
  • [*][*][*]
Reflacer
Reply #41
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.

  • mrinferno
  • [*][*][*]
Reflacer
Reply #42
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?

  • kmitch
  • [*]
Reflacer
Reply #43
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.

  • mrinferno
  • [*][*][*]
Reflacer
Reply #44
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.

  • kmitch
  • [*]
Reflacer
Reply #45
Reflacer v2.02 has been released here.  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

  • Phixion
  • [*][*]
Reflacer
Reply #46
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.
  • Last Edit: 26 August, 2008, 10:09:56 PM by Phixion

  • smw
  • [*]
Reflacer
Reply #47
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:
  •   FLACProgram=%ScriptDir%\FLAC\bin\flac.exe
  •   MetaFLACProgram=%ScriptDir%\FLAC\bin\metaflac.exe
  •   TagProgram=%ScriptDir%\Tag\Tag.exe
  •   Metamp3Program=%ScriptDir%\metamp3\metamp3.exe
  •   LAMEProgram=%ScriptDir%\lame\lame.exe


Then choose the mode:
  •   Mode=MP3

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.)
  •   Dir=C:\Music
  •   'FileList=
  •   'File=

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)
  •   TargetDir=

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!

  • smw
  • [*]
Reflacer
Reply #48
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:
  • ImageSource=File:folder.jpg|File:.folder.png|FLAC:3
  • ImageSource=FLAC:3
  • ImageSource=FLAC:0  (When I use this one, I don't get the error, but I don't get the picture, so I'm guessing that FLAC:3 is correct.)

Any help is appreciated.

  • Phixion
  • [*][*]
Reflacer
Reply #49
I think I found my issues, I didn't have .NET framwork installed.