Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Reflacer (Read 60002 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Reflacer

Based on configuration file or command line parameters, offers the following functionality:
  • Encode - The program looks for .WAV files and will encode them using .FLAC
  • Decode - The program looks for .FLAC files and will decode them to .WAV
  • MP3 - The program looks for .FLAC files, intermediately decodes them to .WAV, then uses lame to encode the .WAV to .MP3 and removes the .WAV file
  • ReFLAC - The program looks for .FLAC files and re-encodes them to .FLAC
  • Test - The program looks for .FLAC and tests the files for validity
Taking the following types of input:
  • Directory - Command Line Parameter DIR. If used, the program will look in this directory and all subdirectories for files and perform the Mode action on those files
  • File List - Command Line Parameter FILELIST. formatted as 1 file per line with full path and filename, the program will iterate through each file and perform the mode action. File - Command Line Parameter
  • FILE. It will allow the program to act on an individual file.
This program is just a wrapper around functionality available in other programs. It makes use of the following executables:
  • FLAC v1.2.1 Makes use of flac.exe and metaflac.exe, these programs can be obtained from <a href="http://flac.sourceforge.net/" target="_blank">http://flac.sourceforge.net/</a> on the Download page, click on the link to download FLAC for Windows (command-line tools only).
  • Tag v2.0.52 Makes use of Tag to identify and remove ID3v2 tags. This program can be obtained from <a href="http://synthetic-soul.co.uk/tag/" target="_blank">http://synthetic-soul.co.uk/tag/</a>
  • Lame v3.97 LAME is an MPEG Audio Layer III (MP3) encoder licensed under the LGPL. It can be downloaded from <a href="http://lame.sourceforge.net" target="_blank">http://lame.sourceforge.net</a>
  • metamp3 v.092b5 MetaMP3 is used to copy tags from FLAC files to MP3 files when in MP3 mode <a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=49751" target="_blank">http://www.hydrogenaudio.org/forums/index....showtopic=49751</a>
  • imgResize v1.00 This program is distributed (with source) with Reflacer. This program is a simple VB .Net application to accept an image file, and resize it.
Change Log

09/13/2008 v2.03
  • Fixed bug when resizing images in MP3 mode
  • Rewrote code to allow FLACReplayGain to use multiple processors
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
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
06/03/2008 v2.00
  • First VisualBasic Version
  • Added tray icon with status information
03/08/2008 v1.04
  • MULTIPROCESSOR parameter added (jamesbaud)
  • Fixed possible issue with comparison of directories when using DIR parameter
  • Added ability to add FLAC tags when encoding based on Filename Mask and File
  • TAGMASK parameter added (jamesbaud)
  • TAGFILE parameter added (jamesbaud)
  • Added report at the end of the run that shows counts of the operations performed
02/22/2008 v1.03
  • Added support for metamp3 for copying tags
  • Added METAMP3PROGRAM & METAMP3PARAMS command line/config file parameter
  • New file Reflacer.tag, used to map FLAC tags to MP3
  • Added TAGGER command line/config file parameter, choose between Tag or metamp3
  • The %ScriptDir% variable can now be used for any command line/config file parameters
  • Added ability to use a file or FLAC picture in MP3 conversion
  • IMAGESOURCE parameter allows hierarchy to use when searching for an image
  • Introduction of imgResize.exe (simple VB app to resize an image file)
  • RESIZEIMAGE parameter turns imgResize on or off
  • Added IRPROGRAM & IRPARAMETERS to support imgResize
  • Fixed potential error where path to the programs contained a space
  • Temp directory is now used for all temporary processing files
  • Code Change - all variables have been switched to Hungarian notation
02/09/2008 v1.02
  • Fixed bug with the Logo being written to the screen in an error state
  • If using DIR and TARGETDIR, a list of files that are in TARGETDIR but not in DIR will be logged
  • Added COPYFILEMASKS command line/config file parameter (Demetris)
  • Will now create TARGETDIR if it does not exist (Demetris)
  • Will now handle TARGETDIR being a child of DIR (will not recurse TARGETDIR) (probedb)
  • When specify variables for LOGDIR, may use ^ instead of % (easier in batch files)
  • Fixed bug with displaying TARGETDIR parameter
  • Fixed bug that occurred when decoding a flac file failed in MP3 mode
02/06/2008 v1.01
  • Changed name from Re-FLACer
  • Fixed bug when directory to be created was more than 1 level deep
  • Added wrappers around FileSystemObject calls
  • Moved code around to make it easier to read
  • Added LOGDIR command line/config file parameter (Demetris)
  • Added single File Processing (FILE parameter)
  • Added FLAC command line parameters (Demetris)
02/02/2008 v1.00
  • Initial release
The home page for the software is on Google Code.


Reflacer

Reply #2
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.

Reflacer

Reply #3
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.

Reflacer

Reply #4
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

Reflacer

Reply #5
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.
Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith.

Reflacer

Reply #6

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?

Reflacer

Reply #7
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.
Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith.

Reflacer

Reply #8
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?

Reflacer

Reply #9
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.
Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith.

Reflacer

Reply #10
How about an option to encode to M4A keeping the tag & image file. 

Reflacer

Reply #11
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.

Reflacer

Reply #12
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,

Reflacer

Reply #13
Nice program. Wpuld it be possible to add a mode to convert Flac images with Cue to individual MP3 files?
Glass half full!

Reflacer

Reply #14
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.

Reflacer

Reply #15
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.
Glass half full!

Reflacer

Reply #16
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

Reflacer

Reply #17
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.

Reflacer

Reply #18
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.

Reflacer

Reply #19
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

Reflacer

Reply #20
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.

Reflacer

Reply #21
Reflacer v1.04 has been released, you can get it here: http://code.google.com/p/reflacer/

Here are the changes for this version:

03/08/2008 v1.04
  • MULTIPROCESSOR parameter added (jamesbaud)
  • Fixed possible issue with comparison of directories when using DIR parameter
  • Added ability to add FLAC tags when encoding based on Filename Mask and File
  • TAGMASK parameter added (jamesbaud)
  • TAGFILE parameter added (jamesbaud)
  • Added report at the end of the run that shows counts of the operations performed

Reflacer

Reply #22
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.

Reflacer

Reply #23
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

Reflacer

Reply #24
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.