Just a simple wrapper around a few commands that are shown on http://mightylegends.zapto.org/dvd/dvdauthor_howto.php

#!/usr/bin/perl ########################################################## # # # Author: Gavin Henry # # Web: http://www.perl.me.uk # # # # Version: 0.1 - 28.11.05 # # # # Quick wrapper script to convert an avi # # to a dvd image, using howto at: # # # # http://mightylegends.zapto.org/dvd/dvdauthor_howto.php # # # # Licence: GPL # # # ########################################################## use strict; use warnings; use IO::Prompt; use File::Path; use Cwd; $|++; # First things first my $avi = $ARGV[0] or die "No avi file given!\n \tUsage: $0 filename.avi\n"; # use menu option from IO::Prompt my $choice = prompt -tty, 'Please choose your DVD format...', -1, -menu => [ 'PAL', 'NTSC', 'Quit', ]; print "You chose: [$choice]\n\n"; my $action_ref = { 'PAL' => \&start_pal_dvd, 'NTSC' => \&start_ntsc_dvd, 'Quit' => sub { print "You didn't want to convert $avi, bye\n"; ex +it 0; }, }; # Call our function, depending on what's in $choice if ( $action_ref->{$choice} ) { $action_ref->{$choice}->($avi); } else { warn "Unknown option: '$choice';\n" } #################### sub start_pal_dvd { # #################### my $avi = shift; system "transcode -i $avi -y ffmpeg --export_prof dvd-pal --export +_asr 3 -o $avi -D0 -b224 -N 0x2000 -s2 -m $avi.ac3 -J modfps=clonetyp +e=3 --export_fps 25"; } ##################### sub start_ntsc_dvd { # ##################### my $avi = shift; system "transcode -i $avi -y ffmpeg --export_prof dvd-ntsc --expor +t_asr 3 -o $avi -D0 -b224 -N 0x2000 - s2 -m $avi.ac3 -J modfps=clonet +ype=3 --export_fps 25"; } # Test if above worked, then create a mpg file system "mplex -f8 -o $avi.mpg $avi.m2v $avi.ac3" if ( ( -e "$avi.m2v" ) && ( -e "$avi.ac3" ) ) or die "Transcoding didn't work, please check for the error.\n"; # Chapters every 10 mins my $dvdauthor_xml =<< "DVD_STRUCT"; <dvdauthor dest="./DVD-Final"> <vmgm /> <titleset> <titles> <pgc> <vob file="$avi.mpg" chapters="0,10,20,30,40,50,60,70,80,90,10 +0,110,120"/> </pgc> </titles> </titleset> </dvdauthor> DVD_STRUCT open DVD_XML, ">dvdauthor.xml" or die "Can't create dvdauthor.xml: $!"; print DVD_XML "$dvdauthor_xml"; close DVD_XML; # Create DVD structure if mpg file exists system "dvdauthor -x dvdauthor.xml" if ( (-e "$avi.mpg") && (-d "./DVD-Final") ) or die "No mpg file found\n"; # Finally, make the iso ready to burn using the DVD-Final directory system "mkisofs -dvd-video -o $avi.iso ./DVD-Final"; rmtree(['./DVD-Final'], 1, 1) if ( ( -e "$avi.iso" ) && ( prompt( "Remove DVD-Final directory? ", - +tyn1s => 0.2 ) ) ); # Ask if we want to burn the DVD system "sudo dvdrecord -speed=4 -dao -driveropts=burnfree dev=/dev/hdd + -eject $avi.iso" if ( prompt( "Burn DVD? ", -tyn1s => 0.2 ) ) or die "OK, do it later then.\n"; print "All done. Please check the DVD works in your normal player\n";

Says me a bit of typing anyway ;-)
Gavin.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

In reply to Convert any AVI File to a DVD Image by ghenry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.