
# Sample commands used by cdwrite


# Testing audio CD

      cdparanoia -d /dev/cdr -Q


# Reading audio tracks

    # reading indexes

      cdda2wav -v indices -B -J -D 1,0,0

    # the entire CD

      cdparanoia -d /dev/cdr -B 1-

    # or track by track:

      cdda2wav -D /dev/cdr -x -paranoia -t 1

    # the selected tracks (for example: second, third, and fifth)

      cdparanoia -d /dev/cdr -B 2 3 5

    # or track by track:

      cdda2wav -D /dev/cdr -x -paranoia -t 2 3 5


# Writing audio tracks (using toc-file)

    cdrdao write --device /dev/cdrw --driver generic-mmc-raw --buffers 120 \
    --speed 12 toc-file

    # toc-file (without pregaps)

      TRACK AUDIO
      FILE "track01.cdda.wav" 0
      TRACK AUDIO
      FILE "track02.cdda.wav" 0

    # toc-file (with eight seconds pregap)

      TRACK AUDIO
      FILE "track01.cdda.wav" 0
      TRACK AUDIO
      PREGAP 00:08:00
      FILE "track02.cdda.wav" 0

    # shell script creating toc-file (using commented pregaps)

      #!/bin/sh
      > toc-file
      for file in *.wav
      do
      echo "     TRACK AUDIO" >> toc-file
      echo "//   PREGAP 00:08:00" >> toc-file
      echo "     FILE \"$file\" 0" >> toc-file
      done


# Copying audio CD

    cdrdao copy --device /dev/cdrw --driver generic-mmc-raw --buffers 120 --speed 12


# Encoding audio tracks

    # constant bitrate 192

      lame -b 192 -m s track01.cdda.wav

      # or

      oggenc -b 192 -m s track01.cdda.wav

    # variable bitrate --r3mix (shortcut for: -V3 --vbr-new --lowpass 18)

      lame --r3mix -m s track01.cdda.wav

      # or

      oggenc -q 6 track01.cdda.wav


# Encoding audio CD on-the-fly

      cdparanoia -d /dev/cdr -B 1 - | lame --r3mix -m s - file.mp3

      # or

      cdda2wav -D /dev/cdr -x -paranoia -t 1 - | lame --r3mix -m s - file.mp3

      # or

      cdparanoia -d /dev/cdr -B 1 - | oggenc -q 6 -o file.ogg -

      # or

      cdda2wav -D /dev/cdr -x -paranoia -t 1 - | oggenc -q 6 -o file.mp3 -


# Testing data CD

      cdrdao disk-info --device 1,0,0 /dev/cdrom generic-mmc-raw


# Reading table of contents

      cdrecord -toc dev=/dev/cdrw


# Reading last session parameters

      cdrecord -msinfo dev=/dev/cdrw


# Creating data image (image.iso, current directory)

    # first session

      # Linux compatibility

      mkisofs -R -o image.iso .

      # Windows compatibility

      mkisofs -r -J -D -o image.iso .

    # first session (follow symlinks)

      # Linux compatibility

      mkisofs -R -follow-links -o image.iso .

      # Windows compatibility

      mkisofs -r -J -D -follow-links -o image.iso .

    # next session

      # Linux compatibility

      mkisofs -R -C `cdrecord -msinfo dev=/dev/cdrw` -M 1,0,0 \
        -o image.iso .

      # Windows compatibility

      mkisofs -r -J -D -C `cdrecord -msinfo dev=/dev/cdrw` -M 1,0,0 \
        -o image.iso .

    # next session (follow symlinks)

      # Linux compatibility

      mkisofs -R -C `cdrecord -msinfo dev=/dev/cdrw` -M 1,0,0 \
        -follow-links -o image.iso .

      # Windows compatibility

      mkisofs -r -J -D -C `cdrecord -msinfo dev=/dev/cdrw` -M 1,0,0 \
        -follow-links -o image.iso .


# Writing data image (using image.iso)

    # multi session

      cdrecord -v dev=/dev/cdrw -multi speed=12 image.iso

    # closing session

      cdrecord -v dev=/dev/cdrw speed=12 image.iso


# Blanking CD-RW disc

    # fast

      cdrecord -v dev=/dev/cdrw speed=12 blank=fast

    # all

      cdrecord -v dev=/dev/cdrw speed=12 blank=all


# DVD operations

    # media info

      dvd+rw-mediainfo /dev/dvdrw

    # writing first track (current directory)

      growisofs -Z /dev/dvdrw -R -J .

    # writing next track (current directory)

      growisofs -M /dev/dvdrw -R -J .

    # writing ISO image

      growisofs -Z /dev/dvdrw=image.iso

    # erasing disc

      growisofs -Z /dev/dvdrw=/dev/zero

    # blanking disc (sequential mode)

      dvd+rw-format -blank /dev/dvdrw

    # formatting disc (restricted overwrite mode)

      dvd+rw-format -force /dev/dvdrw

    # blanking disc (fast)

      # cdrecord -v dev=/dev/cdrw speed=12 blank=fast

    # blanking disc (all)

      # cdrecord -v dev=/dev/cdrw speed=12 blank=all


# Copyright (C) 2005-2014 Cezary M. Kruk <c.kruk@bigfoot.com>

