HydrogenAudio

Lossless Audio Compression => Lossless / Other Codecs => Topic started by: goldenear on 2004-07-06 15:18:47

Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-06 15:18:47
This guide is outdated
I have to rewrite it partially... until then, please READ THIS (http://www.hydrogenaudio.org/forums/index.php?act=ST&f=19&t=23617&st=50#entry232566)

---------------------------------------------------------------------------------------------------

Like many people here, I want to backup my CD collection so that I will be able to burn a copy of one of my audio CD in case of lost or degradation. If you have enough diskspace on your harddrives, you'll also be able to listen your whole music collection without using your original CDs. 
As many people are asking questions about how to do this in the most simple way, I decided to write here this howto and I hope it will be helpfull. 

The aim of the game is to produce a single backup file for each CD. This file must be an exact copy of the original audio CD (with tracks/cue points, ISRC,  cdtext or ISO/Data track if needed) and it must be directly playable on a computer (as easily as you play an audio CD). It will include all the tags (artist, title, genre, date, ...) needed for each track of the CD, so these informations can be displayed when the file is played or can be used when the file is "splitted" and encoded to multiple ogg/mp3/aac/... . The backup file should also be able to "embed" some usefull files like lyrics or .jpg files of the cover and/or the art/booklet.
All that is possible and it's named "Matroska (http://www.matroska.org)"! 

Here is how to do it in Windows:

This methode may not be the best, but it is the most simple I found. I use it and it works very well.

1) You have to get some tools:
- Matroska -> the Matroska Pack Full (http://packs.matroska.org)
- Tools for making Matroska files -> mkvtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/index.html#dlinst_win32)
- a lossless encoder -> Flac (http://flac.sourceforge.net/download.html)
- a good audio CD ripper -> EAC (http://www.exactaudiocopy.de/)
- a powerfull player/tagger -> Foobar2000 Special (http://www.foobar2000.org/download.html)

Download an install this tools. Be carefull to always download the full version (note the lite one).

2) Configure eac :
- after installing EAC you have to configure it for your CD drive (very important)
- don't forget to check the boxes "Retrieve UPC/ISRC codes in CUE sheet generation" and "Use CD-Text information in CUE sheet generation" in the "EAC/EAC options/tools tab" menu (F9)
- in the "EAC/compression options" menu (F11), go to the "external compression" tab
- check the "Use external program compression" box
- select "User defined encoder"
- set "Use file extension" to .flac
- set your flac.exe path
- set the "Additional command line options" to :
  --best -V %s -T Artist="%a" -T Album="%g" -T Date="%Y" -T Genre="%m"
- bitrate / quality parmeters had no effects
- uncheck all the other checkboxes exept (unless you really need it) " Delete WAV after compression"

Now EAC should be configured and ready for ripping. If you need more help on EAC configuration, you should find some good topics about that on the HA forums.

3) Rip your audio CD

With EAC:
- Put your audio CD in the extracting CD drive
- Get CD information on remote freedb (Alt+G)
- Verify that all the tags (titles/artist(s)/date/genre) are correct (fix them if necessary)
- go to "Action/Copy Image & Create CUE Sheet/Compressed
- select the emplacement where you want to save your .flac and .cue files (for me it's c:\riptmp\)
- give a good file name to the .flac file (album_artist - album_title.flac) and launch the rip! 

After some time, you should have two file in the selected emplacement:
c:\tmprip\album_artist - album_title.flac.flac
c:\tmprip\album_artist - album_title.fllac.cue

You can notice the .flac.flac extension; this is a bug (.flac.cue is normal). just rename the file so that you have:
c:\tmprip\album_artist - album_title.flac
c:\tmprip\album_artist - album_title.fllac.cue

4) Prepare the "embeded" documents (optional but recommended)

--- recommended ---
- scan the cover of the CD (scan at 300 dpi is nice for printing) and save it as:
c:\tmprip\cover.jpg

if your audio CD contain a data track (CD extra) just save it as:
c:\tmprip\track#.iso

--- optional ---

you can add anything you find usefull:
.jpg files of the art/booklet/back
.html (recommended) or plain text files of the lyrics
text files for notice, comments, etc ...

5) Merge everything into a single file

In the mkvtoonix directory (previously installed) launch mmg.exe

- "Input" tab :
  - "Input file" add c:\tmprip\album_artist - album_title.flac

- "Attachements" tab :
  - "Attachements" add c:\tmprip\album_artist - album_title.flac.cue
  - set "MIME type:" to text/plain
  --- recommended ---
  - "Attachements" add c:\tmprip\cover.jpg
  - "Attachements" add c:\tmprip\track#.iso
  --- optional ---
  - "Attachements" add c:\tmprip\lyrics.html
  - "Attachements" add what you find usefull ... (book01.jpg/book02.jpg/back.jpg/...)
  --- ! don't forget to set the correct MIME type each time you add a file ! ---

- "Global" tab:
  - "Chapters" : set "Chapter file" to c:\tmprip\album_artist - album_title.flac.cue

- set "Output filename" to d:\backup\album_artist - album_title.mka (d:\backup\ is for me, choose what you want  extension .mkv is for audio/video .mka for audio only)

"Start muxing" !!!

After some time you should have a new file:
d:\backup\album_artist - album_title.mka

This is your audio CD backup file... Everything into a single file! That what we want. 

Unfortunatly, the tags (artist/title/genre/date/etc ...) for each track is not retrieved from the cuesheet so we have to use an other tool to fix this...

6) Add the tags
We can now test the .mka file opening it with Foobar2000.
Normaly, it works fine... all the tracks are displayed and you can skip from one to an other. But, if you right click on a track and go to its properties, you'll find that the tags are not well set. To fix this, we have to set the tags from freedb: Select all tracks, rightclick "freedb/get Tags", select the right disk in the database "preview", verify if all the informations are correct (cf section 3 - Rip), "Tag files" !!!
Now all the tags are correctly set and saved to the mka file.

You can delete all the files in "c:\tmprip\" and start over at section 3 with another CD.

If you don't want to play your .mka file in foobar, you can use Media Player Classic (http://sourceforge.net/projects/guliverkli/) that works also very well.

Another usefull tool is The Matroska Shell Extension (http://matroska.org/downloads/shellextension/index.html) wich enable you to browse your .mka files and show tags/attachements/informations.

That's all folks! 


Here is how to do it in Linux:

Sections 1 to 5 are alsmost the same as in Windows expect that you must use cdparanoia instead of EAC (and cdrdao + toc2cue to get the cuesheet) and everything have to be done on the command line (AFAIK). There may be some scripts to do all automagically... If you have any information, it's welcome 
The issue is that Foobar doesn't exist in Linux ... So to set the correct flags in the .mka file chapters, we would need some cue2xml tool.
A simple software with a nice (GTK) GUI to do all this would be great, unfortunatly I'm not skilled enough in coding to do it myself (If anybody wants to do it, I can help).


I hope all this will be usefull. Questions and comments are welcome.


-------------------------------------------------------------------------------------------------

This guide is outdated
I have to rewrite it partially... until then, please READ THIS (http://www.hydrogenaudio.org/forums/index.php?act=ST&f=19&t=23617&st=50#entry232566)
Title: Single file audio CD backup Howto
Post by: Abomination on 2004-07-07 10:52:06
Thank you! The album-in-one-FLAC file doesn't work to well for me, I'll try this and report back
Title: Single file audio CD backup Howto
Post by: ChristianHJW on 2004-07-07 14:27:33
Great Guide !  Keep up the good work ....
Title: Single file audio CD backup Howto
Post by: jasnic02 on 2004-07-07 17:43:04
goldenear -

I have a compiled perl script that will do all of what you're doing above in the windows environment after it's ripped by EAC (including downloading the cover art from the internet).  I have not 'released it to the wild' since I have to rely on fb2k for the tagging.  I am following your other thread quite closely to see of mosu can hook us up with mkvmerge and remove the dependency on fb2k.  If you would like to try it just PM me.  I would welcome some feedback!

Thanks !
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-07 18:13:58
I'm also very impatient to see mosu's work

I PM you for your script. It might be very usefull and I guess it should aslo work under linux. I hope to find soon a solution to make (retrieve from freedb) a full (with all tags) .cue file under linux.
Title: Single file audio CD backup Howto
Post by: DreamweaverN on 2004-07-08 16:15:43
I'd just like to say thanks for this great guide! But, what are the main advantages of this method over the one in the sticky? I ask because I will be doing a lossless archive soon and I want everything as if it was from the CD (which is why I'm annoyed I don't have key CD for AccurateRip, the loss of some data ) incase something ever happened to the CD. There are lots of formats to choose from and even more ways of doing things, please help .

BTW I think I've decided that a single file is the best way to go over lots of smaller files, like this guide shows.
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-08 16:53:05
Quote
I'd just like to say thanks for this great guide! But, what are the main advantages of this method over the one in the sticky?


Thanks.   

The methode in the sticky only uses a flac file... and FLAC doesn't  support tags for each track/chapter. Unlike matroska, it only gets the cue points from the CUE sheet, not the tags (or CD-text informations).

AFAIK, Matroska is the only methode to have flac + cue + cover + all the tags in a single file 
Title: Single file audio CD backup Howto
Post by: DreamweaverN on 2004-07-09 05:31:19
I just tried this method, it looks great as I can add lots of things to the file. But, every time I play the file I tested in Foobar2000 at the end of the last song it crashes. I have no idea why.

EDIT: It all plays fine in Media Player Classic though.
Title: Single file audio CD backup Howto
Post by: PoisonDan on 2004-07-09 12:32:04
That's a very useful guide, goldenear. Thank you.
Title: Single file audio CD backup Howto
Post by: Fandango on 2004-07-09 14:14:07
Great idea to make to this guide. Good work.

To me it makes more sense anyway to store a whole CD backup with all the extra stuff in a playable container rather than zipping it or keep it in a seperate folder.

I hope Matroska gets popular for doing things like CD backup. 
Title: Single file audio CD backup Howto
Post by: eric.cheminot on 2004-07-09 14:48:22
Hello,

Is there a plugin for foobar2000 that is able to display the cover attached in .mka file?

-ec
Title: Single file audio CD backup Howto
Post by: phong on 2004-07-09 15:19:40
Beautiful work goldenear.

I've been wanting to do exactly this, but it's been such a daunting task that I haven't taken it on yet.  I want to write a script to completely automate this (the only user interaction would be correcting the tags).  You'd just drop the CD in the drive, run the script and go grab some coffee.  I'd also like to make scripts to automatically split out, encode and tag tracks for my portable.  Hmmm, maybe scripts to ease editing of tags or adding cover art or meta-stuff at a later date too...

A couple questions:
1) Is CD-TEXT preserved?
2) Are hidden tracks before track 1 preserved properly?
3) Does the process reverse nicely, i.e. do we have a procedure get back a perfect copy of the CD from our matroska file?  Audio CDs with data tracks can make this process messy.

If music were sold online like this (big lossless matroska file with cover art), I could stop buying CDs.
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-09 17:26:52
Thanks for all your comments

Quote
I've been wanting to do exactly this, but it's been such a daunting task that I haven't taken it on yet.  I want to write a script to completely automate this (the only user interaction would be correcting the tags).  You'd just drop the CD in the drive, run the script and go grab some coffee.  I'd also like to make scripts to automatically split out, encode and tag tracks for my portable.  Hmmm, maybe scripts to ease editing of tags or adding cover art or meta-stuff at a later date too...


Mosu is making a new version of mkvmerge so that all the tags can be directly got from the .cue file (we soon won't need Foobar2000 anymore to set the tags)

In this occasion, I've made a commande-line encoder (usable as an external encoder in EAC).  It uses FLAC to compress the cdimage .wav file and merge the .flac file + the cue sheet to a single Matroska file with all the chapter tags set! Everything is done automaticaly, so that you can directly create a .mka file from EAC.

So, under Windows you will only need tu use EAC to make the single .mka file backup :
1 - put the CD in the drive
2 - use EAC to get the tags from freedb (and correct them if necessary)
3 - run "create crompressed CD image  with cue sheet) and go to drink a coffee!
a few minutes later, you will get a .mka file backup of your CD!

The same thing will be also nice under Linux... I guess a hack (or new version) of Grip would be a nice tool to do it.

The split the .mka file to several lossy encoded files, you can use Foobar2000 (and it's wonderfull diskwriter). It's works very well and will set all the tags for each individual file. But a comand-line tool to do it would be nice to do some batch convertion... only one line to type to reencode all your CD collection during the night... 

Quote
A couple questions:
1) Is CD-TEXT preserved?
2) Are hidden tracks before track 1 preserved properly?
3) Does the process reverse nicely, i.e. do we have a procedure get back a perfect copy of the CD from our matroska file?  Audio CDs with data tracks can make this process messy.


1) Yes, AFAIF CD-TEXT informations are storred in the CUE sheet, and the CUE sheet is "attached" to the .mka file, so you'll be able to "detache" it when you need it!

2) I guess, but I'm not sure. IMHO, if all the audio data (including the hiddens tracks) are in the extracted wav/flac file (with EAC) and the hidden tracks are well positionned in the CUE sheet, it should work.

3) yep, it's very simple... simply use the mkvextract command :
mkvextract tracks  1:filename.flac

For audio CD with data tracks, I guess it depends on the cd burner software to do it properly. But if you have the wav/flac image file + the .cue + the .iso of the data track, it should not be a problem. 
Title: Single file audio CD backup Howto
Post by: taemun on 2004-07-11 08:15:06
Quote
In this occasion, I've made a commande-line encoder (usable as an external encoder in EAC).  It uses FLAC to compress the cdimage .wav file and merge the .flac file + the cue sheet to a single Matroska file with all the chapter tags set! Everything is done automaticaly, so that you can directly create a .mka file from EAC.

So, under Windows you will only need tu use EAC to make the single .mka file backup :
1 - put the CD in the drive
2 - use EAC to get the tags from freedb (and correct them if necessary)
3 - run "create crompressed CD image  with cue sheet) and go to drink a coffee!
a few minutes later, you will get a .mka file backup of your CD!
<sic>

Hrmm
Is a public beta available? (I had thought about hacking up some kind of program for doing this, but there already is one )

And (sorry about being a tad of topic): is there a workaround in EAC, for the problem where the 'Copy Image & Create Cuesheet' function (Alt-F7), always has the default filename "CDImage.wav"....having this constructed from FreeDB data would be much more useful for batch backups. (like m:\audio\%a\%g.mka, or something). Considering that you are using an external program, perhaps the renaming could be done externally (ie let EAC save the file as CDImage.wav, and the mka's filename would be constructed in the manner which has been laid out in a config file somewhere).

This is one of the more interesting areas of development
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-12 03:12:02
My EAC to mka backup tool will be available in the next 24 hours
It yet can do all what you want (automaticaly renaming files from "CDimage" to "album_artist - album_title").

I'll give here to link to dowload it when last small bugs are fixed... The first public release will be here soon, stay tuned !
Title: Single file audio CD backup Howto
Post by: dewey1973 on 2004-07-12 04:55:47
Quote
if your audio CD contain a data track (CD extra) just save it as:
c:\tmprip\track#.iso


Can you go into more detail on this?  What tools do you need?  I've just been saving the files to a "data" folder, the above sounds like it would be much easier to recreate the CD.
Title: Single file audio CD backup Howto
Post by: taemun on 2004-07-12 11:47:06
Quote
Quote
if your audio CD contain a data track (CD extra) just save it as:
c:\tmprip\track#.iso


Can you go into more detail on this?  What tools do you need?  I've just been saving the files to a "data" folder, the above sounds like it would be much easier to recreate the CD.


I would suggest using ISOBuster. It works well 
Only problem: they actually want you to pay for it (30 day "pro" trial, and i think unlimited usage in "free" mode, which has less buttons to press ).

The free version would probably work sufficiently anyways.

ISOBuster (http://www.smart-projects.net/isobuster/)
Direct Download of ISOBuster v1.6, with all languages (http://www.isobusterdownload.org/isobuster_all_lang.zip)
Title: Single file audio CD backup Howto
Post by: robUx4 on 2004-07-12 12:33:16
I hope we'll have enough time/resource to add support for such files in the 4 most popular players : Windows Media Player, Winamp, RealPlayer, Quicktime.
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-12 19:50:44
Quote
I hope we'll have enough time/resource to add support for such files in the 4 most popular players : Windows Media Player, Winamp, RealPlayer, Quicktime.
[a href="index.php?act=findpost&pid=225196"][{POST_SNAPBACK}][/a]


I'd like it! 
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-12 20:15:54
Now it's time to make things more simple! 

1) Install & configure EAC

2) Install FLAC

3) Download the updated version of mkvtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/win32/pre/mkvtoolnix-0.9.2-build20040710-1.rar) and unpack/install it. (It's very important to use this version because it handles the tags)

4) Download my new backup tool: mbackup (http://www.pepper-prod.com/mbackup.exe) (copy it in your mkvtoolnix directory)

5) Configure external encoder in EAC:
      -> Use file extension ".mka"
      -> Program: Path to mbackup.exe
      -> Additional command line options : "-i %s -s "%o" -a "%a" -t "%g" -y "%Y" -g "%m" -m -f"

6) In EAC, put a CD in the ripper drive, tag it with freedb. (don't forget to verify the tags)

7) Run "Action/Copy Image & Create CUE Sheet/Compressed"

8) Go and drink something

9) You get a wonderfull .mka file of your CD 

10) You can play it in Foobar2000, you will notice that all the flags are set for each chapter!  You can even save separated tracks to a lossy format such as ogg vorbis.

So isn't life beautifull? 

Bug report, comments or questions are welcome!

have fun!
Title: Single file audio CD backup Howto
Post by: einniow on 2004-07-14 11:46:50
firstly, thanks goldenear for writing this howto !

but your update caused by the support of tags makes me wonder how to use this under linux. what are the steps equivalent to the use of your "mbackup.exe" ?
if i use mkvmerge with one single album flac file, and chapters resulting from the .cue file, playing it with vlc (VideoLan) doesn't read chapters...

So, what would you use to tag a .mka made from a single .flac file ? :°)
- global tags ?
- track tag ?
- chapters title from the .cue ?

these parts are still unclear to me...
Title: Single file audio CD backup Howto
Post by: tiki4 on 2004-07-14 12:25:57
@goldenear:

First, I tried your nice little proggie and it works like a charm, but:

A word of warning:
Any MKA file containing FLAC audio muxed with mkvmerge > 0.8.6 will make foobar2000 crash during replaygaining or when the end of the file is reached during playback. The only solution for the moment is to mux the files with mkvmerge 0.8.6. Other players are not affected by this problem.

For more information look e.g. here (http://www.hydrogenaudio.org/forums/index.php?showtopic=22426&hl=matroska,and,flac).

Regards,

tiki4
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-14 12:52:43
I guess we need an updated version of foo_mka ...
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-14 13:28:02
Quote
firstly, thanks goldenear for writing this howto !

but your update caused by the support of tags makes me wonder how to use this under linux. what are the steps equivalent to the use of your "mbackup.exe" ?
if i use mkvmerge with one single album flac file, and chapters resulting from the .cue file, playing it with vlc (VideoLan) doesn't read chapters...

So, what would you use to tag a .mka made from a single .flac file ? :°)
- global tags ?
- track tag ?
- chapters title from the .cue ?

these parts are still unclear to me...
[a href="index.php?act=findpost&pid=225852"][{POST_SNAPBACK}][/a]


Here is how mbackup works :
1 - it gets the date, genre and comment from the command line (parameters -y -g -c) and also albumartist and albumtile (-a -t) used only for naming the files, not to tag.

2 - it regenerates (with -m) a new cue sheet from the one generated by EAC adding missing flags to it (REM DATE 1999 or REM GENRE Jazz)

3 - it encodes the wav file generated by EAC using FLAC. The generated flac file is not tagged at all, all the tags are only in the cue file

4 - it merges the .cue and .flac file to a . mka file. The .mka file will be chaptered and
each chapter tagged from the .cue file during merging

I will make an help file explaining all the command line parameters. I should be ready with the upcoming new release of mbackup.

To do all this under Linux, I guess we'll need a new tool (or a modified grip version).
Right now you can rip with CD paranoia, generate a .cue file with cdrdao+cuetools and then merge with mkvmerge. You can eazily make a shell script to do all that automatically ... the issue is that the tags from CDDB can't be checked during the automatic operation; that's why I think that going from grip would be more easy (grip would replace EAC). I should work on the Linux part soon and I guess that at the end, CD backup will be easier under Linux: I want to create a software to do all the operation (CD ripping, freedb tagging, cue file generation, cover scaning, data track extracted to .iso if needed, and meging all this stuffs to a wonderful .mka file). I just need to find time... and may be help cause I'm not a very skilled programmer. 
Title: Single file audio CD backup Howto
Post by: phong on 2004-07-14 15:28:28
Quote
the issue is that the tags from CDDB can't be checked during the automatic operation; that's why I think that going from grip would be more easy

The freedb library I've been using in my ripping scripts is excellent.  You can find it here (http://cddb-py.sourceforge.net/).  I think the most unixy way to handle correcting the tags would be to dump them to a text file and fire up $EDITOR.
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-15 23:48:40
mbackup no longuer exists... it's now called mka encoder and has more options!

