[MPlayer-users] MPlayer performance problems with Compiz

Diogo Franco diogomfranco at gmail.com
Sat Jun 21 15:38:18 CEST 2008


I'm having some problems with athe 'usable' VOs when I'm using compiz.
My video card is a NVidia MX4000 (NV18 C1), fixed function. CPU is a
Semprom "Palermo" 2800+, with 768 MB DDR400 RAM. OS is Ubuntu Hardy
64-bit with linux-rt as the kernel.

MPlayer is r27120-4.2.3, FFmpeg is r13836. MPlayer links to libav* with
dynamic linking and they both are compiled with "-O4 -pipe -march=native
-mtune=native -mmmx -m3dnow -msse -msse2 -fomit-frame-pointer
-ffast-math".

I made a few tests using the VOs to discover the best VO to use. The
command line I used is:

for i in "gl" "gl2" "gl2:noglfinish" "xv:adaptor=1" \
    "sdl" "x11"; do
    sudo nice -n -10 mplayer -endpos 30 -hardframedrop -slices \
    -nodr -vf-clr -correct-pts -benchmark -quiet -vo $i \
    "$TESTVIDEO" 2>&1 | grep -E 'BENCHMARK|vo|VO|swscaler'
done

I tested it with 2 videos, one is square pixel NTSC and the other one is
720p. They both are H.264 with AAC audio on a MKV container.

On .mplayer/config, the lavdopts are "threads=2:skiploopfilter=nonref".

Here's the full output for the first video with comments:

> [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> rgb32 special converter
> VO: [gl] 640x480 => 640x480 BGRA 
> BENCHMARKs: VC:   5.440s VO:   5.293s A:   0.803s Sys:  18.670s =   30.206s
> BENCHMARK%: VC: 18.0107% VO: 17.5233% A:  2.6591% Sys: 61.8070% = 100.0000%
> BENCHMARKn: disp: 712 (23.57 fps)  drop: 10 (1%)  total: 722 (23.90 fps)
The only 'yuv=' mode my card supports is 'yuv=0'.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 640x480 => 640x480 BGR 24-bit 
> BENCHMARKs: VC:   5.333s VO:  17.284s A:   1.305s Sys:   6.227s =   30.150s
> BENCHMARK%: VC: 17.6895% VO: 57.3288% A:  4.3273% Sys: 20.6544% = 100.0000%
> BENCHMARKn: disp: 712 (23.62 fps)  drop: 10 (1%)  total: 722 (23.95 fps)
Almost the same as 'gl', but it's strange how the cpu time shifted from Sys to
VO.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 640x480 => 640x480 BGR 24-bit 
> BENCHMARKs: VC:   5.226s VO:   5.434s A:   0.799s Sys:  18.661s =   30.119s
> BENCHMARK%: VC: 17.3504% VO: 18.0406% A:  2.6519% Sys: 61.9572% = 100.0000%
> BENCHMARKn: disp: 711 (23.61 fps)  drop: 11 (1%)  total: 722 (23.97 fps)
When a frame is dropped with "noglfinish", the colors may get weird. Sometimes
the video gets yellow, or magenta.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [xv] 640x480 => 640x480 Planar YV12 
> BENCHMARKs: VC:   5.556s VO:   0.958s A:   1.431s Sys:  22.138s =   30.083s
> BENCHMARK%: VC: 18.4696% VO:  3.1850% A:  4.7556% Sys: 73.5898% = 100.0000%
> BENCHMARKn: disp: 722 (24.00 fps)  drop: 0 (0%)  total: 722 (24.00 fps)
Gnome's monitor applet says this used about 60-70% of the cpu.
> [VO_SDL] Using driver: x11.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [sdl] 640x480 => 640x480 Planar YV12 
> BENCHMARKs: VC:   5.299s VO:   3.711s A:   0.850s Sys:  20.239s =   30.099s
> BENCHMARK%: VC: 17.6058% VO: 12.3283% A:  2.8248% Sys: 67.2411% = 100.0000%
> BENCHMARKn: disp: 720 (23.92 fps)  drop: 2 (0%)  total: 722 (23.99 fps)
Nothing big, only that it always creates the window on the lower left.
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VO: [x11] 640x480 => 640x480 Planar YV12 
> [swscaler @ 0x7d8410]using unscaled yuv420p -> rgb32 special converter
> BENCHMARKs: VC:   5.044s VO:  13.342s A:   0.784s Sys:  10.944s =   30.113s
> BENCHMARK%: VC: 16.7497% VO: 44.3052% A:  2.6030% Sys: 36.3421% = 100.0000%
> BENCHMARKn: disp: 718 (23.84 fps)  drop: 4 (0%)  total: 722 (23.98 fps)

The sNTSC one is fine with any VO.
Now, the same thing with the second video:

> [gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> rgb32 special converter
> VO: [gl] 1280x720 => 1280x720 BGRA 
> BENCHMARKs: VC:  14.616s VO:  14.768s A:   0.510s Sys:   0.559s =   30.453s
> BENCHMARK%: VC: 47.9941% VO: 48.4950% A:  1.6741% Sys:  1.8368% = 100.0000%
> BENCHMARKn: disp: 329 (10.80 fps)  drop: 394 (54%)  total: 723 (23.74 fps)
SLOOOOOOOW
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 1280x720 => 1280x720 BGR 24-bit 
> BENCHMARKs: VC:  13.518s VO:  15.938s A:   0.454s Sys:   0.459s =   30.369s
> BENCHMARK%: VC: 44.5137% VO: 52.4808% A:  1.4951% Sys:  1.5105% = 100.0000%
> BENCHMARKn: disp: 226 (7.44 fps)  drop: 497 (68%)  total: 723 (23.81 fps)
SLOOOOOOOW too
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> [swscaler @ 0x7d8410]using unscaled yuv420p -> bgr24 special converter
> VO: [gl2] 1280x720 => 1280x720 BGR 24-bit 
> BENCHMARKs: VC:  14.722s VO:  14.477s A:   0.422s Sys:   0.665s =   30.287s
> BENCHMARK%: VC: 48.6094% VO: 47.8007% A:  1.3937% Sys:  2.1962% = 100.0000%
> BENCHMARKn: disp: 377 (12.45 fps)  drop: 346 (47%)  total: 723 (23.87 fps)
Flickering maddness all the time between normal colors, yellow and magenta,
with yellow dominating the screen. Doesn't happen in fullscreen.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [xv] 1280x720 => 1280x720 Planar YV12 
> BENCHMARKs: VC:  14.001s VO:  20.111s A:   0.397s Sys:   6.840s =   41.348s
> BENCHMARK%: VC: 33.8605% VO: 48.6374% A:  0.9607% Sys: 16.5415% = 100.0000%
> BENCHMARKn: disp: 694 (16.78 fps)  drop: 29 (4%)  total: 723 (17.49 fps)
Don't be fooled by the low drop rate, mplayer hang many times and when it hang
the vo would go back and forth one frame and repeated that until mplayer
'revived'. If I use -noslices, tearing happens at multiple points.
> [VO_SDL] Using driver: x11.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [sdl] 1280x720 => 1280x720 Planar YV12 
> BENCHMARKs: VC:  12.940s VO:  16.680s A:   0.429s Sys:   0.212s =   30.262s
> BENCHMARK%: VC: 42.7618% VO: 55.1190% A:  1.4171% Sys:  0.7020% = 100.0000%
> BENCHMARKn: disp: 439 (14.51 fps)  drop: 284 (39%)  total: 723 (23.89 fps)
This time it liked the upper left.
> VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
> VO: [x11] 1280x720 => 1280x720 Planar YV12 
> [swscaler @ 0x7d8410]using unscaled yuv420p -> rgb32 special converter
> BENCHMARKs: VC:  12.634s VO:  16.942s A:   0.384s Sys:   0.301s =   30.260s
> BENCHMARK%: VC: 41.7493% VO: 55.9861% A:  1.2706% Sys:  0.9940% = 100.0000%
> BENCHMARKn: disp: 295 (9.75 fps)  drop: 429 (59%)  total: 724 (23.93 fps)
Watchable only with sdl and x11. gl2:noglfinish is watchable only on fullscreen.

I can't use CoreAVC to save some CPU time because it outputs garbage if a frame
is skipped.

Based on all that information, I'd like some help to find the 'perfect VO' and
options for mplayer to watch the 720p video. You can ask me to "torture" my
system if that helps :)

Without compiz, the best one was 'xv:adaptor=1' and the 720p video was
watchable. It dropped a lot of frames too, but wasn't very bad.




More information about the MPlayer-users mailing list