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: converting lossless images w/ embedded cue sheets (Read 10312 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

converting lossless images w/ embedded cue sheets

i currently have my music collection backed-up w/ wavpack -hx, and i've recently been doing some transcoding to mp3 for different reasons, and it takes a while to do my whole collection, and so i was considering converting my backups to -x, or even -fx, because i think i have enough disk space, and it would speed things up in the long run.  i don't mind if it takes a while to encode (or transcode in this case) my back-up once, but having my transcoding to mp3 alittle faster would be nice.

anyways, my question is about how i should do this.  i currently have most of my albums stored in an music/artist/album directory.  my cd's by various artists, or compilation cd's are just in a music/album directory.  then in the album folders, i have the image file w/ the cue and log embedded (cdimage.wv), a redundant copy of the cue (cdimage.wv.cue), and a redundant copy of the eac log (<album>.log).  i really like my current setup, and want to maintain the structure through this process.

i'd like to do this transcoding process as smoothly as possible, and i've had some difficulties so far, as i a relatively new to foobar2000.  when i load an image (or cue) into foobar, i select all of the songs, and go to convert>run conversion, i get an individual track for each song, and each track has an embedded cue sheet, which is problematic for playback.  if i go to convert>run conversion, single file output, i get a single file that it named as one of the tracks of the cd.  it will have the embedded cue sheet, but when i load the file in fb2k, it shows a number of tracks, all titled w/ the same track title, rather than the correct titles for each track...  i'm stumped as to how to do this correctly.

also, maintaining any pregaps that may exist on my images is very important to me.  i have a couple cd's that have hidden tracks before the first track, hidden in the pregap, and i don't want to lose that.

so, is there any way i can do this as one task, overnight?

btw, my current output filename formatting is:
Code: [Select]
$if2(%artist%,'Unknown Artist')\$if2(%album%,)\$if(%tracknumber%,$num(%tracknumber%,2),$num(%_diskwriter_index%,3)) $if2(%title%,%_filename%)
and the command line i will be using will be just:
Code: [Select]
-xm - %d
or something like that.

i'd also like to learn how to adjust my output filename formatting to handle my various artist cd's the way i want it to (just music/album), while still handling my other cd's right, and i've never figured out how to do that.  thats just a side issue though...

anyways, thanks so much for your advice!
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #1
bump.  sorry, but i'd like to figure this one out.
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #2
Hi VCSkier,

As you still have the log and cuesheets externally you could do the majority of this with a batch file.  It would use WavPack to simply decode and re-encode the file, embedding the external files upon encoding.

The downside of this would be that you would lose the ARTIST, ALBUM, DATE, GENRE  APEv2 tags that you may or may not have.

I can't see how you can do this in foobar without somehow stopping foobar's embedded cuesheet support, which I don't think that you can do.  I have occassionally found it frustrating that you can't turn this normally extremely useful feature off.

I guess you need another trusted converter, that understands WavPack, will transfer tags, and doesn't understand (or attempt to process) embeded cuesheets.

How about dbPowerAmp?  I don't use it, but I believe it may do what you need.


With regard to the VA output filename formatting string: Do you have any tags to distinguish a VA album from an artist's album?  Unless you use a VA tag, or set the ARTIST to "VA" for all VA albums I don't think that there is anyway to make the distinction - not on an image file with an EAC-created cuesheet (which IIRC just uses the first track's artist as the album artist).  I may very well be wrong.  Obviously, on properly tagged track files, you could compare ARTIST to ALBUM ARTIST to make the distinction.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #3
You can disable embedded cue sheets in foobar2000 0.9 (right click > utils > edit cue sheet <-- untick checkbox here). But iirc then the cue sheet is lost which shouldn't be a problem because you said that you have a copy of every embedded cue sheet.

converting lossless images w/ embedded cue sheets

Reply #4
I believe, as you say, this simply removes the cuesheet.

There's easier ways to remove the cuesheet from multiple files (like a batch file using TAG.EXE CUESHEET= for example).

However, it may be a good idea.  You could use %_path% with a little jiggery-pokery in the Diskwriter command line to pick up the cuesheet and log on encode.  The log may be a little more difficult, but shouldn't be too much of a problem (it's just the album name with all illegal characters replaced with a space).

How many GB of files are we talking?

It may be an idea to make a copy and work on your copies...

Edit: Bugger!  Just discovered that Diskwriter won't work with TAGZ functions.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #5
(VCSKier, I will speak to you separately via PM, but I thought I'd post these here as a record for others.  I'll put them on my site when I get time as well.)

[span style=\'font-size:11pt;line-height:100%\']1. Batch file to convert WV file in situ[/span]

Drag a folder on this batch file and it will process all WV files within the folder or its subfolders.  The script uses WVUNPACK to decode the data and pipe it to WAVPACK, which creates a new file called "<name>.new.wv" in the same folder as "<name>.wv".  If a problem occurs creating "<name>.new.wv" the script terminates. The script then uses TAG to copy the tags from "<name>.wv" to "<name>.new.wv".  Finally "<name>.wv" is deleted and "<name>.new.wv" is renamed to "<name>.wv".

Code: [Select]
@ECHO OFF
CLS

REM WV-WV.BAT Written by Neil Popham, 2005 (neilpopham@bigfoot.com)

SET batchname=WV-WV.BAT
SET version=1.0.0
TITLE=%batchname%, Version %version%

REM ######################################################
REM  PLEASE EDIT THE PATH TO THE EXECUTABLES
REM =====================================================
SET pathToWavPack=WAVPACK.EXE
SET pathToWvUnpack=WVUNPACK.EXE
SET pathToTag=TAG.EXE
REM ######################################################

REM Check whether a valid file or folder has been passed
IF NOT EXIST %1 DO GOTO NoParams

REM Check whether the parameter is a single file or a folder
IF %~z1 NEQ 0 DO GOTO NoParams

REM ======================
REM  Process all WV files
REM ======================
FOR /R %1 %%G IN (*.wv) DO CALL :Process "%%G"

REM =====
REM  End
REM =====
GOTO:EOF

REM ====================================
REM  Process : Process WV file
REM          : %1 The WV file to decode
REM ====================================
:Process
ECHO Processing %1

REM Pipe decoded data from WV file to WAVPACK.EXE
%pathToWvUnpack% %1 - | %pathToWavPack% -xm - "%~dpn1.new.wv"

REM If the destination file has been successfully created...
IF EXIST "%~dpn1.new.wv" (

REM Use TAG.EXE to copy the tags from the source file to the destination file
%pathToTag% --fromfile %1 "%~dpn1.new.wv"

REM Delete source file
DEL %1

REM Rename destination file as source file
REN "%~dpn1.new.wv" "%~nx1"

REM Otherwise destination file has not been successfully created
) ELSE (

REM Error occurred
ECHO Error creating new file!
PAUSE >NUL
GOTO:Error
)
REM Return
GOTO:EOF

REM =========================================
REM  NoParams : a folder has not been passed
REM =========================================
:NoParams
ECHO To run this script please pass a folder as a parameter.
ECHO.
ECHO Press any key to exit
PAUSE >NUL

REM Exit
:Error


REM  Version History
REM  ===============
REM  2005-09-28    1.0.0    Initial version

[span style=\'font-size:11pt;line-height:100%\']2. Batch file to create new files in a new folder[/span]

Double-click this batch file and it will process all WV files in "F:\Music" and its subdirectories - copying/processing files to "E:\New" (see configuration) while maintaining full folder structures (so "F:\Music\Pixies\Doolittle\CDImage.wv" will result in  "E:\New\Music\Pixies\Doolittle\CDImage.wv").  The script pipes from the source WV to the destination WV, and copies the tags using TAG.  It then copies all ".cue" and ".log" files to their respective folders (so "F:\Music\Pixies\Doolittle\CDImage.wv.cue" will be copied to  "E:\New\Music\Pixies\Doolittle\CDImage.wv.cue" and "F:\Music\Pixies\Doolittle\Doolittle.log" will be copied to "E:\New\Music\Pixies\Doolittle\Doolittle.log").

Code: [Select]
@ECHO OFF
CLS

REM WV-WV2.BAT Written by Neil Popham, 2005 (neilpopham@bigfoot.com)

SET batchname=WV-WV2.BAT
SET version=1.0.0
TITLE=%batchname%, Version %version%

REM ######################################################
REM  PLEASE EDIT THE PATH TO THE EXECUTABLES
REM =====================================================
SET pathToWavPack=WAVPACK.EXE
SET pathToWvUnpack=WVUNPACK.EXE
SET pathToTag=TAG.EXE
REM ------------------------------------------------------
REM  PLEASE EDIT THE PATH TO THE FOLDERS
REM =====================================================
SET sourceFolder=F:\Music
SET destinationFolder=E:\New
REM ######################################################

REM ======================
REM  Process all WV files
REM ======================
FOR /R "%sourceFolder%" %%G IN (*.wv) DO CALL :Process "%%G"

REM =======================
REM  Process all CUE files
REM =======================
FOR /R "%sourceFolder%" %%G IN (*.cue) DO CALL :CopyFile "%%G"

REM =======================
REM  Process all LOG files
REM =======================
FOR /R "%sourceFolder%" %%G IN (*.log) DO CALL :CopyFile "%%G"

REM =====
REM  End
REM =====
GOTO:EOF


REM ====================================
REM  Process : Process WV file
REM          : %1 The WV file to decode
REM ====================================
:Process

REM If the destination directory doesn't exist already create it
IF NOT EXIST "%destinationFolder%%~p1" MKDIR "%destinationFolder%%~p1"

REM Pipe decoded data from WV file to WAVPACK.EXE
%pathToWvUnpack% %1 - | %pathToWavPack% -xm - "%destinationFolder%%~pnx1"

REM Use TAG.EXE to copy the tags from the APE file to the WV file
%pathToTag% --fromfile %1 "%destinationFolder%%~pnx1"

REM Return
GOTO:EOF


REM =================================================
REM  CopyFile : Copy file from source to destination
REM          : %1 The file to copy
REM =================================================
:CopyFile

REM Copy the file from source to destination, maintaining folder structure
COPY /V %1 "%destinationFolder%%~pnx1"

REM Return
GOTO:EOF


REM  Version History
REM  ===============
REM  2005-09-29    1.0.0    Initial version

NB: Please test on a test folder before doing anything with your actual archive!

Both scripts have been adapted from my script ape-wv.bat which I'm using to convert my Monkey's Audio archive on DVD to a WavPack archive on hard drive.  I am using the pipe-enabled version of MAC available on the shntool site.  Being a pedant, I am also using SED in my script to convert CDImage.ape.cue to CDImage.wv.cue (with correct file reference) before re-embedding.  My script is available upon request, or just wait until I get around to posting it on my website.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #6
Hello all

My hope in ln learning how to take a rip & encode to a single File image (flac & wavpack) was to be able to take the archived file with embedded cue and right click on it from inside a program like foobar and transcode the archive into multiple files (i.e. OGG or MP3), as well as preserving gaps & Tags.

From what I have read - and it is possible that I am confused - this is not possible.
If this is true, than multiple files without embedded cue might be a better alternative for ease and adaptability? Or is it just that I have not perfected the art of creating a friendly cue sheet?

At present, to retrieve my archive back into a multi-file format I load it into foobar, Highlight all titles and convert to multiple wave files without difficulty (other formats cause a cue error), then I encode and then tag.

Any comments that can enlighten me would be appreciated.

converting lossless images w/ embedded cue sheets

Reply #7
If you have a WavPack or FLAC image with embedded cuesheet you can pull the file into foobar and convert to track files.

This thread is about converting a collection of WavPack image files encoded with one setting (-hm) to WavPack format encoded using another setting (-xm) while retaining tags (including CUESHEET and LOGFILE tags).

If you drag your FLAC or WavPack file (with embedded cuesheet) into foobar what happens?  Do you see all tracks listed, or just one file?  It sounds like you see all tracks. 

I don't see how you could convert to track WAVEs but not other formats.  That sounds like more of a problem with your Diskwriter settings.

If your cuesheet contains meta data LIKE REM, TITLE and PERFORMER statements these should be used to tag files created (obviously this won't work with WAVE files).

To conclude: this sounds more like a Diskwriter problem than an embedded cuesheet problem.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #8
Quote
If you have a WavPack or FLAC image with embedded cuesheet you can pull the file into foobar and convert to track files.

This thread is about converting a collection of WavPack image files encoded with one setting (-hm) to WavPack format encoded using another setting (-xm) while retaining tags (including CUESHEET and LOGFILE tags).

If you drag your FLAC or WavPack file (with embedded cuesheet) into foobar what happens?  Do you see all tracks listed, or just one file?  It sounds like you see all tracks. 

I don't see how you could convert to track WAVEs but not other formats.  That sounds like more of a problem with your Diskwriter settings.

If your cuesheet contains meta data LIKE REM, TITLE and PERFORMER statements these should be used to tag files created (obviously this won't work with WAVE files).

To conclude: this sounds more like a Diskwriter problem than an embedded cuesheet problem.
[a href="index.php?act=findpost&pid=330417"][{POST_SNAPBACK}][/a]


As always you are soooo right- Works fine; Was able to encode CDimage file to multiple mp3 or ogg and respective tags present. The diskwriter should have, but didn't, named the files based on the tag. Am I missing a command?

Again, many thanks; surprising what a little nudge can accomplish.

converting lossless images w/ embedded cue sheets

Reply #9
i just tested it on a single image, and it worked great, so smooth and perfect.  i cleared enough space on my external hdd to use the second option and create copies of all the images without deleting the old ones just yet.  i'm gonna run it overnite tonite, and i will post my results tomorrow after classes.  again, thanks a million synthetic soul!

edit: typo
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #10
Quote
As always you are soooo right- Works fine; Was able to encode CDimage file to multiple mp3 or ogg and respective tags present. The diskwriter should have, but didn't, named the files based on the tag. Am I missing a command?

Good news.

I can only assume that your "Output file name formatting" string is not set properly.  On the prefences for Diskwriter (0.8.3) or Converty (0.9) you will see the "Output file name formatting" combo (it's a combo as you can pick from the dropdown, or type text).

I use the following string (with "Create subdirectories" checked in 0.8.3):

$if2(%artist%,'Unknown Artist')\[%album%\][Disc %disc%\]$if(%tracknumber%,$num(%tracknumber%,2),$num(%_diskwriter_index%,3)) - $if2(%title%,%_filename%)

This, in essence, produces an "<artist>\<album>\<track> - <title>" format (  It will revert to "Unknown Artist" if there is none, the filename if there is no track name, and use "<artist>\<album>\Disc <disc>\..." if %disc%* is present).

You may get a little more information from my web page "CD Backup > Transcoding".

Quote
Again, many thanks; surprising what a little nudge can accomplish.

So true.  If you don't ask questions you don't learn.


*
[span style='font-size:8pt;line-height:100%']Seems like %discnumber% should be used instead of %disc% now, but both will work fine.[/span]
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #11
Quote
i just tested it on a single image, and it worked great, so smooth and perfect.  i cleared enough space on my external hdd to use the second option and create copies of all the images without deleting the old ones just yet.  i'm gonna run it overnite tonite, and i will post my results tomorrow after classes.  again, thanks a million synthetic soul!

Good luck.

The key was finding the "--fromfile" switch in Tag - it makes copying the tags over a doddle.

I think the script to move (script 2) is definately the safest bet.  I've only had chance to run mine twice so far, so I have the contents of two DVDs converted and transferred to my hardrive.  I intend to test those files before I go any further, just to make sure it is working as smooth as silky the silkworm's favourite silk pyjamas.

I'm looking forward to tidying the WavPack archive up a little - correcting misspelt artist names, etc. - which I just didn't have time for when I created te initial archive.

Once that's all done I'll do a mass trancode to update my MP3s to LAME 3.97 -V5.    Then I think I'll sit back and have a cigar - Hannibal Smith styley.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #12
absolutely wonderful.  the whole process is complete.  at the last minute, i decided i wasn't going to need my laptop on classes friday, so i used -fx6m instead of just -fxm, as i had planned.  i know it didn't really make much of a difference at all, but i figured, why not.  it ended taking about 24 hours to do the whole thing, but i think that is also largely because i'm having trouble w/ my usb connections.  they are only operating as usb 1.1, instead of 2.0.

before i delete the old files, i would like to double check the new files' integrity somehow, just to make sure they all copied right.  do you know of any way to do that?

other than that, i'm just excited that i'm finally getting caught back up on keeping my music together.  i ripped the new cd's i wanted to rip, and soon i'm going to use foobar to do a mass transcode of all my lossless images to lame 3.97b1 -V4 --vbr-new, i think.  maybe -V5, i don't know, i haven't decided yet.  anyways, thanks again synthetic soul.
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #13
Quote
before i delete the old files, i would like to double check the new files' integrity somehow, just to make sure they all copied right.  do you know of any way to do that?

Well, I am deliberating this myself at the moment.

I have a batch file, ape-verify.bat, that verifies a folder of APE files or a single file.  If an error occurs while verifying MAC.EXE returns a return code other than 0 - which means my batch file can pick those up and warn me.

However, I converted this to wv-verify.bat and discovered a problem.  I corrupted a WV file by deleting some bytes in  a text editor.  WVUNPACK.EXE still returned 0 - although the mismatched MD5 was reported on screen.

I have checked the source code and seen that this is described as a "soft error", which is why 0 is still returned.  I have also seen that, if you use wildcards to process multiple files with one call, these soft errors are tallied and reported at the end.  However this wildcard processing won't recurse folders.

With that in mind, this is the best I have come up with so far:

Code: [Select]
@ECHO OFF

REM Delete the temporary file if it exists
IF EXIST "%temp%\wv-verify.txt" DEL "%temp%\wv-verify.txt"

REM Recurse through folders and store any WV file paths in the temporary file
FOR /R %1 %%G IN (*.wv) DO ECHO %%G >> "%temp%\wv-verify.txt"

REM Verify all files by passing the list of filenames to WVUNPACK
WVUNPACK -vm @"%temp%\wv-verify.txt"

REM Delete the temporary file
DEL "%temp%\wv-verify.txt"

REM Pause, to allow results to be viewed
ECHO.
PAUSE

Save the above as a .BAT file.  Drag your root folder on to run.

The script iterates through all files in the folder and its subfolders, and writes the WV filenames to a temporary file.  This file is then passed to WVUNPACK.

The benefit of this is that you will see any soft errors reported, e.g.:

**** warning: errors occurred in 1 of 3 files! ****

The problem with this is that I can't record what files caused the warning, as I could in ape-verify.  If you process many files you may not be able to scroll up to see the mismatched MD5s as the console only records a certain number of characters.

I guess try the above, and hope that you get no errors!

I have actually written an email to David, but haven't sent it.  I'll hold off for now, as maybe he'll see this and be able to give me/us some other ideas.

Edit: As an alternative I may create my own version of WVUNPACK that reports MD5 mismatches as a "hard error".  I'm hoping that David may be able to tell me how I can get the official build to do this though - or some alternative. It would be cool if WVUNPACK would report the paths of all files that caused hard or soft errors, or wrote them to a text file or something.  The code is so tidy that even I may be able to do that.  I'd rather go an "official" route though.
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #14
to quote synthetic soul, "Bugger!"

i ran the batch file on the newly created folder of newly encoded images, and it found 1 error, out of all my files...  aggravating, to say the least.  oh well, we'll see how things turn out...
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #15
   I guess that's a typically English exclamation.

Well, I agree... bugger!  That's really frustrating.

I think it may be time to email or PM David and point him to this thread.  There has got to be any easy way to highlight these files on a mass verify.

I would rather an official resolve, but there is still the option of creating a mutant WVUNPACK.EXE with a switch which will return an error code other than 0 if a mismatched MD5 occurs.  A batch file (or other application) could then pick this return code up and report the file in question.  I believe I could create this, but would rather speak to David first.

I assume you won't delete your source files until you find the file in question?
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #16
correct, i won't delete the source files, and it wont even be an inconvience.  i did quite a bit of cleaning up before i started, and so now i have plenty of space... 
a windows-free, linux user since 1/31/06.

converting lossless images w/ embedded cue sheets

Reply #17
Any ideas how can I find all Extra High & Insane APEs, transcode them to WV and then compare the data at bit-level?

converting lossless images w/ embedded cue sheets

Reply #18
Oh, I've forgot to warn all of you: Don't use fb2k's Converter's Single file output for converting files that have CUE sheets (no matter internal or external) or you'll lose all 00 indices!

converting lossless images w/ embedded cue sheets

Reply #19
Quote
Any ideas how can I find all Extra High & Insane APEs, transcode them to WV and then compare the data at bit-level?

I've no idea how to distinguish Extra High and Insane APE files automatically.  My latest release of Case's Tag will report the compression level of APE files, and so will foobar and Mr Question Man, but I don't think you can do this without a manual check.

Using the pipe-enabled version of MAC here you can easily convert from APE to WV using something like:

Code: [Select]
MAC.EXE myfile.ape - -d | WAVPACK.EXE -hm - myfile.wv

You could compare APE and WV files at bit level using foobar's bit compare - but if you want command line I would simply verify the APE before transcoding and then verify the WV after.

Quote
Oh, I've forgot to warn all of you: Don't use fb2k's Converter's Single file output for converting files that have CUE sheets (no matter internal or external) or you'll lose all 00 indices!

Hotfix uploaded
I'm on a horse.

converting lossless images w/ embedded cue sheets

Reply #20
Quote
Quote
Oh, I've forgot to warn all of you: Don't use fb2k's Converter's Single file output for converting files that have CUE sheets (no matter internal or external) or you'll lose all 00 indices!

Hotfix uploaded
[{POST_SNAPBACK}][/a]

[a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=37348&view=findpost&p=332751]For pregap garbage problem[/url], not missing indexes. That will be fixed later (needs more complex changes).
Microsoft Windows: We can't script here, this is bat country.