[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Thoughts on writing CD from stdin




Is there a way to burn data from a program to a CD without knowing in advance how much data will be written? I have solutions for DVD, don't have a good one for CD. I don't obviously see why CD burning requires the size in advance, but cdrecord and similar seem to want it.

You need to know the size in advance if:

[1] You're writing to the disc using one of the methods which writes
    the table-of-contents prior to writing the data itself - e.g.
    disc-at-once or session-at-once.

    This doesn't apply if you're writing track-at-once, which writes
    the TOC after all of the tracks are written.

[2] You want to depend on the size information in the table of contents
    itself to tell you how big the data is.

    This isn't apply if you can read through the data itself and figure
    where to stop reading.

cdrecord is perfectly capable of writing arbitrary amounts of data to a
track on a CD, in track-at-once mode.  Some amount of buffering is done
to avoid burn underruns, but with Burn-free or equivalent this could
probably be eliminated.  This method is used, for example, if you do
a command such as

	mkisofs [options here] | cdrecord -tao -pad -data -

What would be useful is [application]->[burning_software]->media without buffering.

I use a version of the Linux "dump" software which operates in this way.

[1] The data being dumped/burned is "wrapped" in a format which allows
    the "end of data" condition to be detected reliably during playback...
    in the case of "dump" the data is compressed into "gzip" format, which
    has such an end-of-data indicator.

[2] The dumping/compressing/wrapping program will stop, declare "end of
    medium is getting close", terminate the current compressed glob of data,
    and shut down / restart the burning program every 650 MB or so (user-
    adjustable).

Basically, the tricks here are:

(a) use track-at-once burning mode,
(b) use Burn-free or a similar underrun compensation technique if you can't
    consistently write as fast as the medium will burn,
(c) wrap the data in some sort of format which has a reliable "end of
    data" signalling during playback, so that you don't depend on getting
    a "no, you can't read that sector" error from the CD-ROM drive when
    you read past the end of the track [this isn't reliable!], and
(d) explicitly close the disc after burning.




Reply to: