Thursday, January 21, 2010

Making a nice home video DVD

Video source: a Sony handycam (DCR-SR36) which produces mpeg/2 files.

Anticipated result: a nice DVD with rich menus.

How to do it?

First, I don't want to recode the movie clips, since it would degrade their quality. So I decided to use the mpegs straight from the video camera. If there is a need to clip such a video there is a nice tool to do that: avidemux.

There is also another nice tool for DVD authoring: DVDStyler - you can create a DVD menu interactively, add/rearrange clips etc. However it seems that it takes a great deal of time to come up with nice designs.

So I stumbled upon tovid. It's a bunch of scripts which allow to author a DVD in a non-interactive way, just generating appropriate menus, thumbnails etc. And here comes a bummer.... It turned out that there the mpegs from the videocam are not 100% compatible with the DVD format, and they require ... well not recoding but remuxing (remultiplexing). In order to do that I use a buch of commands:
ffmpeg -i $1 -vcodec copy -an -f rawvideo foo.mpv
ffmpeg -i $1 -vn -acodec copy -f mp2 foo.mp2
mplex -f 8 -o $2 foo.mpv foo.mp2
rm foo.mpv foo.mp2
Actually its a script, its good to save the above contents as an executable file, let's say: mpgfix, and then run it:
mpgfix file.mpg file-fixed.mpg
So file.mpg is remuxed and saved as file-fixed.mpg. You can save the file with the same name of course, then the original one will be replaced with the remuxed one. Mind that there is no quality loss here, no recoding.

And here comes the nice part DVD authoring, I just launch one of the tovid scripts (todisc):
todisc -loop 0 -chain-videos -menu-length 2 -thumb-shape normal -aspect 16:9 -menu-title "My DVD" -pal -files *.mpg -titles *.mpg -out DVD
And after a while in the DVD directory there is a complete authored DVD :) with nice animated menus. You can generate an ISO image out of it:
mksiofs -dvd-video -o dvd.iso DVD/
And you'll get a file dvd.iso which is a complete ISO image ready to burn. Enjoy.

No comments:

Post a Comment