preload
Jun 09

A simple perl script utilizing mkisofs that takes a VIDEO_TS directory full of vobs and creates a dvd iso image. It needs a bit of further modification to make it more robost, but the basics are there and its fully usable.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/perl
#
# a script to create dvd iso images using mkisofs
# created by: Michael Sutherland, May 22, 2008
#
 
use warnings;
use strict;
use Getopt::Long;
 
## variables ##
my $mkisofs = '/usr/bin/mkisofs';
my $path    = '';
my $iso     = '';
my $title   = '';
my $cmd;
 
## user options ##
 
GetOptions(
        "path=s"        =>      \$path,
        "iso=s"         =>      \$iso,
        "title=s"       =>      \$title,
);
 
## sanity checks ##
 
if ( ( ! $path ) || ( ! $iso ) || ( ! $title ) ) {
 
    &usage();
}
 
if ( ! -f $mkisofs ) {
 
    print "unable to find mkisofs at $mkisofs\n";
    exit 2;
}
 
## flush the buffer ##
$| = 1;
 
## program start ##
 
$cmd = "$mkisofs -dvd-video -J -L -r -V $title -o $iso $path 2>&1";
#print "running: $cmd\n";
 
open (MKISOFS, "$cmd |"); 
 
while (<MKISOFS>) {
 
    chomp($_);
    printf "\rmkdvdiso: %40s", $_ if /estimate finish/;
}
 
printf "\rmkdvdiso: %40s\n", "completed at";
 
## subroutines ##
 
sub usage() {
 
    print "mkdvdiso - a quick utility for creating dvd iso images\n\n";
    print "usage:\n";
    print "\t-path\tpath and directory containing the VIDEO_TS 
            & AUDIO_TS folders\n";
    print "\t-iso\tpath and name of iso image to be created\n";
    print "\t-title\ttitle for the dvd iso image\n";
 
    exit 1;
}
Tagged with: