You’ve got a brand-new AVCHD camcorder from Panasonic, Sony or Canon and recorded your kids the first time in HD quality and want now to show the footage to your children’s grandmother?
Sure, no problem.
Just plug your camcorder directly into your also brand-new BluRay-writer or convert and author the footage with your Windows box first 😉 *kidding*
We’re of course on Linux and we don’t have a BluRay-writer, at least grandma doesn’t have one. What now? Well – I assume granny has a DVD-player. And we’re in the game again. I assume also you know how to compile (see other articles at this site, if not) and you also know how to install missing packages (e.g.: “apt-get install dvdauthor growisofs” ).
We just need these free Linux tools:
- mencoder (latest trunk: > ca. 27000, see mplayer note at the end)
- dvdauthor (repo: 0.6.14)
- growisofs (repo: 7.1)
- I’ve done the transcoding with just a single pass, and the quality was good enough for me. Here’s the line, which I didn’t tweaked a lot. So there maybe exists a much better solution. Just try yourself.
>mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:threads=4 input-file.mts -ofps 50 -fps 50 -o output_file.mpg
The example above is for PAL (Europe), for NTSC (USA) use “scale=720:480” and –(o)fps 60. “-lavcopts” was also running with an additional “:threads=4“. I left this away for compatibility reasons.
My sample file was 515 seconds long ( 8,1/2 minutes) and it took me about 13 minutes (31.66fps avarage) to convert it on a Intel Q6600 2,4Ghz (quadcore) and a x86_64 Ubuntu 8.10.
The input-file was 1GB in size and the output_file was 332MB. The footage was a recording from a Canon HF100, recorded at 15MBit/s (highest quality, H264 1920×1080).
So a rule of thumb could be: 10GB AVCHD ~ 3,4GB MPEG2.
In my footage was a lot panning, so you’ll get smaller output, if you don’t have a lot motion in your footage. But if you take the values above, your AVCHD footage could be about 14GB in size and it would still fit onto a single layer DVD (4,3GB), which in this case is a video length of about 110 minutes.
Please consider that this example was also made for a PAL system (fps 50) and with a Canon HF100 camcorder. You probably have to use for a Panasonic HDC-SDxxx the ‘-demuxer lavf’ switch, instead of ‘-fps 50’ (or 60 for NTSC).
- After you’ve got your output file in MPEG2 format, you can prepare it for writing on a DVD with dvdauthor:
dvdauthor -o dvd -x dvd.xml
Test it, before writing:
mplayer dvd:// -dvd-device ./dvd
See/download the dvd.xml example in the link above, and adjust it to your needs.
- Finally write it to a DVD via growisofs:
growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd/
I’ve been using for the examples above a Ubuntu 8.10 (Intrepid Ibex). It should make no difference to other distros, like Fedora, SuSE, Gentoo or all other Debian derivate, you just need latest mplayer (mencodere included) trunk:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
make && make install
Report bugs, typos and stuff. Thanks!