Reflacer, VBScript to re-flac, decode, encode, and re-encode to MP3 |
![]() ![]() |
Reflacer, VBScript to re-flac, decode, encode, and re-encode to MP3 |
Feb 23 2008, 03:12
Post
#1
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
Based on configuration file or command line parameters, offers the following functionality:
09/13/2008 v2.03
This post has been edited by kmitch: Sep 13 2008, 15:43 |
|
|
|
Feb 23 2008, 23:19
Post
#2
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
Original discussions of Reflacer are here:
http://www.hydrogenaudio.org/forums/index....showtopic=50993 |
|
|
|
Feb 28 2008, 10:35
Post
#3
|
|
![]() Group: Members Posts: 30 Joined: 24-April 03 Member No.: 6154 |
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. |
|
|
|
Feb 28 2008, 12:51
Post
#4
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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. This post has been edited by kmitch: Feb 28 2008, 12:54 |
|
|
|
Feb 28 2008, 21:42
Post
#5
|
|
|
Group: Members Posts: 107 Joined: 15-December 03 Member No.: 10468 |
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 |
|
|
|
Feb 28 2008, 23:26
Post
#6
|
|
![]() Group: Members Posts: 841 Joined: 21-December 01 From: New Zealand Member No.: 705 |
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.
This post has been edited by A_Man_Eating_Duck: Feb 28 2008, 23:27 -------------------- Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith. |
|
|
|
Feb 28 2008, 23:35
Post
#7
|
|
|
Group: Members Posts: 107 Joined: 15-December 03 Member No.: 10468 |
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? 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? |
|
|
|
Feb 29 2008, 00:02
Post
#8
|
|
![]() Group: Members Posts: 841 Joined: 21-December 01 From: New Zealand Member No.: 705 |
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. |
|
|
|
Feb 29 2008, 00:05
Post
#9
|
|
|
Group: Members Posts: 107 Joined: 15-December 03 Member No.: 10468 |
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? |
|
|
|
Feb 29 2008, 00:17
Post
#10
|
|
![]() Group: Members Posts: 841 Joined: 21-December 01 From: New Zealand Member No.: 705 |
Sorry if I seem clueless about this. Yes, but only when piping. If you set foobar to create an intermediate file instead of piping, the filesizes should match.
Are you saying foobar creates unnecessary seekpoints? This post has been edited by A_Man_Eating_Duck: Feb 29 2008, 00:30 -------------------- Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith. |
|
|
|
Feb 29 2008, 01:12
Post
#11
|
|
|
Group: Members Posts: 60 Joined: 24-December 03 Member No.: 10678 |
How about an option to encode to M4A keeping the tag & image file.
-------------------- [url="http://www.updatemystuff.com"]UpdateMyStuff[/url]
|
|
|
|
Feb 29 2008, 02:04
Post
#12
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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. |
|
|
|
Feb 29 2008, 11:41
Post
#13
|
|
![]() Group: Members Posts: 40 Joined: 22-January 07 From: usa Member No.: 39911 |
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. 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. 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. Looking again at your notes, it looks like you've done some of my ideas already. Thanks, and Respectfully, This post has been edited by noorotic: Feb 29 2008, 11:46 |
|
|
|
Mar 3 2008, 00:07
Post
#14
|
|
![]() Group: Members Posts: 178 Joined: 16-April 07 Member No.: 42593 |
Nice program. Wpuld it be possible to add a mode to convert Flac images with Cue to individual MP3 files?
|
|
|
|
Mar 3 2008, 16:40
Post
#15
|
|
|
Group: Banned Posts: 385 Joined: 22-June 06 Member No.: 32111 |
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.
|
|
|
|
Mar 4 2008, 02:22
Post
#16
|
|
![]() Group: Members Posts: 178 Joined: 16-April 07 Member No.: 42593 |
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. |
|
|
|
Mar 4 2008, 13:39
Post
#17
|
|
|
Group: Members Posts: 23 Joined: 20-July 05 Member No.: 23437 |
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 This post has been edited by Tirade: Mar 4 2008, 13:41 |
|
|
|
Mar 4 2008, 20:00
Post
#18
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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. |
|
|
|
Mar 4 2008, 20:50
Post
#19
|
|
|
Group: Members Posts: 23 Joined: 20-July 05 Member No.: 23437 |
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. |
|
|
|
Mar 5 2008, 00:44
Post
#20
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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 |
|
|
|
Mar 6 2008, 19:10
Post
#21
|
|
|
Group: Banned Posts: 385 Joined: 22-June 06 Member No.: 32111 |
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. |
|
|
|
Mar 9 2008, 00:51
Post
#22
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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
|
|
|
|
Mar 10 2008, 21:44
Post
#23
|
|
![]() Group: Members Posts: 96 Joined: 17-September 06 Member No.: 35303 |
Running into a bug with the multiprocessor.
CODE 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. This post has been edited by Heliologue: Mar 10 2008, 21:44 |
|
|
|
Mar 10 2008, 22:23
Post
#24
|
|
|
Group: Members Posts: 15 Joined: 8-July 06 Member No.: 32676 |
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 |
|
|
|
Mar 11 2008, 01:22
Post
#25
|
|
![]() Group: Members Posts: 41 Joined: 4-February 08 Member No.: 51021 |
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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 14:10 |