CDRW and DVD-RW

Summary

Check out DVD+RW/+R/-R[W] for Linux -- backend DVD burner for k3b

With the latest changes, the DVD-RW and the DVD players on gubbio are both defined as SCSI emulators, in order to work with xcdroast. This was done by adding hdb=ide-scsi to Lilo. The boot process now finds both players, installing them on sr0 and sr1. Music CDs should not be mounted but just played using the CD player in KDE; data CDs should be mounted.

To be able to burn video footage to DVDs that can be played in DVD players, you could use WinXP software. PC World recommends Ahead's Nero Express data-mastering program (see Software) for writing data to DVD. MedioStream NeoDVD 4 supports the new DVD-VR format with some

Updates to my DVD player: see http://www.pioneerelectronics.com/hs/pioneer.html for explanation and patch.

Guides

Commands

For DVD files that need to be assembled into an iso image, first create a VIDEO_TS  directory in the root directory and copy all files into it (an empty AUDIO_TS is apparently optional), then issue

        mkisofs -dvd-video -udf -o dvd.iso dvd/

It takes about eight minutes for this to complete! (CPU usage is negligible).

On gubbio, which now (2005-11-04) runs Ubuntu, I ended up just using k3b, which works great (as user steen).

To mount an iso image issue

        mount -o loop -t iso9660 *.iso loop

or

        mount -o loop -t iso9660 *.img loop

