[Libburn] Real-time data stream
Thomas Schmitt
scdbackup at gmx.net
Tue Aug 14 00:46:33 PDT 2012
Hi,
this mailing list is about libburn-0.2 which cannot burn to DVD media.
Mario Danic and me forked libburn 6 years ago.
http://libburnia-project.org/
Meanwhile it can operate all commercially available CD, DVD, and
Blu-ray media.
> I wanna ask a basic question.
> If I can write real-time data stream to dvd with libburn.
> I've known that writing file to dvd is ok, but I don't know which
> apis could surpport real-time data.
There are media types and states which need to know the number of
bytes in advance, before a burn program can write data to them.
One of them is DVD-R DL. Another is DVD-RW after being blanked fast.
The other types can record a data stream of unpredicted length.
If you use the libburn API, then choose BURN_WRITE_TAO in order
to avoid the need for a predictable track size.
(For an example of libburn API usage, see source of program libburner
on http://api.libburnia-project.org/libburn/)
You may also use my command-line program cdrskin for this task,
by piping the output of an arbitrary program into its stdin:
my_stream_producing_program | \
cdrskin -v dev=/dev/sr0 -tao -eject -
(The final dash "-" tells cdrskin to read from stdin.)
(If you write to CD media, then add option padsize=300k, to avoid
the CD read-ahead-bug of Linux. This will give the stream a fuzzy
end. So when reading, you should truncate it to the number of
valid bytes. This number has to be memorized separately.)
Of course the stream must end before the capacity of the medium
is exhausted.
After successful burn, you should be able to read the stream from
medium by normal POSIX means (open(2), read(2)).
Or with shell means:
dd if=/dev/sr0 | my_stream_consumer_program
It might be necessary to eject and reload the medium after the
burn run and before reading. Thus option -eject with cdrskin.
Have a nice day :)
Thomas
More information about the libburn
mailing list