Showing posts with label growisofs. Show all posts
Showing posts with label growisofs. Show all posts

Friday, February 22, 2008

creating a bootable iso in Linux

OK. So call me stupid, but I rarely create bootable DVDs from iso images in Fedora. Here is how I created a bootable Ubuntu 7.10 disk using growisofs.

Burn the ISO image to a DVD
1) Put your DVD in your DVD drive

2) Make sure your drive is reading the disk properly by using dvd+rw-mediainfo. This program is part of the dvd+rw tools. The command should also give you a write speed estimate, which is handy.

[mule@ogre ~]# dvd+rw-mediainfo /dev/dvd
INQUIRY: [HP ][DVD Writer 940d ][3H23]
GET [CURRENT] CONFIGURATION:
Mounted Media: 11h, DVD-R Sequential
Media ID: ProdiscS03
Current Write Speed: 4.0x1385=5540KB/s
Write Speed #0: 4.0x1385=5540KB/s
Write Speed #1: 2.0x1385=2770KB/s
GET [CURRENT] PERFORMANCE:
Write Performance: 4.0x1385=5540KB/s@[0 -> 0]
Speed Descriptor#0: 00/0 R@6.4x1385=8864KB/s W@4.0x1385=5540KB/s
Speed Descriptor#1: 00/0 R@6.4x1385=8864KB/s W@2.0x1385=2770KB/s
READ DVD STRUCTURE[#10h]:
Media Book Type: 00h, DVD-ROM book [revision 0]
Legacy lead-out at: 2298496*2KB=4707319808
READ DVD STRUCTURE[#0h]:
Media Book Type: 25h, DVD-R book [revision 5]
Last border-out at: 2045*2KB=4188160
READ DISC INFORMATION:
Disc status: blank
Number of Sessions: 1
State of Last Session: empty
"Next" Track: 1
Number of Tracks: 1
READ TRACK INFORMATION[#1]:
Track State: invisible incremental
Track Start Address: 0*2KB
Next Writable Address: 0*2KB
Free Blocks: 2297888*2KB
Track Size: 2297888*2KB
READ CAPACITY: 0*2048=0


3) Using growisofs, burn the ISO image to a DVD. Note that I used this command on a DVD RW:
[mule@ogre ~]# growisofs -dvd-compat -Z /dev/dvd=ubuntu-7.10-desktop-amd64.iso
Executing 'builtin_dd if=ubuntu-7.10-desktop-amd64.iso of=/dev/dvd obs=32k seek=0'
/dev/dvd: "Current Write Speed" is 2.0x1352KBps.
3407872/2005147648 ( 0.2%) @0.5x, remaining 39:09 RBU 100.0% UBU 6.5%
12288000/2005147648 ( 0.6%) @1.9x, remaining 18:55 RBU 100.0% UBU 100.0%
..
1992097792/2005147648 (99.3%) @2.0x, remaining 0:04 RBU 77.9% UBU 100.0%
2001076224/2005147648 (99.8%) @1.9x, remaining 0:01 RBU 24.4% UBU 100.0%
builtin_dd: 979088*2KB out @ average 1.9x1352KBps
/dev/dvd: flushing cache
/dev/dvd: writing lead-out


The disc..she boots!
The Mule

Tuesday, January 01, 2008

method to create a menuless DVD

Happy 2008, everybody!

I keep forgetting the commands to create and burn DVD-ready files from Cinelerra. As the following commands worked well for me, I thought I'd write 'em down for folks. I won't concentrate on creating the DVD-ready file, but more on the latter steps using dvdauthor and burning an iso.

In order to get a working DVD, you're going to do the following:
1 - from Cinelerra, create a valid DVD-ready MPEG file
2 - with dvdauthor, create a DVD filesystem from that MPEG
3 - with dvdauthor, create a table of contents for the DVD filesystem
4 - with mkisofs, create a DVD-ready ISO image in prep for burning to DVD
5 - with growisofs, burn the DVD

PrerequisitesCinelerra
mplex
dvdauthor
dvd+rw-tools

References
http://gentoo-wiki.com/HOWTO_Create_a_DVD:Burn
http://gentoo-wiki.com/HOWTO_Mencoder_Introduction_Guide

1 - Create a valid DVD-ready MPEG file
In Cinelerra, create a project with the following specs:
Audio
Samplerate: 48000
Channels: 2

Video
Framerate: 29.97
Width: 720
Height: 480
W/H Ratios both 1
Color Model: YUVA-8bit
Aspect Ratio: 3:2 or check Auto
Interlace Mode: Not Interlaced

Render Options
Audio
File Format: MPEG Audio
Layer: II
Kbits per second: 384Kbps

Video
File Format: YUV4MPEG

Either mpeg2enc or ffmpeg presets should work. Just make sure the aspect ratio of the resultant video is 16:9, because dvdauthor will not create the DVD filesystem if this is not the case. The switch to ffmpeg is "-aspect 16:9" or "aspect 1.777" like so:
ffmpeg -f yuv4mpegpipe -i - -y -target dvd -aspect 1.777 -f mpeg2video %

Since multiplexing to DVD-ready file in ffmpeg doesn't work as expected, I combine the audio and video with MPLEX using this command:
mplex -f 8 -o test.mpg video.m2v audio.mp2

I will try to figure out the source of the ffmpeg issue later.

2 - Create a DVD filesystem from MPEG
Using dvdauthor, run this command to create a filesystem in a folder called "dvd" from your test mpeg:
[mule@ogre ~]# dvdauthor -o dvd/ -t test.mpg
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt iconv freetype fribidi
Send bugs to

INFO: dvdauthor creating VTS
STAT: Picking VTS 03

STAT: Processing test.mpg...
STAT: VOBU 1488 at 394MB, 1 PGCS
INFO: Video pts = 0.133 .. 598.564
INFO: Audio[8] pts = 0.133 .. 598.621
STAT: VOBU 1499 at 395MB, 1 PGCS
INFO: Generating VTS with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 16:9
INFO: Resolution: 720x480
INFO: Audio ch 0 format: mp2/2ch, 48khz 20bps

STAT: fixed 1499 VOBUS


3 - Create a Table of Contents
Using dvdauthor, run this command to create a table of contents for the DVD filesystem:
[mule@ogre ~]# dvdauthor -o dvd/ -T
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt iconv freetype fribidi
Send bugs to

INFO: dvdauthor creating table of contents
INFO: Scanning dvd/VIDEO_TS/VTS_01_0.IFO
INFO: Scanning dvd/VIDEO_TS/VTS_02_0.IFO
INFO: Scanning dvd/VIDEO_TS/VTS_03_0.IFO
INFO: Scanning dvd/VIDEO_TS/VTS_04_0.IFO


4 - Create a DVD-ready ISO image for burning
Using mkisofs, create an ISO image:
[mule@ogre ~]# mkisofs -dvd-video -o dvd.iso dvd/
I: -input-charset not specified, using utf-8 (detected in locale settings)
Unknown file type (unallocated) dvd/.. - ignoring and continuing.
0.51% done, estimate finish Mon Dec 31 20:31:57 2007
1.02% done, estimate finish Mon Dec 31 20:31:57 2007
..
99.07% done, estimate finish Mon Dec 31 20:32:50 2007
99.58% done, estimate finish Mon Dec 31 20:32:50 2007
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 4380
Path table size(bytes): 42
Max brk space used 0
979076 extents written (1912 MB)


Here's nice tip on testing your ISO by mouting it from your filesystem:
http://gentoo-wiki.com/TIP_Mounting_Iso_Files


5 - Burn the ISO image to a DVD
Using growisofs, burn the ISO image to a DVD. Note that I used this command on a DVD RW:
[mule@ogre ~]# growisofs -dvd-compat -Z /dev/dvd=dvd.iso
Executing 'builtin_dd if=dvd.iso of=/dev/dvd obs=32k seek=0'
/dev/dvd: "Current Write Speed" is 2.0x1352KBps.
3407872/2005147648 ( 0.2%) @0.5x, remaining 39:09 RBU 100.0% UBU 6.5%
12288000/2005147648 ( 0.6%) @1.9x, remaining 18:55 RBU 100.0% UBU 100.0%
..
1992097792/2005147648 (99.3%) @2.0x, remaining 0:04 RBU 77.9% UBU 100.0%
2001076224/2005147648 (99.8%) @1.9x, remaining 0:01 RBU 24.4% UBU 100.0%
builtin_dd: 979088*2KB out @ average 1.9x1352KBps
/dev/dvd: flushing cache
/dev/dvd: writing lead-out


Appendix
Formatting a DVD RW
Using dvd+rw-format, format your DVD RW media:
[mule@ogre Desktop]# dvd+rw-format -f /dev/dvd
* BD/DVD±RW/-RAM format utility by , version 7.0.
* 4.7GB DVD-RW media in Restricted Overwrite mode detected.
* formatting 29.2/


That's it. Happy New Year!
The Mule

Sunday, May 27, 2007

using dd to create a 4GB file

I'm in the process of learning how to use to dar (disk archive) to archive my videos in files that will span multiple DVDs. First, though, I want to find out exactly how large a file I can have dar create in order to maximize the utilized space on the DVD. I will use growisofs to copy the file to the DVD, so I will tell dd to create a large file of around 4.7GB and see if growisofs can write that file.

Here is the syntax of the dd command to create the file. I will fill the file with NULL characters.
dd if=/dev/zero of=zerofile.tst bs=1k count=4700000

if = input file
of = output file
bs = block size
count = file size in kb


Woops..file is too big for growisofs!
[root@computer ~]# growisofs -Z /dev/hda -R -J /mnt/videos/zerofile.tst
Executing 'mkisofs -R -J /mnt/videos/zerofile.tst builtin_dd of=/dev/hda obs=32k seek=0'
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs: Value too large for defined data type. File /mnt/videos/zerofile.tst is too large - ignoring
Total translation table size: 0
Total rockridge attributes bytes: 169
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
181 extents written (0 MB)
/dev/hda: "Current Write Speed" is 8.2x1352KBps.
builtin_dd: 192*2KB out @ average 0.0x1352KBps
/dev/hda: flushing cache
/dev/hda: closing track
/dev/hda: closing session


I'd better do some research. According to these two articles:
Cheetah Burner FAQ
http://en.wikipedia.org/wiki/ISO_9660

the maximum file size for a data DVD with IS09660 and Joliet extensions is 4.2GB. dar creates files in chunks of megabytes (1024 x 1024 x a value specified in the thousands). So if use a value of 4100 in dar, dar should create archive files that are 4,194,304,000. This is right under the limit of the usable space on a DVD.

Here's the second test I performed using dd:
[root@computer ~]# dd if=/dev/zero of=/mnt/videos/zerofile.tst bs=1k count=4100000
4100000+0 records in
4100000+0 records out
4198400000 bytes (4.3 GB) copied, 50.7164 seconds, 84.8 MB/s


Success! dar was able to correctly write this 4,198,400,000 byte file to disk:
dar -m 256 -y -s 4000M -D -R /mnt/videos/zerofile.tst -c `date -I`_data

--------------------------------------------
1 inode(s) saved
with 0 hard link(s) recorded
0 inode(s) changed at the moment of the backup
0 inode(s) not saved (no file change)
0 inode(s) failed to save (filesystem error)
0 files(s) ignored (excluded by filters)
0 files(s) recorded as deleted from reference backup
--------------------------------------------
Total number of file considered: 1
--------------------------------------------


I did try a third test using a value of 4100MB, but this yielded a total of 4,299,161,600 bytes. This value exceeded the 32-bit current limitation of ISO9660. As I've read, this specification is under review and may be increased in the near future.

Side Note:
Instead of NULL characters, dd can fill a file with random (/dev/random) characters or less random characters (/dev/urandom). According to the Wiki entry, the difference between the two is that urandom is "less cryptographically secure" and takes a shorter amount of time to use because of this insecurity:
http://en.wikipedia.org/wiki/Dd_(Unix)

dd has been around since the mid-70s and is used for creating and archiving files at a very low level. Be careful using this program, because it's synonym is "destroy data" and you can easily wipe out the data on your hard drive with the wrong syntax.

Here's the man page on dd:
http://www.die.net/doc/linux/man/man1/dd.1.html

UPDATE: Here is how I've decided to backup my HDV material using a combination of dar (disk archive) and growisofs:
http://crazedmuleproductions.blogspot.com/2007/05/problem-of-archivingand-solution.html

UPDATE: Here is another way to create a large file using dd. Try making the block size larger and reduce the number (count) of blocks for the test file! The following command creates a file of zeros one gigabyte in length using a block size of 1,000 megabytes (one Gb):
dd if=/dev/zero of=zerofile.tst bs=1000M count=1
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 7.812 s, 134 MB/s

Sunday, March 26, 2006

Burned a DVD using Linux! Success!!

Such small things make us happy. Well, this was not a small thing, as I've been wanting to use Linux to burn a DVD of my custom videos created from Cinelerra for a loooong time. Up until now, I've copped out and just rebooted to XP to get the dirty work done. This was the first time I really sat down and muddled through the arcane commands to get a DVD burned. In fact, not only did I get a DVD-R burned, but I also figured out how to get a DVD-RW formatted and a DVD image burned to that! F'n A!!

I will work on a doc later, but here are the quick and dirty steps to burning a DVD on a Fedora Core 4 system:

REFERENCES
http://heroinewarrior.com/cinelerra/cinelerra.html#MAKING%20A%20DVD
http://dvd.chevelless230.com/
http://www.kerklied.com/adrie/presentatiedvdmakeneng.html
http://users.dslextreme.com/~craig.lawson/linux_notes/video.html#Writing_to_DVD_media
growisofs syntax

PREREQUISITES
I needed ifogen, so get the latest copy of dvdrtools found here:
http://www.arklinux.org/projects/dvdrtools

CREATE DVD-READY MPEG
[root@computer 20060319]# ffmpeg -i test.m2v -i test.wav -target dvd output.mpg

TEST DVD-READY MPEG
[root@computer 20060319]# mplayer output.mpg

MAKE THE DIRECTORY TO PUT DVD IMAGE IN
[root@computer 20060319]# mkdir -p dvd/VIDEO_TS

CREATE DVD READY FILES (VOB/BUF/IFO)
[root@computer 20060319]# ifogen output.mpg -o dvd

VIEW DIRECTORY
[root@computer 20060319]# ll dvd/VIDEO_TS/
total 34444
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.BUP
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.IFO
-rw-r--r-- 1 root root 35205120 Mar 26 14:58 VTS_01_1.VOB

CREATE TABLE OF CONTENTS
[root@computer 20060319]# ifogen -T -o dvd
INFO: dvdauthor creating table of contents
scanning dvd/VIDEO_TS/VTS_01_0.IFO

VIEW DIRECTORY
[root@computer 20060319]# ll dvd/VIDEO_TS/
total 34460
-rw-r--r-- 1 root root 6144 Mar 26 14:59 VIDEO_TS.BUP
-rw-r--r-- 1 root root 6144 Mar 26 14:59 VIDEO_TS.IFO
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.BUP
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.IFO
-rw-r--r-- 1 root root 35205120 Mar 26 14:58 VTS_01_1.VOB

CREATE THE DVD IMAGE
[root@computer 20060319]# mkisofs -dvd-video -udf -o dvd.iso dvd/

USE -scanbus SWITCH TO VERIFY DEVICE NAME
[root@computer 20060319]# dvdrecord -scanbus

THIS COMMAND DID NOT WORK WITH MY ATA NEC DRIVE LABELED 1,0,0
[root@computer 20060319]# dvdrecord -ignsize -dao -v dev=1,0,0 fs=67108864 dvd.iso

THIS COMMAND CHECKS YOUR DRIVE
[root@computer 20060319]# cdrecord -dev=ATA:1,0,0 driveropts=help -checkdrive

THIS COMMAND BURNS A DVD-R WITH THE DEVICE LABELED ATA:1,0,0
[root@computer 20060319]# dvdrecord -ignsize -dao -v dev=ATA:1,0,0 fs=67108864 dvd.iso

THIS COMMAND FORMATS A DVD-RW
[root@computer 20060319]# dvd+rw-format -f /dev/hdc

THIS COMMAND BURNS A DVD ISO IMAGE TO A REWRITEABLE DVD DISC
[root@computer 20060319]# growisofs -Z /dev/hdc=dvd.iso

Until next time..good burning to you!

5/30/07 update: Here's a great article on the many types of DVDs and how to use them in Linux:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/creating-dvds.html