IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
How can I complete this huge conversion job?, need to make sure the quality of input files is safe
raygrote
post Aug 9 2013, 00:02
Post #1





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Hi all,
I have a large collection of wav files, 123 GB of wavs, in fact, which I have recorded over the past few years. some of them are 16 bit, others are 24 bit. Some are at 44K sample rate and others are as high as 96. so we have a wide assortment of bit depths and sample rates.
All of these files are split into around 30 folders. I need to convert all of the files to flac to save space. Flac is also very high on my compatibility list, so most of the time I wont' even notice a difference between it and Wav.
Normally, I'd go to my favorite audio editor, Gold Wave, which has quite a feature list for batch conversions. Gold Wave can preserve most of the attributes of the original files, which is what I would really need. However, there is a problem. Gold Wave cannot detect the bit depth of the files and convert accordingly. Instead, you have to select the bit depth that the files are converted to. I E-mailed support about that, and I'm waiting to hear back. I thought i'd post here in the meantime to see if there was other software that would allow for better conversion.
If I convert all the files to 24 bit flac to be on the safe side, the files which were originally 16 bit won't compress nearly as much because they're being converted to 24. From what I've been reading about how compressors work, I thought lossless and lossy formats didn't have a bit depth, only the decoded, uncompressed files do. I might be wrong about that... I'm the last person to be investigating the complex math behind those facts. But I'm guessing here that the reason the 16 bit wavs don't compress as well with 24 bit is because now we're exposing 16 bit quantization errors, which are well above the floor of 24 bit... anyway that's not really the point of this topic.
The point of this topic is to ask if there's a program to convert a huge batch of wav files to Flac, and retain the file attributes. Preferably, it would allow me to set the compression level, as I would probably go for the highest, even though it's slow. It would certainly have to dig through subdirectories without my assistance. There are too many folders for me to add them individually, I'd rather just have it look through the main folder where all the subdirectories with the files are.
I'd greatly appreciate any help! Perhaps Gold Wave has this feature, and I have been missing it... somehow I doubt that. If anything comes out of the support inquiry though, I'll post it here.
Go to the top of the page
+Quote Post
db1989
post Aug 9 2013, 00:07
Post #2





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Why do you think you need to make any effort to ensure losslessness? The basic encoder will read the sampling rate and depth from the input file, assuming it specifies these correctly in its header, and preserve them accordingly. As long as you have not ruined any headers, everything will be done for you automatically.

[edit] To be clear, I mean you need not use Goldwave or anything ungainly like that: just run the CLI encoder using wildcards and/or from a batch file, or use something like FLAC Frontend or, as AndyH-ha suggested below, foobar2000. [/edit]

QUOTE
Flac is also very high on my compatibility list, so most of the time I wont' even notice a difference between it and Wav.
No, you will not notice any difference. FLAC is a lossless format. What else would that word mean?

This post has been edited by db1989: Aug 9 2013, 00:18
Go to the top of the page
+Quote Post
AndyH-ha
post Aug 9 2013, 00:12
Post #3





Group: Members
Posts: 2204
Joined: 31-August 05
Member No.: 24222



Batch conversions with foobar2000 will select all files in subdirectories when one uses Add folder and selects the folder that contains many subfolders. I've done quite a few conversions that way. What I don't know is how mixed spec input files will be handled as I haven't tried that. You , being interested, might experiments with a few small batches to see what comes out.
Go to the top of the page
+Quote Post
TomasPin
post Aug 9 2013, 00:16
Post #4





Group: Members
Posts: 200
Joined: 5-June 13
From: Argentina
Member No.: 108508



I second foobar2000 as a recommendation.