or (if bighoss is mounted)

        mount -o loop -t iso9660 /mnt/bighoss/Storage/*.cdr /vm/iso/loop

To burn an iso image to CD on gubbio, issue (speed=16 may work):

        cdrecord  -v speed=8 dev=/dev/hdd -data some.iso

Or a bit more elaborate (this is what k3b uses):

cdrecord.mmap -v gracetime=2 dev=/dev/hdd speed=8 -tao driveropts=burnfree -eject -overburn -data some.iso

To burn a dvd iso image, issue

        dvdrecord -v speed=4 dev=/dev/hdd -data some.iso

Gubbio's dvdrecord was once based on an older version of Schilling's cdrecord -- not sure what's in Ubuntu.

Software

Sound

To test the sound, issue

cat flack.mp3 >/dev/dsp0

this gives me lots of noise, so I know I've hit the sound card. I made a symlink with ln -sf /dev/dsp0 /dev/dsp and tested

cat flack.mp3 >/dev/dsp

which worked fine. And indeed, now the sound works fine in gmplayer too. Note that gubbio uses oss (in MPlayer and elsewhere), while cyberspace uses arts.

Burning CDs and DVDs (cf. DVD)

Converting video to dvdauthor:

do this to mpg:
mpeg2desc -a 0 -o audio -v 0 -o video < ffmpeg.mpg
tcmplex -m d -o dvdauthor.mpg -i video -p audio

Brief instructions for DVD authoring (use qdvdauthor instead):

 /bin/rm -rf /videos/dvd/
dvddirgen -o /videos/dvd
dvdauthor -o /videos/dvd $1
dvdauthor -o /videos/dvd -T
mkisofs -dvd-video -udf -o /videos/dvd.iso /videos/dvd

Try playing this iso image to verify everything is working before burning to disk.

New feature in ffmpeg in December 2004:

Upgrade to latest ffmpeg CVS.

Use:
ffmpeg -i yourmovie.ext -target ntsc-dvd yourmovie.mpg

dvd-author should accept this directly:
dvdauthor -o dvd yourmovie.mpg
dvdauthor -o dvd -T

And burn with (f.e.) growisofs:
cd dvd
growisofs -dvd-compat -Z /dev/dvdrw -dvd-video

Guide:
http://www.bunkus.org/dvdripping4linux/en/single/index.html

cdrtools (4:2.0-2) are included in the cdrecord package, cf.
info /usr/share/doc/cdrecord/changelog.Debian.gz

Resources: http://www.exit1.org/dvdrip/links.cipp
vobcopy can be used to copy VOBs from a DVD. Decryption is done on the fly.

dvdbackup
dvdbackup -M -i/dev/dvd -o/my/dvd/backup/dir/
http://dvd.chevelless230.com/dvdbackup.html

DVD Backup Script
http://james.nontrivial.org/projdvd.htm

Command-line tools for transcode (fun stuff)
http://www.lallafa.de/bp/

AcidRip
http://sourceforge.net/projects/acidrip/

DVD Create
http://dvd-create.sourceforge.net/

DVD Author (includes the ifogen tool)
http://dvdauthor.sourceforge.net/

Note that you may be able to use mplayer to grab and convert a DVD -- but can you do it to a format you can edit? The problem at the moment is that you can only edit dv (with kino), and then mpeg2/mpeg4 with Avidemux (after indexing the vob file). So Avidemux is still the best you have -- you just haven't figured out the export functions yet.

DVD writing

Summary

The short story of DVD-R is that I downloaded a binary from Joerg Schilling's site and used it to replace the current cdrecord binary I had installed with xcdroast. I had to add a script with the user code, but it all worked perfectly on the first try. I'm using xcdroast as the user interface and this also seems to work great -- even though the writer has never tested it! The maximum capacity of the DVD-R disks is 4.7GB.

Software

Burning from the CLI
11 December 2002 update

I couldn't get the burner to work-- possibly, a plug is loose -- and decided this was a reason to just ditch SuSSE 7.3 and install Debian on gubbio, which has now been renamed gubbio. xcdroast still didn't work, so I'lll try command-line versions. Before starting, I ran cdrecord -scanbus to locate the drives:

root@gubbio:/data# dvdrecord -scanbus
dvdrtools - based on:
Cdrecord 1.11a15 (i386-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.5'
scsibus0:
0,0,0 0) 'LG ' 'DVD-ROM DRD8160B' '1.01' Removable CD-ROM
0,1,0 1) 'PIONEER ' 'DVD-RW DVR-104 ' '1.20' Removable CD-ROM

In brief, the DVD is at 0,0,0 and the DVD-R at 0,1,0. From dmesg I know that the DVD is on sr0 and the DVD-R on sr1. Next, procedure:

First read the data from the CD or DVD to be copied, if that's the task at hand:

readcd dev=0,0,0 f=cdimage

You can also try this method:

dd if=3D/dev/sr0 of=3Dcdimage

Next, make the ISO image of the resulting files:

mkisofs -r -o cdimage.iso /mnt/data/test

Next, mount it for fun:

mount -t iso9660 -o loop cdimage.iso /mnt/dummy

Finally, burn it:

cdrecord -v speed=16 dev=0,1,0 -data Libranet-CD1.iso

I got a shell script from http://jetblackz.freeservers.com/Installingcdcopy.html and saved it (with a few modificcations) to /usr/bin/cdcopy.

The brief story is that dvdrecord, the open-source fork of Schilling's cdrecord, works, while Schiling's cdrecord fails. For the moment, this means you can't use xcdroast, though you could remove cdrecord and put dvdrecord in its place. I set speed to 1 (16 failed), which adjusted to 4.

root@gubbio:/data# dvdrecord -v speed=1 dev=0,1,0 -data Libranet-CD1.iso

Copying a DVD movie

vobcopy -l

This should locate the DVD, read all the vob files, decrypt them, and write them to a single new file in the current directory. Get it at http://www.lallafa.de/bp/cpdvd.html

You could use mplayer to do the same:

mplayer -dvd title-number -dumpstream -dumpfile output.vob

This works -- just run as user root.

Other options:

cpdvd
dvd::rip (uses transcode)
tccat -i /dev/dvd -P1 > complete.vob

So this looks amazingly simple and should be tried.

Results: the last method just works! I'm getting "extracting blocks at 4.6 MB/s" and soon 5.2 MB/s, so this is churning away. A single command line that could be executed remotely! It's lighting fast -- looks to me better than realtime.

So that's the story of DVD ripping -- you don't need any additional programs. Both mplayer and transcode will do it, chapter by chapter. A simple script and transcode would rip a whole DVD.

What isn't currently working is transcoding the mpeg2 format to a dv that kino can edit. Transcode finds everything, but for some reason segfaults.

See also DVD Authoring », Chris Stoddard, http://linuxgazette.com/issue83/stoddard.html

There's also this: readcd dev=/dev/hdc -c2scan

Not clear what this is for -- a ripper? a way to copy? Can you use it to rip DVDs?

A. Making an ISO image from a DVD using xcdroast

In the end (see details of other attempts below), I just used xcdroast to create an ISO image in /vm. xcdroast gave the wrong filesize to the image before it started reading (giving a CD size instead of the full DVD size -- this may be an error that has been fixed in the latest cdrtools), but this was corrected once the reading started. The whole file is one track of 4GB.

The DVD was finally read correctly, but towards the end there were read difficulties that were resolved only on repeated attempts.

Because of these erros, I ran a Verify tracks in xcdroast -- an excellent feature, but it takes as long as a copy. In the end I got,

Verifying /vm/iso9660images/track-01.img (4202037248 bytes)
Compare of /vm/iso9660images/track-01.img successful.

Note that you can copy a DVD to an ISO image with dd:

dd if=/dev/sr0 of=dvdimage

This is worth knowing and trying -- you could control it from home! Leave it in the drive (or ask someone to put it there) and copy it. I like that. No speed or anything given.

Similarly, you can create an ISO image:

mkisofs -r -o dvdimage directory/

B. Mounting the image as a loopback device

Here's how to mount an ISO image on the /mnt/dvd directory:

mount -t iso9660 -o ro,loop=/dev/loop0 DVD-1--01.img /mnt/dvd

All right -- great news: this just works (you enabled it in the new kernel). You have to be root.

See http://www.tldp.org/HOWTO/CD-Writing-HOWTO-3.html#ss3.1


C. Burning the DVD from the ISO image

Command-line style:

cdrecord -v speed=4 dev=0,1,0 -data dvdimage

Or through xcdroast of course, which is what I plan to do. However, I noticed that the Debian DVD is marked 3.0 pre, which makes me wonder if it's not the latest version. In this case, and since you've made a verified ISO image anyway, why don't you just give Tom the original -- that way you won't have to worry whether it'll work. You can download the latest DVD image when you need it.

D. Copying from DVD to DVD directly using xcdroast

xcdroast also has the capacity to duplicate a CD (and hopefully a DVD), but since making the ISO image encountered several read errors at the end, corrected only on repeated attempts, it didn't seem a good idea to try to burn directly.

E. Not using xcdroast

What follows are attempts to follow the instructions from http://www.lugatgt.org/articles/cd_burning/ -- in the end, xcdroast seems both simpler and less likely to generate errors, as I don't know what I'm doing. Some interesting stuff below, nevertheless.

      gubbio:/home/steen # cdrecord -scanbus
Cdrecord-ProDVD-Clone 1.11b19 (i586-pc-linux-gnu) Copyright (C) 1995-2002
Jörg Schilling
Unlocked features:
Limited features:
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.6'
scsibus0:
0,0,0 0) 'LG ' 'DVD-ROM DRD8160B' '1.01' Removable CD-ROM
0,1,0 1) 'PIONEER ' 'DVD-RW DVR-104 ' '1.20' Removable CD-ROM
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *

So this is simple enough: the reader is on 0,0,0 and the writer on 0,1,0.

dmesg thinks this of the reader (mis-characterized as cd/rw):

sr0: scsi3-mmc drive: 6x/48x cd/rw xa/form2 cdda tray

And this of the writer (correctly characterized as writer):

sr1: scsi3-mmc drive: 15x/15x writer cd/rw xa/form2 cdda tray

Not terribly accurate, but good enough.

In brief:

        DVD 0,0,0 sr0
DVD-R 0,1,0 sr1

There are apparently three ways to make a copy of a DVD (or CD):

1. Directly between two drives.

cdrecord -v -dev=0,4,0 speed=12 -eject -isosize /dev/sr1

This relies on the standalone cdrecord program, and my version only allows 1GB max, so it's not useful for DVDs. See details below; I initiated a dummy write.

2. dd

"You can always use dd to make the image file copy and then burn it using cdrecord."

dd if=/dev/sr0 of=dvdimage

Something like that. Pretty straightforward -- input file and output file! And I guess it produces an image file? This could actually be attractive.

3. cat

"I prefer using cat to make image files of CDs I want to copy:

cat /dev/sr1 > /tmp/image.raw

The /tmp/image.raw file can now be burned to another disc using cdrecord." (same source)

Now, it may be that xcdroast would be the simplest -- I just wish I knew what I was doing.

F. Packet writing

Downloads http://sourceforge.net/projects/packet-cd/

Announcement: http://www.kernel.dk/packet_ann.txt

Packet writing allows CD-RW devices to be written to transparantly, i.e. without a dedicated cd recorder program. It differs from the normal track/disc/session at once methods in that

a) you don't have to master any images

b) buffer underruns cannot occur The end results is that files can be copied directly to the device, as with any other disc. This is just like the Windows programs PacketCD or DirectCD.

Packet writing is designed for DVDs and can also be done with CDs. The Linux utilities required have been in development for a long time and likely work fine, but they're not in the mainline kernel yet.

There's a patch for packet writing for the 2.4.19 kernel (you can use the 2.4.19-2 patch, or possibly later ones, from http://w1.894.telia.com/~u89404340/patches/packet/packet-2.4.19-2.patch.bz2)

I don't have instructions on how to apply this patch, or information about whether it will work with the -ac4 patch I'm also using. It's pretty clear it also provides the UDF file system required - see http://lists.suse.com/archive/packet-writing/2002-Sep/0017.html

UDF is a menu choice in the 2.4.19 kernel; it is currently not chosen (as of 11 Oct 02), nor is the "UDF write option" enabled -- it's marked dangerous, and the packet people say the CVS version of UDF in any case is faster (not necessarily more stable). However, I don't know how the CVS UDF is integrated into the kernel, or how an integrated CVS UDF would mesh with the packet-writing patch. Ben Fennema <bfennema@attbi.com> is the developer of UDF, a 1998 PhD from CalPoly in San Luis Obispo.

My best guess is that if you apply the patch above and ignore UDF CVS, you then need to select UDF and UDF write in the kernel menu. That may be all that is required. You won't get the very latest UDF, but it doesn't look like there are many changes. Peter Osterlund <petero2@telia.com> maintains
the patches to recent kernels, building on Jens Axboe's work.

CVS details:
cvs -d:pserver:anonymous@cvs.linux-udf.sourceforge.net:/cvsroot/linux-udf login
cvs -z3 -d:pserver:anonymous@cvs.linux-udf.sourceforge.net:/cvsroot/linux-udf co modulename

In brief, with some struggles, you could probably make this work, but it looks time-consuming. For the moment, this is not something worth fiddling with -- you don't particularly need packet writing, and the utility is apparently still too unstable to go into the main tree, so just wait until it does. The development is alive and kicking.

Details of burning experiments:

1. Directly between two drives.

cdrecord -v dev=0,1,0 speed=4 -eject -isosize /dev/sr0

According to cdrecord --help, the -v option is simply verbose, and -eject is eject the disk after doing the work. -isosize is use iso9660 file system size for next data track. The speed should be right.

Note these options:

-dummy do everything with laser turned off
-clone Write disk in clone write mode.
-waiti wait until input is available before opening SCSI
-prcap print drive capabilities for MMC compliant drives

I try a -dummy write:

gubbio:/home/steen # cdrecord -v dev=0,1,0 speed=4 -eject -isosize -dummy /dev/sr0

Note that you got "This version of cdrecord limits DVD-R/DVD-RW support to -dummy or 1 GB real. cdrecord: If you need full DVD-R/DVD-RW support, ask the Author for cdrecord-ProDVD." That means you can't use the command-line version of cdrecord to copy DVDs. xcdroast uses the ProDVD version -- I don't know where that is located.

Making and playing home-made DVDs under Linux (from a letter to the Transcode forum)

Create DVD images and burn them to a DVD-R(W), can be achieved with cdrecord and dvdrtools:

Copying or VOB files can be achieved with trancoder, mplayer, vobcopy, cpdvd or dvd::rip. Some of the tools main purpose is not to make DVD backups but they can still be used for that purpose. Further more some of them can me used to make a DVD-Video take up less space that the original which is nessesary when you want to fit a DVD-9 (Dual layer DVD) on one DVD-5 (Single layer):

http://www9.informatik.uni-erlangen.de/~Vogelgsang/bp/tctools.html
http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/
http://www.mplayerhq.hu/homepage/
http://lpn.rnbhq.org/projects/c/c.shtml
http://www.exit1.org/dvdrip/

Using the tools above we can copy a DVD-Video to a DVD-R(W) and play it with e.g. xine if the DVD is mounted. The problem is that vital info such as ifo files aren't copied and corrected if necessary. The VTS_XX_0.vob's aren't transferred either although they usually just hold either a still image or the first DVD menu they are still needed in order to comply with DVD-Video standards. Further more it looks libdvdread has an error since it assumes that all DVD's are "buy" ones and not home burned. Hence xine, mplayer etc fails when it's can't locate the "crypto" block on the DVD.

My home burned DVD (under windows) plays just fine in my Panasonic DVD-RP91 and also under WinDVD.

DVD-Video burning under Linux: http://dvd.chevelless230.com/

Installation history

See separate file.
 

 

top

 

Home
Dissertation
Articles
Conferences
RPC
Grain
Research

CogWeb