My VIA Epia board is a bit weak to decode DVDs with the processor, so it has a hardware mpeg2 decoder on board. On Windows, this can be accessed with either PowerDVD or WinDVD

Googling reveals that there is a “VIA enhanced Xine Player” called VeXP for Linux that is supposed to do the job. However, I like mplayer and I had read that it would support XvMC — the XVideo-MotionCompensation extension — which is supposed to be a general layer to access hardware accelerated mpeg2 decoders.

(II) VIA(0): [XvMC] Registering viaXvMC.
(II) VIA(0): [XvMC] Initialized XvMC extension.

Of course, compiling mplayer with ./configure --enable-xvmc did not work.

MPlayer dev-SVN-r20923-4.1.2 (C) 2000-2006 MPlayer Team
CPU: VIA Nehemiah (Family: 6, Model: 9, Stepping: 8)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE
vo_xvmc: X-Video extension 2.2
vo_xvmc: X-Video MotionCompensation Extension version 1.1
Forced video codec: ffmpeg12mc
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] XVMC accelerated codec.
INFO: libavcodec init OK!
Selected video codec: [ffmpeg12mc] vfm: ffmpeg (FFmpeg MPEG-1/2 (XvMC))
[VD_FFMPEG] XVMC-accelerated MPEG-2.
[VD_FFMPEG] Trying pixfmt=0.
VDec: vo config request - 720 x 576 (preferred colorspace: MPEG1/2 Motion Compensation and IDCT)
Trying filter chain: vo
vo_xvmc: query_format=1DC70082
vo_xvmc: Querying 1 adaptors
vo_xvmc: Quering adaptor #0
vo_xvmc: probing port #68
vo_xvmc: XvMC list have 2 surfaces
vo_debug: query(MPEG1/2 Motion Compensation and IDCT) returned 0x0 (i=0) 
vo_xvmc: query_format=1DC70002
vo_xvmc: Querying 1 adaptors
vo_xvmc: Quering adaptor #0
vo_xvmc: probing port #68
vo_xvmc: XvMC list have 2 surfaces
vo_debug: query(MPEG1/2 Motion Compensation) returned 0x0 (i=1) 
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
SwScale params: -1 x -1 (-1=no scaling)
Trying filter chain: scale vo
vo_debug: query(MPEG1/2 Motion Compensation and IDCT) returned 0x0 (i=0) 
vo_debug: query(MPEG1/2 Motion Compensation) returned 0x0 (i=1) 
The selected video_out device is incompatible with this codec.
Try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
[VD_FFMPEG] Unexpected init_vo error.
vo_xvmc: query_format=4D504553

Asking in #mplayer again (as I did in my last post about it), iive tolde me that the mplayer xvmc support would only work with NVIDIA’s hardware mpeg2 decoder. What a disappointment!

Turns out there is a (slightly outdated) patch at that brings the VIA XvMC support to mplayer.

Update: Check out their Mailing List, it might contain more recent and more professional patches!

Here is the patch I slapped on my svn r21040 of mplayer, for reference.

I do not exactly trust my patching skills and there seems to be especially a problem with the deinterlacer. But at least it allows me to watch DVDs on Linux.

Update 2: Turns out there is nothing wrong with the deinterlacer after all, you just need to enable it: -vo xvmc:deint-bob

This goes into the mplayer.conf:


Update 2: Replace xvmc above with xvmc:deint-bob if you want to enable the bob deinterlacer. Another possible deinterlacer is xvmc:deint-one.

NB: • ffmpeg detects my DVD movie aspect ratio incorrectly. If that’s the case for you, just manually specify the right one, e.g.: mplayer -aspect 16:9 dvd://2

• The right way to build a debian mplayer package is: debian/rules binary. The right way to clean up and reconfigure after code changes or svn up is: debian/rules clean.

• One way to create a diff containing all the external items in the mplayer source, given that you’ve already done a svn up, is this:

svn diff; for f ($(svn up|grep 'external item into'|sed -e "s/.*'\(.*\)'.*/\1/")) { ( cd $f; svn diff|sed -e "s/^\(Index:\|---\|+++\) /\1 $f\//"; cd .. ) }