(db1989, shouldn't this be moved from FLAC? In the end the OP is just asking for software to encode large collections...)


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
raygrote
post Aug 9 2013, 02:13
Post #5





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Wow, less than 2 hours and we have 3 replies.
First to db1989:
I need to make an effort to ensure losslessness, because Gold Wave uses its own extentions to encode and decode files. Which means that they end up meeting Gold Wave in the middle, and Gold Wave likes to let you control everything in the batch conversions. There are a few things that you can just set to auto, but bit depth is not one of them, at least to my knowledge. Thus, the files are converted to the bit depth you select, before being sent to the encoder. and when I say I wouldn't notice a difference between flac and wav, I was not questioning or confirming Flac's losslessness. I was saying, that since Flac compatibility is high,I'll be able to work with flac files, as easily as I can with wavs. I don't understand where that confusion came up.
And, if this topic is in the wrong place, I apologize. I thought since it was related to a problem I was having with Flac conversion, it would fit here.
And finally, to the Foobar recommendations:
I just downloaded Foobar again, and am trying the batch conversion. It works well on small batches, and it indeed has an auto option that works but I wouldn't expect much less from Foobar. It just takes about 10 times as long as Gold Wave to import a large group of files. This is probably because Gold Wave only gathers the directories, and then gathers the files during the conversion. But Foobar has many more options, and I like it a lot more for this purpose. If nothing else, the better conversion will make me use Foobar more, and I may get into the other things it can do.

This post has been edited by raygrote: Aug 9 2013, 02:17
Go to the top of the page
+Quote Post
db1989
post Aug 9 2013, 02:19
Post #6





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Sure, I understood your points regarding the compromises introduced by GoldWave. Hence my sentiment that you should use something that is actually meant for batch-conversion. The reason GoldWave asks you to specify bit-depths and suchlike is probably that such programs are usually used for editing purposes that might require conversion to differing parameters afterwards. A dedicated batch-converter will not have any such obstacles and will simply pass the WAVs to flac.exe/dll, allowing it to determine and preserve the input parameters automatically.

My mistake regarding your statement about a difference. I see what you meant now that you have specified it.

As for foobar2000 and speed, if the reason is the one you suggested, I assume the initial slowdown when loading files into the playlist will be compensated because fb2k now will not have to acquire them immediately prior to conversion, whereas GoldWave would.

Finally, I donít feel this is in the wrong location at all, so no worries there.
Go to the top of the page
+Quote Post
raygrote
post Aug 9 2013, 02:56
Post #7





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Yep, I see your point completely with Gold Wave not being meant for this kind of conversion. My laziness suggested otherwise, however. I still wonder if they can add that. It'll at least be one more feature to add to the big list of batch conversion options available.
I can't tell just how much of a difference we get with speed in Foobar yet, but apart from the somewhat long wait for the list to get populated, the conversion seems fast enough. If I find anything else, I will post here.
Go to the top of the page
+Quote Post
TomasPin
post Aug 9 2013, 02:58
Post #8





Group: Members
Posts: 200
Joined: 5-June 13
From: Argentina
Member No.: 108508



QUOTE (db1989 @ Aug 8 2013, 22:19) *
I donít feel this is in the wrong location at all, so no worries there.

In that case, I'm the one who should apologize. smile.gif


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
Makaki
post Aug 9 2013, 03:58
Post #9





Group: Members
Posts: 59
Joined: 20-May 13
Member No.: 108227



I would use the command line tools provided by FLAC, and windows PowerShell to make a for loop that would recursively go thru all the folders. The FLAC command line tool has a flag to verify compression. Linux/Mac should have for loops as well.

I believe the target file should remain in the same folder as the originals. And you can opt to preserve or delete the originals.
Go to the top of the page
+Quote Post
raygrote
post Aug 9 2013, 04:23
Post #10





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Hi,
Ideally, I'd do something exactly like that. But after reading through the main features of Power Shell, I don't think that's an option for me. I know virtually nothing when it comes to programming/scripting, and I'll get lost so easily, it's embarrassing. Still, I'm not totally against using the command line to do tasks like that, I'm just very weak with doing those kinds of things that way since I'm so used to plain frontends and the like.
Go to the top of the page
+Quote Post
Makaki
post Aug 9 2013, 05:00
Post #11





Group: Members
Posts: 59
Joined: 20-May 13
Member No.: 108227



You don't need windows powershell, normal shell will do.

The basics of what you want is:
CODE
for /r %i in (*.wav) do flac --verify --best "%i"


Now in case you don't know how to get around a command prompt, here is some quick basics.
View contents of current folder:
CODE
dir


Change drive letter:
CODE
C:


Change folder:
CODE
cd FolderName


Go Back to parent folder:
CODE
cd ..


NOTE: You'll either have to copy the flac.exe program on the folder where you are going to be when you run the for command. Or put it's full path in quotes.
Go to the top of the page
+Quote Post
dhromed
post Aug 9 2013, 09:53
Post #12





Group: Members
Posts: 1286
Joined: 16-February 08
From: NL
Member No.: 51347



QUOTE (raygrote @ Aug 9 2013, 01:02) *
so we have a wide assortment of bit depths and sample rates.

Take one of each variation, copy those three or four files to a folder, convert them as an experiment and see what happens. If it's flawless, hit up the main load and go get lunch.
Go to the top of the page
+Quote Post
raygrote
post Aug 9 2013, 12:19
Post #13





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Hi,
I already tried a small batch to see if it worked, and it failed. That's why I posted here. Fortunately it's fine with Foobar, and we'll see if anything else passes the test.
And thanks for the command line tips. I'll give it a spin now, as I think I can probably do those things. I'll post back with results.
Go to the top of the page
+Quote Post
pdq
post Aug 9 2013, 12:58
Post #14





Group: Members
Posts: 3372
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



As far as your comment about converting from 16 bit to 24 bit before lossless conversion (which makes no sense at all), if all you do is add 8 bits of zeros then the file will still compress just as well. If, on the other hand, you do any kind of processing or add dither, then the compressed file will be much larger, just as you said.
Go to the top of the page
+Quote Post
phofman
post Aug 9 2013, 13:57
Post #15





Group: Members
Posts: 283
Joined: 14-February 12
Member No.: 97162



For conversion I would use sox as it does all format detection automatically. It preserves samplerate or bitdepth of the resultant flac file, no need to do any preliminary conversion, checks, or using different command lines for different files.

All you need to do is call sox on each of the files., just like the loop shown above.

Actually this task would be the very motivation for using a computer many decades ago. The work-intensive GUI tools without any automation available make this task look complicated.
Go to the top of the page
+Quote Post
db1989
post Aug 9 2013, 14:14
Post #16





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (phofman @ Aug 9 2013, 13:57) *
For conversion I would use sox as it does all format detection automatically. It preserves samplerate or bitdepth of the resultant flac file, no need to do any preliminary conversion, checks, or using different command lines for different files.

But flac.exe itself can do this just fine when all the files input are supported formats, as seems to be the case here. Maybe if the OP were using a wide mixture of formats including raw PCM and ones that flac.exe does not support, there would be a rationale for using another executable. As it is, I feel they might as well just take the simple route of using the official encoder since it is perfectly capable. The suggestion is good, as is telling people about SoX in general, but I feel it is surplus to requirements in this case.

But anyway, I presume the current plan is to pipe things through fb2k, which does the same thing that SoX would be doing.
Go to the top of the page
+Quote Post
raygrote
post Aug 9 2013, 16:42
Post #17





Group: Members
Posts: 48
Joined: 4-April 08
Member No.: 52552



Hi PDQ:
You are right. I just tested some more, and sure enough, going from 16 to 24 in foobar doesn't change file size much. Going from 16 to 24 bit in Gold Wave makes the 24 bit flacs twice as large as the 16 bit ones, if not larger. So it must be adding dither. There would be no need for it, but it's probably not smart enough to know that. There's no dithering options either, at least not that I can find. Man, I now know just how ineffective Gold Wave would've been for this conversion, for once I'm glad I'm not using it for something.
Go to the top of the page
+Quote Post
db1989
post Aug 9 2013, 16:59
Post #18





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Lucky escape! wink.gif
Go to the top of the page
+Quote Post
Makaki
post Aug 9 2013, 18:11
Post #19





Group: Members
Posts: 59
Joined: 20-May 13
Member No.: 108227



FYI when a program is invoked by a for loop, it is invoked again (individually) for each file. It is the equivalent of running the command on each file, one by one. And that should detect the files bit rate and sample rate

AFAIK, before a recent update. FLAC.exe didn't support wildcards on windows, and the for loop was the recommended way of working with multiple files in a folder:
https://xiph.org/flac/faq.html#tools__wildcards_on_windows
Go to the top of the page
+Quote Post
db1989
post Aug 9 2013, 18:18
Post #20





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



I indicated above that either method will preserve parameters on a per-file basis. And if flac.exe does now support wildcards, that method too will read the parameters from each individual file. Doing anything else would be ridiculous.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th July 2014 - 14:11