Skip to content

Instantly share code, notes, and snippets.

@punytan
Created August 22, 2012 14:23
Show Gist options
  • Save punytan/3426085 to your computer and use it in GitHub Desktop.
Save punytan/3426085 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
main(@ARGV);exit;
sub main {
my $path = shift or help();
my $title = shift or help();
my $dir = "$path/$title";
mkdir $dir unless -d $dir;
chdir $dir;
`cdrdao read-cd --device /dev/cdrom --datafile "CDImage.bin" "CDImage.toc"`;
`toc2cue "CDImage.toc" "CDImage.cue"`;
`eject`
}
sub help {
print <<"EOM";
usage: $0 /path/to/your/cd/lib CD_TITLE
will generates "/path/to/your/cd/lib/CD_TITLE/CDImage.{bin,toc,cue}"
EOM
exit;
}
__END__
use strict;
use warnings;
main();exit;
sub main {
my $path = shift @ARGV or help();
my $title = shift @ARGV or help();
`sudo mount /dev/dvd /media/dvd`;
`vobcopy -m -x -t $title`;
`mkisofs -v --dvd-video -o $path/$title.iso ./$title/`;
`sudo umount /media/dvd`;
`eject`;
}
sub help {
print <<"EOM";
Usage: $0 /path/to/your/dvd/lib DVD_TITLE
will generate "/path/to/your/dvd/lib/DVD_TITLE.iso"
EOM
exit 1;
}
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment