Linux – AVCHD (H.264) – hardware acceleration

[UPDATE] Read here about the latest development, regarding hardware acceleration on Linux: http://blog.mymediasystem.net/?tag=vdpau

The truth about Linux’ capability of playing back AVCHD content

NEWS! It’s getting tense! Read this post from the NVIDIA Manager Andy Ritger: http://lists.freedesktop.org/archives/xorg/2008-November/040279.html

This section is going to be about my experiences with Linux and HD television. It covers topics like VDR und h264 support. Playing back mpeg transport stream (mts/m2ts) footage from camcorders like Canon’s HF100 or Panasonic’s HDC-SD100. Both cams record in the AVCHD format, aka mpeg4/AVC. This page will also describe my progresses playing back this AVCHD footage. No – I’m not there yet ;-)

First of all this page isn’t about editing nor authoring AVCHD footage. I’d be just happy being able to play AVCHD without flaws. If one search for

Linux AVCHD

in Google, one earns a lot of results concerning editing, transcoding or demuxing. No – this page is NOT about that! I’m not intending to edit or cut my footage in a long and difficult process, only for the purpose to watch what I’ve recorded. This here is all about more or less an instant solution.


Playback of m2ts/mts (AVCHD) content

As mentioned playing back AVCHD from Canon HF100 and Panasonic HDC-SD100 doesn’t work without flaws at the moment. I’ve only got a preliminary workaround, so I can at least watch a bit of my own recording.
So what do one need to watch AVCHD content fluently and which applications can handle mpeg4/AVC content at all?
I’m using always mplayer’s latest trunk from its subversion repository. Yes, they call it themselves like that: trunk ;-). That means, just go onto their site and download the latest version with svn:

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

You need to install svn first, if you don’t have it already. Here’s the Debian way: apt-get:

apt-get install subversion

perform a

./configure

and a

make && make install

then start mplayer for PAL content for Canon HF100:

/usr/local/bin/mplayer -fps 50 -lavdopts threads=3:skiploopfilter=all:fast -vf pp=fd <my-avchd-footage-here>.mts

for playing files from Panasonic HDC-SDn:

/usr/local/bin/mplayer -demuxer lavf -lavdopts threads=3:skiploopfilter=all:fast -vf pp=fd <my-avchd-footage-here>.mts

Playing back eg. x264 encoded content in a Matroska container works quite good with a decent CPU, it’s just the Linux AVCHD combination, that doesn’t match perfectly atm. (performance and. audio-sync problems):

/usr/local/bin/mplayer -demuxer mkv -lavdopts threads=3:skiploopfilter=all:fast <my-avchd-footage-here>.mts

It’s likely the switch “-demuxer mkv” isn’t necessary with latest mplayer anymore.