Gnuru.org
Productive Linux


Subscribe

 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Login
Login:
Password:



Don't have an account?
Sign up to Gnuru.org
Forgot your password?

Converting 2.35 Aspect Video to DVD
20 October 2008 @ 16:41 BST
by Paul

Once you start playing around with video, you come to realise how flexible video on a computer is, and how hobbled some other formats are, such as video DVDs.

To burn a video with a 2.35 aspect ratio to DVD requires some conversion of the video. This means either the video needs to be cropped - the sides need to be sliced off - or you need to squash it by placing two black bars at the top and the bottom, causing a more severe letter box effect than you might otherwise have.

This script, using mplayer, converts the video to mpeg 2 and creates the letterboxing:

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd \
-srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=4900:keyint=15:aspect=16/9:\
acodec=ac3:abitrate=192 -ofps 25 \
-vf scale=720:432,expand=720:576,harddup \
-o your_video.mpg "$1"

Note that 'your_video.mpg' is the output file and $1 is the first argument you pass to the script. The magic is in the "scale" and "expand" attributes. More info on this can be found here. A smarter script would automatically create a better name for the output file.

Now create an xml file with the video data in it.

 <dvdauthor>
  <vmgm />
    <titleset>
      <titles>
        <pgc>
          <vob file="your_video.mpg"
	  chapters="0,0:10:0,0:20:0,0:30:0,0:40:0,0:50:0,1:00:0,1:10:0,1:20:0,1:30:0,1:40:0,1:50:0,2:0:0,2:20:0,2:30:0" />
        </pgc>
      </titles>
    </titleset>
</dvdauthor>

Run the dvdauthor command:

dvdauthor -o dvd/ -x dvd.xml

And burn the dvd:

growisofs -dvd-compat -Z /dev/dvd -dvd-video ./dvd/.

Thanks to linux.com and Gentoo Wiki for helping me to sort this out.

Red Hat Certified Technician & Engineer (RHCT and RHCE) Training Guide and Administrator's Reference



Leave a comment:

Are you human?