Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mplayer + ffmpeg + vdpau, but CPU usage stays high
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 205

PostPosted: Mon Jul 19, 2010 3:49 pm    Post subject: mplayer + ffmpeg + vdpau, but CPU usage stays high Reply with quote

Hello,

until now I used the "Xv" video output driver in combination with ffmpeg's "ffh264" codec to replay H.264 encoded movies. For 1080p my cpu usage was reasonable high. (Between 70% and 90%.) Recently I found out, that for my hardware (NVIDIA GeForce 9600M GS, proprietary nvidia driver 195.36.24) the "vdpau" output driver in conjunction with the "ffh264vdpau" codec is the better option. So I enabled the "vdpau" use flag and re-emerged all packages, whose use flags had changed. But if I invoke mplayer with the command

Code:

mplayer -vo vdpau -vc ffh264vdpau


my cpu usage stays on the same high level as before, although the output says that XVMC-accelerated decoding is in use. My feeling is, that mplayer/ffmpeg still uses the "Xv" output driver with the non-accelerated "ffh264" codec as a fall back without telling me. Any ideas what I might have forgot?

Here some more information about my configuration:

Code:

$ sudo eselect opengl list
Available OpenGL implementations:
  [1]   nvidia *
  [2]   xorg-x11

$ sudo eselect xvmc list
Available XvMC implementations  ( * is current ):
  [1]   nvidia *
  [2]   xorg-x11

$ vdpauinfo
display: :0.0   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  195.36.24  Thu Apr 22 19:52:55 PDT 2010

Video surface:

name   width height types
-------------------------------------------
420     4096  4096  NV12 YV12
422     4096  4096  UYVY YUYV

Decoder capabilities:

name               level macbs width height
-------------------------------------------
MPEG1                 0  8192  2048  2048
MPEG2_SIMPLE          3  8192  2048  2048
MPEG2_MAIN            3  8192  2048  2048
H264_MAIN            41  8192  2048  2048
H264_HIGH            41  8192  2048  2048
VC1_SIMPLE            1  8190  2048  2048
VC1_MAIN              2  8190  2048  2048
VC1_ADVANCED          4  8190  2048  2048

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    y  Y8U8V8A8 V8U8Y8A8
R10G10B10A2       8192  8192    y  Y8U8V8A8 V8U8Y8A8

Bitmap surface:

name              width height
------------------------------
B8G8R8A8          8192  8192
R8G8B8A8          8192  8192
R10G10B10A2       8192  8192
B10G10R10A2       8192  8192
A8                8192  8192

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             y
DEINTERLACE_TEMPORAL_SPATIAL     y
INVERSE_TELECINE                 y
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y         1     4096
VIDEO_SURFACE_HEIGHT             y         1     4096
CHROMA_TYPE                      y 
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y 
CSC_MATRIX                       y 
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y 
LUMA_KEY_MAX_LUMA                y

$ emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0/no-multilib, gcc-4.4.3, glibc-2.11.2-r0, 2.6.33-gentoo-r2 x86_64)
=================================================================
System uname: Linux-2.6.33-gentoo-r2-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8700_@_2.53GHz-with-gentoo-1.12.13
Timestamp of tree: Mon, 19 Jul 2010 09:15:01 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 AdobeFlash-10 AdobeFlash-10.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -msse4.1 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=core2 -msse4.1 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/                 http://ftp.uni-erlangen.de/pub/mirrors/gentoo                 http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/                 http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/                 http://ftp.rz.tu-bs.de/pub/mirror/ftp.gentoo.org/gentoo/                 http://gd.tuwien.ac.at/opsys/linux/gentoo/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="de en en_GB fr"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi addressbook alsa amd64 bash-completion berkdb bluetooth bzip2 cairo cddb cdr cjk cleartype cli clucene consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr encode exif fam ffmpeg firefox flac foomaticdb fortran gdbm geolocation gif gimp gphoto2 gpm graphviz gstreamer hal handbook iconv imagemagick inotify java java6 jpeg jpeg2k kde kpathsea lcdfilter lcms ldap lensfun libnotify mad mikmod mmap mmx mmxext mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf png ppds python qt3support qt4 quicktime raptor readline reflection samba sdl semantic-desktop session smp spell spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs syslog tcpd theora threads tiff truetype unicode usb v4l v4l2 vcd vdpau vorbis wifi wmf x264 xattr xcomposite xinerama xml xorg xpm xscreensaver xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="adc65 agfa_cl20 aox barbie canon casio_qv clicksmart310 digigr8 digita          dimagev dimera3500 directory enigma13 fuji gsmart300 hp215 iclick          jamcam jd11 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200          kodak_ez200 konica konica_qm150 largan lg_gsm mars mustek          panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859          pccam300 pccam600 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2          ricoh ricoh_g3 samsung sierra sipix_blink sipix_blink2 sipix_web2 smal          sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 stv0674 stv0680          sx330z template toshiba_pdrm11" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en en_GB fr" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 205

PostPosted: Mon Jul 19, 2010 3:53 pm    Post subject: Reply with quote

One more piece of information: The X server process consumes most of the cpu power during play back. The X server process needs 50%-60%, the mplayer process needs around 20%.
Back to top
View user's profile Send private message
maxime1986
n00b
n00b


