Skip to main content

Topic: Encoding/decodin the whole directory in batch mode (Read 4370 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • crazyman
  • [*][*]
Encoding/decodin the whole directory in batch mode
Hi all,

I jumped from mp3 section into this, as I also keep lossless backups of my archive of CD´s on ext. HD, in case they may be damaged, lost or whatever.

For simplicity, I use frontend versions of Flac and Wavpack.

I have a simple question which has probably been raised in the past:

Can anyone advise how to do encoding/decoding of tracks, and not onlyof the last folder, but of the whole directory tree (f.i. Artists/Albums/tracks, so that the encoded files are created and placed in the same folders as the wav originals? Could be helpful to do the job overnight.

Many thanks for help.

Cheers,

Crzmn

  • mickywicky
  • [*][*]
Encoding/decodin the whole directory in batch mode
Reply #1
Quote
Hi all,

I jumped from mp3 section into this, as I also keep lossless backups of my archive of CD´s on ext. HD, in case they may be damaged, lost or whatever.

For simplicity, I use frontend versions of Flac and Wavpack.

I have a simple question which has probably been raised in the past:

Can anyone advise how to do encoding/decoding of tracks, and not onlyof the last folder, but of the whole directory tree (f.i. Artists/Albums/tracks, so that the encoded files are created and placed in the same folders as the wav originals? Could be helpful to do the job overnight.

Many thanks for help.

Cheers,

Crzmn
[a href="index.php?act=findpost&pid=284760"][{POST_SNAPBACK}][/a]



Shell scripting is your best friend for this. But I assume you are on Windows? You might be able to do it with a batch file, but I do not know Windows enough to advise on that.
dbPowerAmp can recursively transcode its way through directories. Now if you are doing WAV -> lossless compressed such as FLAC, this is the app for you.

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Encoding/decodin the whole directory in batch mode
Reply #2
I can think of three applications that may be of use.

Tangerine's Catwalk
"For transcoding lots of compressed files (i.e.: FLAC) to another format (i.e.: MP3)"
View history here.
Download here.

Case's Sweep
"Executes given command in all subdirectories"
Download here

Foobar
http://www.foobar2000.org/

I have used neither Catwalk or Sweep.  A lot of people on the forum use Sweep for various things. Catwalk is newer, and more specific to the task.  In the "history" link above Tangerine explains the other tools at your disposal for this. 

I use Foobar.  You could just load up all the cuesheets into Foobar and use Diskwriter to mass-transcode.  Another benefit of this method is that tags will be preserved/created.
  • Last Edit: 23 March, 2005, 04:04:11 AM by Synthetic Soul
I'm on a horse.

  • Egor
  • [*][*][*][*][*]
Encoding/decodin the whole directory in batch mode
Reply #3
I use my own script on Windows 2000:
Code: [Select]
@echo off
set encoder="C:\Program Files\flac-1.1.2-win\bin\flac.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% "%%f")

Just copy it to a new text file and name that file with .cmd extension (e.g. "flac.cmd").
Then put the file in a directory with .wav files to encode and run (double click on) it.
All .wav files in this directory and all subdirectories will be encoded with default flac parameters.

And of course don't forget to change path to your flac.exe.

I also strongly recommend you to back up your discs by creating images of whole disc with cuesheet. There might be sound in pre-track gaps, you can hear it when your player shows "-00:05". When you extract to separate tracks, gaps are appended to tracks and therefore you will never see negative time again in case you wll need to restore your discs. So, your backup is not exact copy of the original disc despite you encode to lossless.

  • mickywicky
  • [*][*]
Encoding/decodin the whole directory in batch mode
Reply #4
Egor, does that script work recursively? As mentioned above, I know little about scripting syntax on Win32 systems.

  • Egor
  • [*][*][*][*][*]
Encoding/decodin the whole directory in batch mode
Reply #5
Quote
Egor, does that script work recursively? As mentioned above, I know little about scripting syntax on Win32 systems.
[a href="index.php?act=findpost&pid=284799"][{POST_SNAPBACK}][/a]

Yes, it goes into all subdirectories recursively. Compressed files will be in the same folder as original .wav files.

You can also use this script to encode with lame.exe, you just need to change it a little:
Code: [Select]
@echo off
set encoder="C:\Program Files\lame3.96.1\lame.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% --preset extreme "%%f")


Edit: added 'recursively' for clarity.
  • Last Edit: 23 March, 2005, 08:53:40 AM by Egor

  • mickywicky
  • [*][*]
Encoding/decodin the whole directory in batch mode
Reply #6
Egor, very nice script. I'll save that one for the next time one of my colleagues asks.

  • tev777
  • [*][*][*]
Encoding/decodin the whole directory in batch mode
Reply #7
Code: [Select]
@echo off
set encoder="C:\Program Files\lame3.96.1\lame.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% --preset extreme "%%f")


As a footnote to this code, if you are using LAME you can also set the output filename to avoid having all of the files named as filename.wav.mp3.

Code: [Select]
@echo off
set encoder="C:\Program Files\lame3.96.1\lame.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% --preset extreme "%%f" "%%~nf.mp3")
--
Eric

  • crazyman
  • [*][*]
Encoding/decodin the whole directory in batch mode
Reply #8
Quote
Code: [Select]
@echo off
set encoder="C:\Program Files\lame3.96.1\lame.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% --preset extreme "%%f")


As a footnote to this code, if you are using LAME you can also set the output filename to avoid having all of the files named as filename.wav.mp3.

Code: [Select]
@echo off
set encoder="C:\Program Files\lame3.96.1\lame.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.wav) do %encoder% --preset extreme "%%f" "%%~nf.mp3")

[a href="index.php?act=findpost&pid=284860"][{POST_SNAPBACK}][/a]


Guys,

big thanks for your valuable replies and comments. I will need to get some education in ways you proposed, and that´s what I like on that.

Rgds,

Crzmn