go here (http://www.hydrogenaudio.org/forums/index.php?showtopic=23617) for more informations.
Title: Single file audio CD backup Howto
Post by: ®om on 2004-07-16 23:30:30
Hi,

Very sorry for my english, I think there are many mistakes in this post...

I aldready made flac muxed in mka, but not with cuesheet, because the precision is only 1/100s (or 1/1000)...
A sample is 1/44100s, so less than cue precision...
When you extract all tracks separately, the number of sample of each track is exactly like the original CD, but when you extract all in one, with cue, it doesn't...

So, we have to use xml chapters (precision 10^-9), rounding correctly the timestamp...
(else, why make a lossless, if timestamp are not correct!?)

We have to extract separated tracks, get timestamps (I made a little program in java to generate xml from an m3u playlist), and indicate to mkvtoolnix the xml file to chapter...

But Foobar2000 (0.82 special) has some problems with FLAC muxed in mka...
read here: http://www.hydrogenaudio.org/forums/index....howtopic=22426& (http://www.hydrogenaudio.org/forums/index.php?showtopic=22426&)

To answer some questions, it's possible to apply tags per tracks (definated by chapters) and replaygain, etc...
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-17 00:40:55
Quote
Hi,

Very sorry for my english, I think there are many mistakes in this post...

I aldready made flac muxed in mka, but not with cuesheet, because the precision is only 1/100s (or 1/1000)...
A sample is 1/44100s, so less than cue precision...
When you extract all tracks separately, the number of sample of each track is exactly like the original CD, but when you extract all in one, with cue, it doesn't...

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


I don't understand what you mean...
An audio CD image is a wav file (for the audio data) and a cue file for the tracks, indexes and pre gaps information. With these two files you can make an exact copy of the original CD (if the ripping had been made correctly (offset)).

To make a mka file you first encode the wav file with a lossless codec (unless you want to keep audio in the wav form and waste some space...) . the lossless file can be uncompress back to wav and so will give you the same wav data than before compression.
This compressed audio file (audio data of the whole CD) will then be muxed to a mka file. the chapters and chapter tags will be created from the cue sheet and the cuesheet itself will be added to the mka file as an attachment.

So if you need to reburn a copy of your orignal CD you have just to use mkvextract to get back your compressed audio file and the corresponding cue file. so if you decode your compressed audio file to wav you will have a wav file identical to the extraded one and the original cue sheet: you can then burn your exact copy of your original CD. I don't know why you care about 1/44100s precision? ;-)

So mka is really a good way to make single file backup of an audio CD as it permits you to reburn an exact copy if you need it.

To correctly generate the chatper tags from the cue/chapters file, you have to use the latest version of mkvmerge.
My new mkaenc tool also make the things easier if you want to directly rip to CD to mka from EAC, try it :-D

About Flac issue with replay gain, I don't know why it doesn't work properly... I guess something has to be fixed. As I use the mka file for backup only, I don't use replain gain on them. For my listening library I use flac to encode each chapter of a mka album to multiple lossy (ogg vorbis) encoded files. So I can replaygain these ogg files... :-)
Title: Single file audio CD backup Howto
Post by: ChristianHJW on 2004-07-17 12:05:48
Quote
I aldready made flac muxed in mka, but not with cuesheet, because the precision is only 1/100s (or 1/1000)...
A sample is 1/44100s, so less than cue precision...
When you extract all tracks separately, the number of sample of each track is exactly like the original CD, but when you extract all in one, with cue, it doesn't...


Thanks for this precious input. We understand the problem with sample precision in MKA, and hopefully Mosu will have the time to look into this sooner or later.

However, there is one thing to add :

While the max. precision of the WAV source file is indeed 1/44100 s, this is not correct after the compression ( even lossless ), as ANY kind of compression will always put a number of samples into a single block. For MP3 this is typically 1152 samples in one block, so you best time resolution for a 44100 KHz samples file is 1152/44100 s .

I dont know about FLAC or Wavpack, but i am pretty sure they will also pack a similar number of samples into a single block. For Vorbis IIRC the number can even vary, being the main reason why there is no proper way to handle Vorbis in WAV/AVI/RIFF. Hope this helped a bit ....
Title: Single file audio CD backup Howto
Post by: jcoalson on 2004-07-17 15:38:21
But the cue position does not have to point to the start of a block, does it?

FLAC's internal cue representation uses sample numbers, converting to and from hh:mm:ss.ff when needed.  when you seek to a cue point, it decodes from the containing block and then discards any samples up to the cue point.

Josh
Title: Single file audio CD backup Howto
Post by: kjoonlee on 2004-07-17 16:17:02
Quote
Quote
I aldready made flac muxed in mka, but not with cuesheet, because the precision is only 1/100s (or 1/1000)...
A sample is 1/44100s, so less than cue precision...
When you extract all tracks separately, the number of sample of each track is exactly like the original CD, but when you extract all in one, with cue, it doesn't...


Thanks for this precious input. We understand the problem with sample precision in MKA, and hopefully Mosu will have the time to look into this sooner or later.[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=226703")

I think Mosu would also be interested in this topic: [a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=23617]http://www.hydrogenaudio.org/forums/index....showtopic=23617[/url]
Title: Single file audio CD backup Howto
Post by: taemun on 2004-07-17 16:37:15
I think that I remember someone else making a perl script for eac -> mka....if I remember correctly, it included automated cd cover downloading....perhaps this could be included
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-17 18:22:21
Quote
I think that I remember someone else making a perl script for eac -> mka....if I remember correctly, it included automated cd cover downloading....perhaps this could be included
[a href="index.php?act=findpost&pid=226754"][{POST_SNAPBACK}][/a]


The author of the script contacts me a few years ago. He's now in vacation and he will be back soon. It may be interresting to use his automatic cover download routine to create a new tool do directly downaload and add the corresponding cover to an existing mka file. That's one of the reasons why I have included the possibility to run a script at the end of mkaenc  Nevertheless I think that scanning yourself to cover of your CD is a better way to go since I don't think you can easily find high enough resolution of the cover on the internet; indeed, if you want to print it 300dpi is not too much.
Title: Single file audio CD backup Howto
Post by: taemun on 2004-07-17 18:35:56
Yeah I wasn't thinking as much for printing as for mere identification
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-17 19:08:04
I my mind, if you make a backup copy of a CD means that you want to be able to reburn an exact copy of it... in this case, being able to print the original cover isn't too much! ;-) Idealy you should also scan the back and the booklet of your CD... but the cover is a minimum. :-)
Title: Single file audio CD backup Howto
Post by: robUx4 on 2004-07-17 22:19:24
IIRC the position of the track/index points on a CD cannot be on any sample but with a multiple of X (that I don't remember). So when you want to make audio CD copies you should use the same frame length. So the cue points can be on the same block start (otherwise you need to decode the file to edit it).

For sample precision inside of Matroska, this has been discussed many times and we can achieve it already...
Title: Single file audio CD backup Howto
Post by: jcoalson on 2004-07-17 22:53:28
Quote
IIRC the position of the track/index points on a CD cannot be on any sample but with a multiple of X (that I don't remember). So when you want to make audio CD copies you should use the same frame length. So the cue points can be on the same block start (otherwise you need to decode the file to edit it).[a href="index.php?act=findpost&pid=226828"][{POST_SNAPBACK}][/a]

for CDs, yes, it has to be on a frame boundary, 1/75th of a second, or 588 samples.  in cue sheets the ff of mm:ss.ff is the frame number (0-74).

Josh
Title: Single file audio CD backup Howto
Post by: jasnic02 on 2004-07-18 16:35:34
Quote
I think that I remember someone else making a perl script for eac -> mka....if I remember correctly, it included automated cd cover downloading....perhaps this could be included
[a href="index.php?act=findpost&pid=226754"][{POST_SNAPBACK}][/a]


(sorry this is a bit long!)

Yeah, that was me.  The script I've written is geared more toward batch mode, as opposed to goldenear's script.  It's also probably not nearly as stable!  I use EAC to do a batch of cd's to WAV/CUE then kick off my script to process them all to flac/jpg/log/cue.  I tend to do the flac/jpg/log/cue -> mka process in a second step since I want to make sure the album cover that gets downloaded is the right one before I mux into the .mka file.  The success rate for that is about 85% on non-Various Artists cds.  I download those manually.

With mosu's changes to mkvmerge it makes it much easier to tag those .mka files!  However, I haven't started using .mka yet since playback is still crashing after the last track.  Also, I don't believe there is a way yet for fb2k to reach into the .mka file to retrieve and display the .jpg (or for that matter, the EAC log file)?  Is that still true?

Also, regarding metadata .. I am struggling with the usefulness of the attached cue sheet since any metadata information changed with fb2k will update the .mka tags, not the attached cue sheet.  So, an extracted cue sheet may not be up-to-date.  Has anyone thought of how to handle this?  Or am I the only one losing sleep over it? 

I was thinking of importing the cue sheet into the flac file (which, with metaflac, strips the metadata), then discarding the cue sheet after building the properly tagged .mka file.  I use fb2k for everything and since it handles all of this seamlessly I don't really need to worry about it.  All this only becomes a problem when I start doing things outside of fb2k!

I am away for a few more weeks but when I get back I will update my script with the newest mkvmerge and post it up if anyone is interested.
Title: Single file audio CD backup Howto
Post by: robUx4 on 2004-07-19 10:07:48
All the CUE data are converted into native Matroska features (chapters and tags) so fb2k will modify those. IMO an attached CUE sheet has no use. You can drop it (unless you want to keep the CD ID, maybe).
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-19 10:28:27
The question to drop the cue file is if it's possible to retrieve all the cue sheet informations (incuding pre-gaps) from the matroaka file. I mean if a cue file can be regenrated from the mka file so an attached cue file will become useless... but I guess this is not possible for the moment, so we have to keep the attached cue sheet until regenerating an identical cue file from mka is possible. :-)

I just spoak to mosu. Matroska will soon keep all the cue sheet information. It will manage pregap in the way that INDEX 00 will become a hidden subchapter in the mka file. So it will effectively be possible to recreate the original cue sheet from the mka file. Then, we can drop the attached cuefile and we won't have to matter about keeping it in sync
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-21 22:57:51
Quote
@goldenear:

First, I tried your nice little proggie and it works like a charm, but:

A word of warning:
Any MKA file containing FLAC audio muxed with mkvmerge > 0.8.6 will make foobar2000 crash during replaygaining or when the end of the file is reached during playback. The only solution for the moment is to mux the files with mkvmerge 0.8.6. Other players are not affected by this problem.

For more information look e.g. here (http://www.hydrogenaudio.org/forums/index.php?showtopic=22426&hl=matroska,and,flac).

Regards,

tiki4
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=225859")


foo_matroska has been updated. You can download release 0.6.0 [a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=24096]HERE !!![/url]

You should not have problems anymore with replaygain or playing the last track
Title: Single file audio CD backup Howto
Post by: tiki4 on 2004-07-22 09:01:26
Finally! Now we can restart from scratch. I had given up hope on an updated foo_matroska already.

tiki4
Title: Single file audio CD backup Howto
Post by: DreamweaverN on 2004-07-22 09:46:10
A quick question. What happens to the ReplayGain data? Does Foobar2000 store it in a database? Or does it add the information to the file?
Title: Single file audio CD backup Howto
Post by: ®om on 2004-07-22 10:02:23
It add replaygain as a matroska tag

The problem of crash is resolved, but there's always the bug of number of samples of the last track

And when you look the number of samples of any tracks, when you transcode it in flac file (in flac contenair), the number of sample is decreased by 1... (only for chapters timestamp rounded)
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-22 16:05:02
Quote
A quick question. What happens to the ReplayGain data? Does Foobar2000 store it in a database? Or does it add the information to the file?
[a href="index.php?act=findpost&pid=228036"][{POST_SNAPBACK}][/a]


The replaygain information is stored directly in the mka file :-)
Title: Single file audio CD backup Howto
Post by: DrDoogie on 2004-07-23 13:07:29
Quote
I just spoak to mosu. Matroska will soon keep all the cue sheet information. It will manage pregap in the way that INDEX 00 will become a hidden subchapter in the mka file. So it will effectively be possible to recreate the original cue sheet from the mka file. Then, we can drop the attached cuefile and we won't have to matter about keeping it in sync


Ex-cell-ent. My thanks to the matroska developers, your work is greatly appreciated.
Title: Single file audio CD backup Howto
Post by: Revision17 on 2004-07-24 00:00:07
I have a 4 cd set, and I'd like to have only one copy of the cover art and the booklet that came with it (all the scans together are about 30MB).  I was thinking that just having one mka file would be the best way to accomplish this.

I was thinking of instead of using the new eac command line mka outputter, to just rip to cue/flac on all the cds, combine the flacs, and adjust the times in the cue files (and merge the cues).  And then just mux all that together.  However, it won't have accurate timings for beyond the first disc.  Is there an easy way to adjust the timings in the cues, or another recommended way of doing this?
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-24 00:47:28
Quote
I have a 4 cd set, and I'd like to have only one copy of the cover art and the booklet that came with it (all the scans together are about 30MB).  I was thinking that just having one mka file would be the best way to accomplish this.

I was thinking of instead of using the new eac command line mka outputter, to just rip to cue/flac on all the cds, combine the flacs, and adjust the times in the cue files (and merge the cues).  And then just mux all that together.  However, it won't have accurate timings for beyond the first disc.  Is there an easy way to adjust the timings in the cues, or another recommended way of doing this?
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=228448")


I don't recommend you to to this as it will be as mess if you want to reburn your CDs...
In a backup purpose, a 4 CDs set should become a 4 mka files set; the cover and the booklet shoud be attached to the first mka file (disc 1), and the cover ONLY to the other mka files. If you want to play all the 4 CD together, just add the in a playlist 

If your REALLY want to go your way, I guess the most simple way to do it is to use an audio editor such as SoundForge to append the 4 wav images of yours CDs and make a cue sheet by hand as I don't know any tool to automaticaly do it ;-)
I don't even know if it works: I wonder if a cuesheet max duration is not 99 minutes 59 second and 74 frames 

First methode is really easier and safer 

And don't forget: I recommend you to wait for mkaenc 1.0.0 and mkvmerge 0.9.4 ([a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=23617&st=25]please read here[/url])
Title: Single file audio CD backup Howto
Post by: Pamel on 2004-07-24 07:42:23
You could technically do the 4 CDs into a single MKA file.  The 'proper' way to do it though would be to have an audio track for each CD, and break up songs by chapters as chapters can be applied to individual tracks instead of the whole file.  However, I am not really sure if the fb2k plugin would like this at all.
Title: Single file audio CD backup Howto
Post by: ChristianHJW on 2004-07-24 15:41:50
Quote
You could technically do the 4 CDs into a single MKA file.  The 'proper' way to do it though would be to have an audio track for each CD, and break up songs by chapters as chapters can be applied to individual tracks instead of the whole file.  However, I am not really sure if the fb2k plugin would like this at all.


I fully agree with Pamel here, the proper way to get a 4 CD album into a single MKA file would be to create 4 separate audio tracks in the MKA file ( similar to the video files with separate tracks for each language ).

Only the fb2k plugin must be updated, so that it will allow to select the right audio track.
Title: Single file audio CD backup Howto
Post by: Revision17 on 2004-07-25 02:44:58
Quote
Quote
You could technically do the 4 CDs into a single MKA file.  The 'proper' way to do it though would be to have an audio track for each CD, and break up songs by chapters as chapters can be applied to individual tracks instead of the whole file.  However, I am not really sure if the fb2k plugin would like this at all.


I fully agree with Pamel here, the proper way to get a 4 CD album into a single MKA file would be to create 4 separate audio tracks in the MKA file ( similar to the video files with separate tracks for each language ).

Only the fb2k plugin must be updated, so that it will allow to select the right audio track.
[a href="index.php?act=findpost&pid=228599"][{POST_SNAPBACK}][/a]


Ignoring it not working with the fb2k plugin (yet), how would I tie different chapter xml files to different tracks in mkvmerge gui?  Would this be through timecodes (but that looks for text files, not not xml files, so I assume that's for something different).
Title: Single file audio CD backup Howto
Post by: goldenear on 2004-07-29 23:23:38
Quote
You could technically do the 4 CDs into a single MKA file.  The 'proper' way to do it though would be to have an audio track for each CD, and break up songs by chapters as chapters can be applied to individual tracks instead of the whole file.  However, I am not really sure if the fb2k plugin would like this at all.
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=228519")


I don't agree with you: to have 4 tracks would mean that the mka file will have a 4 time superior bitrate. 4 Tracks is only useful if you want to play this track in parellel and easily switch from one to an other and that's not what we want here:

4 tracks :

Track 1: |----disc1/song1----|----disc1/song2----|----...
Track 2: |----disc2/song1----|----disc2/song2----|----...
Track 3: |----disc3/song1----|----disc3/song2----|----...
Track 4: |----disc4/song1----|----disc4/song2----|----...

and we want :

Track: ||----disc1/song1----|----disc1/song2----|...||----disc2/song1----|----disc2/song2----|...||----disc3/song1----|----...

So to do it, we have to happend the audio files of the 4 discs to get a big audio file.
This big audio file will be used as an audio track is the mka file.
The mka file will have 4 "EditionEntry", one for each disc.
Each "EditionEntry" will have a "MEDIA_PART" tag according to [a href="http://www.matroska.org/technical/specs/tagging/index.html]http://www.matroska.org/technical/specs/tagging/index.html[/url]

This way we can have a whole CDs set in a single mka file 
Title: Single file audio CD backup Howto
Post by: caveman on 2004-08-11 15:14:36
I have been successful in creating the images. getting the MKA file to open in foobat as seperate tracks, but.
I acnt see the option in foobar to change the tags the way that is mentioned in the opening post. Help please, what might I be missing.

Found the answer Ta
Title: Single file audio CD backup Howto
Post by: robUx4 on 2004-08-11 15:56:02
The tag system has been cleaned recently and new softwares to support all this is coming soon.
Title: Single file audio CD backup Howto
Post by: scooley on 2006-08-08 22:42:24
OMG!!!!  I'm so irritated with this matroska file I have.    I've managed to extract the attachments but that's it.  I'm going to post a small example of the output of mkvinfo, and ask for some help with the commands to extract the files:

Code: [Select]
|+ Chapters
| + EditionEntry
|  + EditionFlagHidden: 0
|  + EditionFlagDefault: 0
|  + EditionUID: 3626658787
|  + ChapterAtom
|   + ChapterUID: 404548193
|   + ChapterTimeStart: 00:00:00.000000000
|   + ChapterFlagHidden: 0
|   + ChapterFlagEnabled: 1
|   + ChapterPhysicalEquiv: 20
|   + ChapterDisplay
|    + ChapterString: The Artist - Track 01
|    + ChapterLanguage: eng
|   + ChapterAtom
|    + ChapterUID: 2169528417
|    + ChapterTimeStart: 00:00:00.000000000
|    + ChapterFlagHidden: 1
|    + ChapterFlagEnabled: 1
|    + ChapterPhysicalEquiv: 10
|    + ChapterDisplay
|     + ChapterString: INDEX 01
|     + ChapterLanguage: eng
|  + ChapterAtom
|   + ChapterUID: 2477706610
|   + ChapterTimeStart: 00:00:44.800000000
|   + ChapterFlagHidden: 0
|   + ChapterFlagEnabled: 1
|   + ChapterPhysicalEquiv: 20
|   + ChapterDisplay
|    + ChapterString: The Artist - Track 02
|    + ChapterLanguage: eng


I've tried to apply the examples in the documentation to the values I get here, but apparently I'm doing it wrong somehow.  What command would I use to rip track 01?  Is there a command to rip all tracks?

By the way, it is supposedly encoded in flac, if that matters.
Title: Single file audio CD backup Howto
Post by: scooley on 2006-08-08 23:10:03
Ok, made some progress.  Don't ask about the error, it was stupid.  Here is my new situation:
Code: [Select]
mkvextract tracks  file.mka 404548193:01.flac --no-ogg
progress: 100%


so it looks like it worked, but there is no file with the name "01.flac".  In fact, no new file was created at all!  is there something wrong with my command?
Title: Single file audio CD backup Howto
Post by: Werewolf6851 on 2010-12-21 15:00:15
Quote
Quote
You could technically do the 4 CDs into a single MKA file.  The 'proper' way to do it though would be to have an audio track for each CD, and break up songs by chapters as chapters can be applied to individual tracks instead of the whole file.  However, I am not really sure if the fb2k plugin would like this at all.


I fully agree with Pamel here, the proper way to get a 4 CD album into a single MKA file would be to create 4 separate audio tracks in the MKA file ( similar to the video files with separate tracks for each language ).

Only the fb2k plugin must be updated, so that it will allow to select the right audio track.
[a href="index.php?act=findpost&pid=228599"][{POST_SNAPBACK}][/a]


Ignoring it not working with the fb2k plugin (yet), how would I tie different chapter xml files to different tracks in mkvmerge gui?  Would this be through timecodes (but that looks for text files, not not xml files, so I assume that's for something different).


Interested in this my self, adding 2 flac cd images, worked flawlessly.  Changing between 1st or 2nd cd simple in VLC, via audio -> audio track
but using global tab in mkvmerge and putting one cuesheet as global chapter marker no go. 
In VLC guessing the secret lies in the Playback -> Navigation -> Segment x
Not sure how to set chapter codes for 2nd, 3rd, ... Nth audio tracks seperatly