Joined: 23 Oct 2009
Posts: 74

PostPosted: Mon Jul 19, 2010 5:08 pm    Post subject: Reply with quote

try to add
Code:
vc=ffh264vdpau,ffmpeg12vdpau,ffvc1vdpau,ffwmv3vdpau,

in your ~/.mplayer/config file

(no need to add "-vo vdpau" mplayer option ... the -vc option is sufficient)
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 205

PostPosted: Mon Jul 19, 2010 5:19 pm    Post subject: Reply with quote

Thanks for the answer, but this should not change anything. Anyway I tried it as you never know, what might happen, but has no effect.

This line in the mplayer's config file only allows me to ommit the explicit "-vo ... -vc ..." on the comand line.
Back to top
View user's profile Send private message
maxime1986
n00b
n00b


Joined: 23 Oct 2009
Posts: 74

PostPosted: Mon Jul 19, 2010 5:34 pm    Post subject: Reply with quote

I that the line just allows the omission of explicit "-vo ... -vc ..." on the command line (even without the line -vo is not needed).

It was more to test with over codec : ffmpeg12vdpau ffvc1vdpau ffwmv3vdpau .. not just ffh264vdpau

What does mplayer display when you launch an h264 movie ?
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 205

PostPosted: Mon Jul 19, 2010 5:50 pm    Post subject: Reply with quote

OK, sorry for that misunderstanding. Here the ouput for an H.264 video:

Code:

[mkv] Track-ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track-ID 2: audio (A_DTS) "DTS 5.1 @ 1510 kbps", -aid 0, -alang ger
[mkv] Track-ID 3: audio (A_DTS) "DTS 5.1 @ 1510 kbps", -aid 1, -alang eng
[mkv] Track-ID 4: subtitles (S_TEXT/UTF8), -sid 0, -slang eng
[mkv] Werde Video-Track 1 abspielen.
Matroska-Dateiformat erkannt!
VIDEO:  [avc1]  1920x1080  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Erzwungener Videocodec: ffh264vdpau
Öffne Videodecoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
Ausgewählter Videocodec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
==========================================================================
Öffne Audiodecoder: [libdca] DTS decoding with libdca
Stream with high frequencies VQ coding
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Ausgewählter Audiocodec: [dts] afm: libdca (DTS-libdca)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starte Wiedergabe...
[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
Film-Aspekt ist 1.78:1 - Vorskalierung zur Korrektur der Seitenverhältnisse.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration
A:   2.7 V:   2.7 A-V: -0.013 ct:  0.002   0/  0 12% 31%  5.6% 10 0


I do not have a 1080p WMV3 movie, but nonetheless the output is

Code:

ASF-Dateiformat erkannt!
[asfheader] Audiostream gefunden, -aid 1
[asfheader] Videostream gefunden, -vid 2
VIDEO:  [WMV3]  600x338  24bpp  1000.000 fps  800.0 kbps (97.7 kbyte/s)
Clip-Info:
 title: project
==========================================================================
Erzwungener Videocodec: ffh264vdpau
Erzwungener Videocodec: ffmpeg12vdpau
Erzwungener Videocodec: ffvc1vdpau
Erzwungener Videocodec: ffwmv3vdpau
Öffne Videodecoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] Versuche pixfmt=0.
Unsupported PixelFormat -1
Film-Aspekt ist undefiniert - keine Vorskalierung durchgeführt.
VO: [vdpau] 600x338 => 600x338 WMV3 VDPAU acceleration
[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
[VD_FFMPEG] Versuche pixfmt=0.
[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
Ausgewählter Videocodec: [ffwmv3vdpau] vfm: ffmpeg (FFmpeg WMV3/WMV9 (VDPAU))
==========================================================================
==========================================================================
Öffne Audiodecoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.81% (ratio: 12005->176400)
Ausgewählter Audiocodec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starte Wiedergabe...
A:  12.3 V:  12.3 A-V:  0.001 ct: -0.054 279/279  2% 16%  0.9% 0 0


Unfortunately I could not switch the language to English. MPlayer seems to ignore LC_ALL=C. But I hope you can guess, what each single line means. Most important in both cases you will find the lines

Quote:

[VD_FFMPEG] XVMC-beschleunigtes MPEG-2.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration
VO: [vdpau] 600x338 => 600x338 WMV3 VDPAU acceleration


"XVMC-beschleunigtes MPEG-2" is "XVMC-accelerated MPEG-2". So everything looks fine, but my cpu usage hits the sky.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Mon Jul 19, 2010 7:35 pm    Post subject: Reply with quote

nagmat84 wrote:
"XVMC-beschleunigtes MPEG-2" is "XVMC-accelerated MPEG-2". So everything looks fine, but my cpu usage hits the sky.
That message is bogus actually, XVMC is something completely different from VDPAU. A small but harmless bug in mplayer. Everything looks ok as far as I can tell, so whatever your problem is, mplayer's output doesn't show it. If no one here has a solution, you could try the nvnews.net forums. Nvidia folks post there regularly, including the VDPAU developer Stephen Warren.
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Mon Jul 19, 2010 9:29 pm    Post subject: Reply with quote

What version of mplayer? If not latest, did you try it? If yes, did you try SVN?
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum