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

Doesn't wodim close disk ?



Hello,

I use for ages a very little script to burn my DVD, and I tried one of
my DVD in OSX to discover that it wasn't readable there, but it is under
linux.

I use wodim because it can also write in udf, but I would enjoy it to
close my disk... any idea on how to modify my little script to do it ?

--- begin cut here ---
#!/bin/bash
if [ -z "$2" ]; then
	echo "usage : $0 DVD_title DVD_dir [write speed]"
	echo "That will write a DVD with video structure if there a VIDEO_TS."
	echo "And without video structure if without VIDEO_TS dir"
	exit
fi

UDF=`find $2 -size +2G|wc -w`

UNLOCK='cdrdao unlock --device 2,0,0 --driver generic-mmc && sleep 1'

sync

ulimit -l unlimited

if [ $UDF -eq 0 ]; then
COM="-allow-limited-size -f -J -r -graft-points "

if [ -z "$3" ]; then
COMCD="-v dev=/dev/sr0 -dao fs=1000m "
else
COMCD="-speed=$3 -v dev=/dev/sr0 -dao fs=1000m "
fi
VIDEO=`ls $2|grep -i VIDEO_TS 2> /dev/null   |wc -w`
if [ $VIDEO -eq 0 ]; then
	OPTS=$COM
	SIZE=`mkisofs -allow-limited-size -f -J -r -graft-points -quiet -print-size -V $1 $2`
else
	OPTS="$COM -dvd-video"
	SIZE=`mkisofs -allow-limited-size -f -J -r -graft-points -quiet -print-size -dvd-video  -V $1 $2`
fi


mkisofs $OPTS -V $1 $2|cdrecord $COMCD tsize="$SIZE"s -
#$UNLOCK
eject /dev/sr0
sleep 1
mount /mnt/cdrom
ls -alh /mnt/cdrom
DF
umount /mnt/cdrom
sleep 1
eject /dev/sr0

else

COM="-udf -allow-limited-size -f -J -r -graft-points "

if [ -z "$3" ]; then
COMCD="-v dev=/dev/sr0 -dao fs=1000m "
else
COMCD="-speed=$3 -v dev=/dev/sr0 -dao fs=1000m "
fi
VIDEO=`ls $2|grep -i VIDEO_TS 2> /dev/null   |wc -w`
if [ $VIDEO -eq 0 ]; then
	OPTS=$COM
	SIZE=`mkisofs -udf -allow-limited-size -f -J -r -graft-points -quiet -print-size -V $1 $2`
else
	OPTS="$COM -dvd-video"
	SIZE=`mkisofs -udf -allow-limited-size -f -J -r -graft-points -quiet -print-size -dvd-video  -V $1 $2`
fi


mkisofs $OPTS -V $1 $2|cdrecord $COMCD tsize="$SIZE"s -
#$UNLOCK
eject /dev/sr0
sleep 1
mount /mnt/udf
ls -alh /mnt/udf
DF
umount /mnt/udf
sleep 1
eject /dev/sr0
fi
--- end cut here ---
dvd+rw-mediainfo /dev/sr0
INQUIRY:                [LITE-ON ][DVDRW SH-16A7S  ][WS04]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         1Bh, DVD+R
 Media ID:              SONY/D21
 Current Write Speed:   16.0x1385=22160KB/s
 Write Speed #0:        16.0x1385=22160KB/s
 Write Speed #1:        12.0x1385=16620KB/s
 Write Speed #2:        8.0x1385=11080KB/s
 Write Speed #3:        6.0x1385=8310KB/s
 Write Speed #4:        4.0x1385=5540KB/s
 Write Speed #5:        2.4x1385=3324KB/s
GET [CURRENT] PERFORMANCE:
 Write Performance:     6.4x1385=8864KB/s@0 -> 15.4x1385=21296KB/s@2146271
 Speed Descriptor#0:    00/2146271 R@15.4x1385=21296KB/s W@16.0x1385=22160KB/s
 Speed Descriptor#1:    00/2146271 R@15.4x1385=21296KB/s W@12.0x1385=16620KB/s
 Speed Descriptor#2:    00/2146271 R@15.4x1385=21296KB/s W@8.0x1385=11080KB/s
 Speed Descriptor#3:    00/2146271 R@15.4x1385=21296KB/s W@6.0x1385=8310KB/s
 Speed Descriptor#4:    00/2146271 R@15.4x1385=21296KB/s W@4.0x1385=5540KB/s
 Speed Descriptor#5:    00/2146271 R@15.4x1385=21296KB/s W@2.4x1385=3324KB/s
READ DVD STRUCTURE[#0h]:
 Media Book Type:       00h, DVD-ROM book [revision 0]
 Legacy lead-out at:    2295104*2KB=4700372992
READ DISC INFORMATION:
 Disc status:           appendable
 Number of Sessions:    2
 State of Last Session: empty
 "Next" Track:          2
 Number of Tracks:      2
READ TRACK INFORMATION[#1]:
 Track State:           invisible
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            2146272*2KB
 ROM Compatibility LBA: 262144
READ TRACK INFORMATION[#2]:
 Track State:           blank
 Track Start Address:   2148320*2KB
 Next Writable Address: 2148320*2KB
 Free Blocks:           146784*2KB
 Track Size:            146784*2KB
 ROM Compatibility LBA: 262144
FABRICATED TOC:
 Track#1  :             14@0
 Track#AA :             14@2146272
 Multi-session Info:    #1@0
READ CAPACITY:          2146272*2048=4395565056

Thank,
-- 
Grégoire FAVRE  http://gregoire.favre.googlepages.com  http://www.gnupg.org
               http://picasaweb.google.com/Gregoire.Favre


Reply to: