FLAC re-encoding, would like to know option for re-encoding |
![]() ![]() |
FLAC re-encoding, would like to know option for re-encoding |
Dec 14 2006, 10:49
Post
#1
|
|
|
Group: Members Posts: 170 Joined: 7-January 05 From: Germany Member No.: 18891 |
Hey,
I want to re-encode my FLAC files with "FLAC Frontend". If I'll give a FLAC file as input, I get a Wave file decoded. Then I would need to encode it again. Because the programm tells me that I can just use Wave file as input to encode to FLAC. If I do it like that I need lot's of time and I would lose all Tags. Now I would like to know if there is a command line option to re-encode FLAC files with the "flac.exe", that I could keep my Tags. Or is ther a good freeware program? (I would prefere the comand line option) Thanks in advance. |
|
|
|
Dec 14 2006, 11:13
Post
#2
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
Now I would like to know if there is a command line option to re-encode FLAC files with the "flac.exe", that I could keep my Tags. Yes. FLAC 1.1.3 will accept FLAC files as input and will transfer tags.CODE FLAC.EXE -8 -V -o new.flac old.flac
-------------------- I'm on a horse.
|
|
|
|
Dec 14 2006, 13:10
Post
#3
|
|
|
Group: Members Posts: 199 Joined: 16-June 03 Member No.: 7218 |
flac -f filename.flac
|
|
|
|
Dec 14 2006, 14:10
Post
#4
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
flac -f filename.flac If you use this method it may be worth reading this thread. I'm never keen on overwriting or deleting files before I'm sure that the conversion is successful.
-------------------- I'm on a horse.
|
|
|
|
Dec 26 2006, 12:13
Post
#5
|
|
|
Group: Members Posts: 11 Joined: 9-March 02 Member No.: 1475 |
There is some way to automatize all this process?
Some kind of frontend that supports flac2flac or a batch file? thx |
|
|
|
Dec 26 2006, 14:10
Post
#6
|
|
![]() Group: Members Posts: 125 Joined: 15-July 06 From: Germany Member No.: 32930 |
for /r %i in (*.flac) do start /low /wait flac --best --force "%i"
or for /r %i in (*.flac) do start /low /wait flac -A "tukey(0,5)" --best --force "%i" -------------------- FLAC.
|
|
|
|
Dec 26 2006, 19:41
Post
#7
|
|
|
Group: Members Posts: 11 Joined: 9-March 02 Member No.: 1475 |
first thx Martin F.
and by the other way, I modified your command to create another file with the new encode, this could be usefull to someone and if its wrong probably someone can fix my command's sintaxis (Im not exactly an expert with flac CODE for /r %i in (*.flac) do start /low /wait flac --best --force -V "%i" --output-name="%i_"
|
|
|
|
Dec 26 2006, 20:06
Post
#8
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
I would have thought "%i_" would leave you with "<name>.flac_"?
A better solution may be: CODE for /r %i in (*.flac) do start /low /wait flac --best --force -V "%i" --output-name="%~dpni.new.flac" This should convert "<name>.flac" to "<name>.new.flac". -------------------- I'm on a horse.
|
|
|
|
Dec 26 2006, 20:18
Post
#9
|
|
|
Group: Developer Posts: 1289 Joined: 17-March 03 From: Calgary, AB Member No.: 5541 |
Omni Encoder will also do this, no weird command-line twiddling involved.
|
|
|
|
Dec 29 2006, 05:09
Post
#10
|
|
|
Group: Members Posts: 30 Joined: 18-September 05 From: Pennsylvania Member No.: 24556 |
I would have thought "%i_" would leave you with "<name>.flac_"? A better solution may be: CODE for /r %i in (*.flac) do start /low /wait flac --best --force -V "%i" --output-name="%~dpni.new.flac" This should convert "<name>.flac" to "<name>.new.flac". Is this the exact command line to use? I must be missing something because when I try it I get this error "ERROR: -o/--output-name cannot be used with multiple files". |
|
|
|
Dec 29 2006, 09:35
Post
#11
|
|
|
Group: Members Posts: 11 Joined: 9-March 02 Member No.: 1475 |
@agentk7
It's only a whole line. |
|
|
|
Jan 4 2007, 23:55
Post
#12
|
|
|
Group: Members Posts: 2082 Joined: 18-December 03 Member No.: 10538 |
I can get foobar2k v0.9.4.2 to transcode from flac 1.1.0 to 1.1.3, and transfer all the tags, using flac.exe as a custom commandline encoder, but I can't figure out how to get it to delete the old flac file (or overwrite it). I've tried -delete-input-file, or -f (where output directory = input dir), and nothing I've tried works. (ps, also tried --delete-input-file, and that does nothing)
some of the parameters I've tried: -8 -delete-input-file - -o %d -8 -delete-input-file %s -o %d -8 -f - -o %d -8 -f %s -o %d This post has been edited by krabapple: Jan 4 2007, 23:56 |
|
|
|
Jan 5 2007, 00:40
Post
#13
|
|
|
Group: Members Posts: 216 Joined: 2-July 04 Member No.: 15029 |
[quote name='krabapple' date='Jan 4 2007, 14:55' post='461910']
(ps, also tried --delete-input-file, and that does nothing) It certainly is --delete-input-file (--) The helpfiles say it only deletes files when no errors occurred. I'm not familiar with foobar, but I use the (dos)commandline with a program called glob.exe. Don't know where I got it from, sorry. Search the net for it ? The syntax from the batchfile I use is "glob.exe -c flac.exe -6 --force --delete-input-file -S- *.flac" Without the quotes. Maybe its syntax is overcomplete but this works for me. And also works for *.wav |
|
|
|
Jan 5 2007, 21:42
Post
#14
|
|
|
Group: Members Posts: 826 Joined: 29-September 04 Member No.: 17374 |
Regarding deletion of source files in foobar2000: fb2k's converter cannot delete the original file.
|
|
|
|
Jan 6 2007, 03:13
Post
#15
|
|
|
Group: Members Posts: 2082 Joined: 18-December 03 Member No.: 10538 |
I notice that flac-to-flac transcodes (using command line flac.exe and, I guess, metaflac.exe) automatically transfer many of the metadata tags from old file to new -- all the standards as well as COMPOSER and COMMENTS -- which is great. However it does not seem to transfer the old replaygain values to the new. Is that even possible? If it requires a -T NAME=VALUE in the command line as per vorbis comments what are the VALUE variables for replaygain track peak, track gain, album peak, album gain? For that matter, I'm not even sure how the NAME should be written -- e.g. with underscores?
-T replaygain_track_gain=" ? " This post has been edited by krabapple: Jan 6 2007, 03:15 |
|
|
|
Jan 6 2007, 07:06
Post
#16
|
|
|
Group: Members Posts: 2082 Joined: 18-December 03 Member No.: 10538 |
Now I would like to know if there is a command line option to re-encode FLAC files with the "flac.exe", that I could keep my Tags. Yes. FLAC 1.1.3 will accept FLAC files as input and will transfer tags.CODE FLAC.EXE -8 -V -o new.flac old.flac When I run that , it first warns me my input file is not a WAV file and will be treated as a raw file, then throws an error because I have not specified --endian, --sign, etc. So no file is output. Does this command actually work for you, to reencode from flac to flac? So far none of the command lines or batch scripts posted here work for me, using flac 1.1.0 or 1.1.2 files as input,and hoping for a smaller flac 1.1.3 file as output. This post has been edited by krabapple: Jan 6 2007, 07:07 |
|
|
|
Jan 6 2007, 08:10
Post
#17
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
Are you sure that you are testing with FLAC 1.1.3?
It works fine here: CODE C:\Documents and Settings\Neil\Desktop>flac112 test.wav flac 1.1.2, Copyright (C) 2000,2001,2002,2003,2004,2005 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. options: -P 4096 -b 4608 -m -l 8 -q 0 -r 3,3 test.wav: wrote 197077 bytes, ratio=0.464 C:\Documents and Settings\Neil\Desktop>flac -o new.flac test.flac flac 1.1.3, Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. test.flac: wrote 195137 bytes, ratio=0.990 Edit: If I use 1.1.2 to try to re-encode I get: CODE C:\Documents and Settings\Neil\Desktop>flac112 -o new2.flac test.flac
flac 1.1.2, Copyright (C) 2000,2001,2002,2003,2004,2005 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. options: -P 4096 -b 4608 -m -l 8 -q 0 -r 3,3 ERROR: for encoding a raw file you must specify a value for --endian, --sign, -- channels, --bps, and --sample-rate Type "flac" for a usage summary or "flac --help" for all options This post has been edited by Synthetic Soul: Jan 6 2007, 09:26 -------------------- I'm on a horse.
|
|
|
|
Jan 6 2007, 12:53
Post
#18
|
|
|
Group: Members Posts: 216 Joined: 2-July 04 Member No.: 15029 |
However it does not seem to transfer the old replaygain values to the new. Is that even possible? Tested the transcode from v1.1.0 to v1.1.3 and all values were copied. Replaygain values also. You are sure you overwrote all older versions with the new 1.1.3 ones ? |
|
|
|
Jan 6 2007, 22:36
Post
#19
|
|
|
Group: Members Posts: 2082 Joined: 18-December 03 Member No.: 10538 |
Are you sure that you are testing with FLAC 1.1.3? Yes. I've uninstalled, downloaded and run flac113b installer twice now. flac -v from the command line shows flac 1.1.3 but I think I've found my error. I've been putting -V 8 in the command line instead of -V -8 -- in other words a stupid typo on my part, probably me half-instinctively reverting to LAME command line syntax for EAC. Flac-to-flac using flac.exe in a terminal window is working now,old file is ovewritten, and replaygain values are transferred. I'm going to go slap myself with a wet fish when I'm done. The flac batch commands I've copied from threads here still aren't working for me though. This post has been edited by krabapple: Jan 6 2007, 23:31 |
|
|
|
Jan 7 2007, 00:10
Post
#20
|
|
|
Group: Members Posts: 2082 Joined: 18-December 03 Member No.: 10538 |
This seems to work; I adapted it from one of Synthetic Soul's batch scripts on another thread; obviously it's very much like yours Martin -- except that with only one flac encoder in my system it seems smart enough not to need an explicit encoder statement
CODE @ECHO OFF FOR /R %1 %%G IN (*.flac) DO FLAC.EXE --best -V --force "%%G" all is bliss! and for even more compressed bliss, this substitutes a much slower but more aggressive encode I got from a post by JWolf CODE @ECHO OFF FOR /R %1 %%G IN (*.flac) DO FLAC.EXE -8 -A tukey(0.25) -A gauss(0.1875) -b 4096 -V --force "%%G" Bjork Homogenic directory -- size/size on disc, as reported by Windows flac 1.1.0 probably set at -8 294 MB (308,537,323 bytes)/294 MB (308,559,872 bytes) flac 1.1.3 --best 293 MB (307,439,199 bytes)/293 MB (307,462,144 bytes) flac1.1.3 -8 -A tukey(0.25) -A gauss(0.1875) -b 4096 292 MB (307,129,792 bytes)/292 MB (307,150,848 bytes) This post has been edited by krabapple: Jan 7 2007, 00:16 |
|
|
|
Jan 7 2007, 01:46
Post
#21
|
|
|
Group: Members Posts: 857 Joined: 5-March 05 From: Denmark Member No.: 20365 |
Nice to hear that you have gotten it sorted out now
I added the %encoder% variable to the script in case you haden't flac.exe located somewhere within your PATH environment variable and so as to avoid you having to move it there for getting the script to work. Also your change to use %%G instead of %%F was also a good change, since i have just read that even though all letters can be used, then %%G are recommended to be used as e.g. using %%F and also some other letters could actually make some problems and also break a FOR script on NT4 systems. Anyway, Nice work on making a functioning script and i'm happy that you've gotten it sorted out eventually CU, Martin. |
|
|
|
Jan 7 2007, 11:45
Post
#22
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
I have created a batch file to convert to FLAC 1.1.3.
If you drag a file or folder onto the batch file it will process all FLAC files within (including subfolders). It will first use -t to test the source file, and only if the test is successful will then If any files do fail testing or re-encoding they will be listed once all processing has finished. To use the batch file you need to first open it in Notepad and amend the lines: CODE SET pathToFLAC="FLAC.EXE" SET flacOptions=-8 ... to suit. You really only need quotes around pathToFLAC if the path contains spaces. The switches -V Hopefully some people will find this useful. * DISCLAIMER: But, of course, it may. Don't blame me. Test before you run it on anything precious. This post has been edited by Synthetic Soul: Jan 7 2007, 14:06 -------------------- I'm on a horse.
|
|
|
|
Jan 7 2007, 12:26
Post
#23
|
|
|
Group: Members Posts: 88 Joined: 8-July 04 Member No.: 15139 |
Thanks for the batch file - just what I was looking for. Unfortunately it's not working properly (using 1.0.0 or 1.1.0).
My directory structure is: I:\albums\artist1 - year1 - album1\artist1 - year1 - album1.flac I:\albums\artist2 - year2 - album2\artist2 - year2 - album2.flac etc... and when I drag the albums folder onto the batch file it keeps rencoding "artist1 - year1 - album1.flac" and doesn't move on to the next one. Could you have a look at that? Cheers, Ed |
|
|
|
Jan 7 2007, 14:04
Post
#24
|
|
![]() Group: Super Moderator Posts: 4887 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
Here's my test (1.1.0 used):
CODE Checking: "L:\albums" Testing: "L:\albums\artist1 - year1 - album1\artist1 - year1 - album1.flac" ________________________________________________________________________ flac 1.1.3, Copyright © 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. artist1 - year1 - album1.flac: ok Encoding: "L:\albums\artist1 - year1 - album1\artist1 - year1 - album1.flac" ________________________________________________________________________ flac 1.1.3, Copyright © 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. artist1 - year1 - album1.flac: Verify OK, wrote 256863 bytes, ratio=1.000 Testing: "L:\albums\artist2 - year2 - album2\artist2 - year2 - album2.flac" ________________________________________________________________________ flac 1.1.3, Copyright © 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. artist2 - year2 - album2.flac: ok Encoding: "L:\albums\artist2 - year2 - album2\artist2 - year2 - album2.flac" ________________________________________________________________________ flac 1.1.3, Copyright © 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. artist2 - year2 - album2.flac: Verify OK, wrote 256863 bytes, ratio=1.000 2 file(s) processed. 2 file(s) encoded. 0 file(s) returned an error. Press any key to exit Bear in mind that FLAC first tests the file, and then re-encodes the file. Are you sure you are not seeing the test and then the re-encode? -------------------- I'm on a horse.
|
|
|
|
Jan 7 2007, 16:50
Post
#25
|
|
|
Group: Members Posts: 88 Joined: 8-July 04 Member No.: 15139 |
Yeah, I'm pretty sure, here's my output:
CODE Checking: "I:\Albums" Testing: "I:\Albums\Guns N' Roses - 1987 - Appetite For Destruction\Guns N' Rose s - 1987 - Appetite For Destruction.flac" ________________________________________________________________________ flac 1.1.3, Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. Guns N' Roses - 1987 - Appetite For Destruction.flac: ok Encoding: "I:\Albums\Guns N' Roses - 1987 - Appetite For Destruction\Guns N' Ros es - 1987 - Appetite For Destruction.flac" ________________________________________________________________________ flac 1.1.3, Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.993 Guns N' Roses - 1987 - Appetite For Destruction.flac: 100% complete, ratio=0.992 Guns N' Roses - 1987 - Appetite For Destruction.flac: Verify OK, wrote 403736967 bytes, ratio=0.992 Testing: "I:\Albums\Guns N' Roses - 1987 - Appetite For Destruction\Guns N' Rose s - 1987 - Appetite For Destruction.flac" ________________________________________________________________________ flac 1.1.3, Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. Guns N' Roses - 1987 - Appetite For Destruction.flac: ok Encoding: "I:\Albums\Guns N' Roses - 1987 - Appetite For Destruction\Guns N' Ros es - 1987 - Appetite For Destruction.flac" ________________________________________________________________________ flac 1.1.3, Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details. Guns N' Roses - 1987 - Appetite For Destruction.flac: 1% complete, ratio=0.907 Ed |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 04:02 |