# Using vdpau with mplayer still have high CPU usage



## olivier (Sep 22, 2010)

Hi all,
I've got an atom/ion mediacenter that works great with XBMC on Ubuntu.
But now that XBMC is ported to FreeBSD, I want to migrate my mediacenter to FreeBSD.

My first attemps was to test the vdpau support on FreeBSD:

1. I've installed x11/nvidia-driver (and added in boot/loader.conf)

2. I've compiled/installed mplayer "WITH_VDPAU"

3. I've configured my xorg.conf for using nvidia drivers:

```
Section "Device"
 Identifier  "Card0"
 Driver      "nvidia"
EndSection
Section "Extensions"
 Option "Composite" "Disable"
EndSection
```

4.I've configured my .mplayer/config file to use vdpau:

```
vo=vdpau,
vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,
```

The problem is when I start to play a 720p or 1080p movie, mplayer consume more than 85% of CPU and the movie very very slow.
But mplayer output show that it using vdpau:

```
MPlayer SVN-r31746-snapshot-4.2.1 (C) 2000-2010 MPlayer Team

Playing Good.movie.1080p.mkv.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0, -alang fre
[lavf] stream 2: audio (dca), -aid 1, -alang eng
[lavf] stream 3: subtitle (unknown), -sid 0, -slang fre, ForcÃ©s
[lavf] stream 4: subtitle (unknown), -sid 1, -slang fre
[lavf] stream 5: subtitle (unknown), -sid 2, -slang eng
VIDEO:  [H264]  1920x816  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio: 80000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[VD_FFMPEG] Trying pixfmt=0.
Movie-Aspect is 2.35:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x816 => 1920x816 H.264 VDPAU acceleration 
[VD_FFMPEG] XVMC-accelerated MPEG-2.
A:  89.6 V:  77.3 A-V: 12.283 ct:  0.163   0/  0  1% 272% 84.0% 114 0
```

What can I do for troubleshoot this problem ?

Thanks,


----------



## EdGe (Sep 23, 2010)

Greetings.

It could be a container problem. Try with a new created file on your freebsd system.
I had a similar problem on older .mkv files. de/remuxing the files corrected the playback.

If it's not the container, for debugging and tracing nvidia's vdpau support:
file:///usr/local/share/doc/NVIDIA_GLX-1.0/html/vdpausupport.html#DebuggingAndTra6efd2


----------



## olivier (Sep 23, 2010)

All my files meet the same problems, then it's not a container problem.
I didn't understand the debug output of nvidia trace, I will ask on the nvidia forum.
Thanks,


----------



## arli (Nov 23, 2010)

1% 272% 84.0%

1% is video codec cpu usage in percent, because via vdpau

272% is video_out CPU usage, look like video problem, but 

84.0% is audio codec CPU usage in percent

and "A-V: 12.283" very high..

i think its you cpu run in the lower freq or very busy.. or post video card mode and ~/.mplayer/config here..

maybe u can try:


```
$ mplayer -noconfig all -vo vdpau -vc ffh264vdpau, -ao oss -demuxer mkv -cache 4096 FILE.MKV
```


----------

