You are not logged in.

#1 2013-09-21 23:08:45

aphirst
Member
From: Hull, England
Registered: 2008-06-30
Posts: 99
Website

[SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

EDIT 02/01/2014: Since mpv 0.3.0, the opengl renderer, which works perfectly fine with software-decoding, now also works with vaapi/vdpau hardware-decoding, so just setting vo=opengl and hwdec=auto should really be enough to utterly avoid the problems I was having back when I made this post. A lot of the "info" I gave later on in the thread is also actually bogus, I'll tweak that in a second.

---------------------------------------------
I've been reading the documentation for mpv, and there's something I can't quite figure out.

My CPU isn't especially powerful, so it's important for me to be able to use hardware acceleration where possible. I'm using the proprietary ATI driver; VLC works fine with VA-API, and since I discovered libvdpau-va-gl I've been able to get mpv to work using VDPAU. Obviously, some files (*cough*, Hi10P, *cough*) can't be hardware-accelerated, and this is where my problem/question comes in.

In my mpv config file, with

vo=vdpau

I'm able to play normal h.264 video effortlessly, but when HWaccel isn't available mpv falls back to software-decoding and software scaling (ffmpeg/swscaler, as per the console output). The problem is, with the CPU already working to decode the Hi10P content, my A-V desync skyrockets, and it's all a bit of a mess.

If I play the same Hi10P file with

vo=opengl

, then it doesn't desync at all. I checked the manpage and it says I can concatenate possible video outputs with a comma, and it will try each in turn. Obviously I'd like the not-hardware-decodable content to be rendered using OpenGL, rather than whatever causes them to get fed to "swscaler". So I set the config line to

vo=vdpau,opengl

. However - the opengl option never gets used! The non-HW-decodable files still end up being fed to swscaler, and as a result desync wildly, unless I manually set to opengl for that file.

Is someone here familiar enough with mpv to be able to explain why I might not be getting the behaviour I expect from listing multiple video outputs in the config file; or even better, how I can configure mpv to do what I actually want?

If there's somewhere else I should be asking this, please let me know. I couldn't find a dedicated mpv forum or anything (or even an IRC channel for questions), but I could have missed something.

Addition: Here are some console outputs.

1) Playing an 8-bit h.264 file with vo=vdpau, works fine

[cplayer] mpv 0.1.7 (C) 2000-2013 mpv/MPlayer/mplayer2 projects
 built on Fri Sep 20 22:59:56 CEST 2013
[cplayer] Compiled against libavutil version 52.38.100
[cplayer] Compiled against libavcodec version 55.18.102
[cplayer] Compiled against libavformat version 55.12.100
[cplayer] Compiled against libswscale version 2.3.100
[cfgparser] Reading config file /etc/mpv/mpv.conf
[cfgparser] : No such file or directory
[global] get_path('') -> '/home/adam/.mpv'
[global] get_path('config') -> '/home/adam/.mpv/config'
[cfgparser] Reading config file /home/adam/.mpv/config
[cplayer] Configuration: --prefix=/usr --confdir=/etc/mpv --disable-lircc --disable-joystick --disable-radio --disable-radio-capture --disable-radio-v4l2 --disable-rpath --disable-libbs2b --disable-direct3d --disable-corevideo --disable-cocoa --disable-coreaudio
[cplayer] Command line: 'La Maison en Petits Cubes [niizk].mkv' '-v'
[global] get_path('input.conf') -> '/home/adam/.mpv/input.conf'
[input] Falling back on default (hardcoded) input config
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[global] get_path('La Maison en Petits Cubes [niizk].mkv.conf') -> '/home/adam/.mpv/La Maison en Petits Cubes [niizk].mkv.conf'
[global] get_path('watch_later/4A9272824A37BC7D608AAD61487C41D9') -> '/home/adam/.mpv/watch_later/4A9272824A37BC7D608AAD61487C41D9'
[?1h=[cplayer] Playing La Maison en Petits Cubes [niizk].mkv.
[open] [file] File size is 251122130 bytes
[open] [stream] [file] La Maison en Petits Cubes [niizk].mkv
[demuxer] Trying demuxer: edl (force-level: normal)
[demuxer] Trying demuxer: cue (force-level: normal)
[demuxer] Trying demuxer: rawaudio (force-level: normal)
[demuxer] Trying demuxer: rawvideo (force-level: normal)
[demuxer] Trying demuxer: tv (force-level: normal)
[demuxer] Trying demuxer: libass (force-level: normal)
[demuxer] Trying demuxer: mkv (force-level: normal)
[demux] [mkv] Found the head...
[demux] [mkv] + a segment...
[demux] [mkv] /---- [ parsing seek head ] ---------
[demux] [mkv] |+ segment information...
[demux] [mkv] | + timecode scale: 1000000
[demux] [mkv] | + duration: 726.416s
[demux] [mkv] | + segment uid 86 10 81 37 4e ac f6 dd 91 4b 19 69 97 03 25 c9
[demux] [mkv] |+ segment tracks...
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 1
[demux] [mkv] |  + Name: Tsumiki no Ie - La Maison en Petits Cubes
[demux] [mkv] |  + Track type: Video
[demux] [mkv] |  + Video track
[demux] [mkv] |   + Display width: 853
[demux] [mkv] |   + Display height: 480
[demux] [mkv] |   + Pixel width: 704
[demux] [mkv] |   + Pixel height: 480
[demux] [mkv] |  + Codec ID: V_MPEG4/ISO/AVC
[demux] [mkv] |  + CodecPrivate, length 40
[demux] [mkv] |  + Language: und
[demux] [mkv] |  + Default flag: 1
[demux] [mkv] |  + Default duration: 33.367ms ( = 29.970 fps)
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 2
[demux] [mkv] |  + Name: 2.0 VORBIS
[demux] [mkv] |  + Track type: Audio
[demux] [mkv] |  + Audio track
[demux] [mkv] |   + Sampling frequency: 48000.000000
[demux] [mkv] |   + Channels: 2
[demux] [mkv] |  + Codec ID: A_VORBIS
[demux] [mkv] |  + CodecPrivate, length 3891
[demux] [mkv] |  + Language: und
[demux] [mkv] |  + Default flag: 1
[demux] [mkv] /---- [ parsing seek head ] ---------
[stream] stream_seek: Seek to/past EOF: no buffer preloaded.
[demux] [mkv] \---- [ parsing seek head ] ---------
[demux] [mkv] \---- [ parsing seek head ] ---------
[demux] [mkv] |+ found cluster, headers are parsed completely :)
[demux] [mkv] Aspect: 1.777083
[demux] [mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Tsumiki no Ie - La Maison en Petits Cubes"
[demux] [mkv] Track ID 2: audio (A_VORBIS) "2.0 VORBIS"
[demuxer] Detected file format: Matroska
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[subreader] Load subtitles in .
[global] get_path('sub/') -> '/home/adam/.mpv/sub/'
[cplayer] [stream] Video (+) --vid=0 'Tsumiki no Ie - La Maison en Petits Cubes' (h264)
[cplayer] [stream] Audio (+) --aid=0 (*) '2.0 VORBIS' (vorbis)
[cplayer] [V] fourcc:0x31637661  size:704x480  fps:29.970
[vo] X11 opening display: :0
[vo] vo: X11 running at 1366x768 (":0" => local display)
[vo] [x11] Detected wm supports NetWM.
[vo] [x11] Detected wm supports FULLSCREEN state.
[vo] [x11] Detected wm supports ABOVE state.
[vo] [x11] Detected wm supports BELOW state.
[vo] [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
[VS] Software VDPAU backend library initialized
[decvideo] Codec list:
[decvideo]     lavc:h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[decvideo]     lavc:h264_vdpau (h264) - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
[decvideo] Opening video decoder lavc:h264
[decvideo] Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
[vo] Disabling DPMS
[vo] DPMSDisable stat: 1
[decaudio] Codec list:
[decaudio]     lavc:vorbis - Vorbis
[decaudio]     lavc:libvorbis (vorbis) - libvorbis
[decaudio] Opening audio decoder lavc:vorbis
[decaudio] dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
[decaudio] INFO: libavcodec "vorbis" init OK!
[decaudio] Selected audio codec: Vorbis [lavc:vorbis]
[decaudio] AUDIO: 48000 Hz, 2 ch, floatle
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 0Hz empty 0ch ??...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[cplayer] AO: [pulse] 48000Hz stereo 2ch floatle
[cplayer] AO: Description: PulseAudio audio output
AO: Author: Lennart Poettering
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 48000Hz stereo 2ch floatle...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[cplayer] Starting playback...
[decvideo] Pixel formats supported by decoder: vaapi_vld vdpau yuv420p
[decvideo] Pixel formats supported by decoder: vaapi_vld vdpau yuv420p
[vo] X11 error: BadRequest (invalid request code or no such operation)
[vo] Type: 0, display: 0x2c2a190, resourceid: 17, serial: 23
[vo] Error code: 1, request code: a0, minor code: 1
[decvideo] [ffmpeg] aspect_ratio: 0.000000
[decvideo] VIDEO:  704x480  29.970 fps    0.0 kbps ( 0.0 kB/s)
[decvideo] VDec: vo config request - 704 x 480 (vdpau)
[vf] Trying filter chain:
[vf]  [vo] ???
[cplayer] Aspect ratio is 1.78:1 - scaling to correct movie aspect.
[cplayer] VO Config (704x480->853x480,flags=0,0x45C)
[cplayer] VO: [vdpau] 704x480 => 853x480 vdpau 
[cplayer] VO: Description: VDPAU with X11
[cplayer] VO: Author: Rajib Mahapatra <rmahapatra@nvidia.com> and others
[vo] [vdpau] Got display refresh rate 60.001 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
[vo] [vdpau] Updating CSC matrix
[vo] Window size: 853x480
[vo] Video source: 704x480 (853x480)
[vo] Video display: (0, 0) 704x480 -> (0, 0) 853x480
[vo] Video scale: 1.211648/1.000000
[vo] OSD borders: l=0 t=0 r=0 b=0
[vo] Video borders: l=0 t=0 r=0 b=0
[vo] [vdpau] Updating CSC matrix
[vf] Video filter chain:
[vf]  [vo] 704x480->853x480 vdpau 0 BT.601 (SD)/TV
[vo] [vdpau] Updating CSC matrix
[decaudio] Increasing filtered audio buffer size from 0 to 4096
[decaudio] Increasing filtered audio buffer size from 4096 to 69632
[decaudio] Increasing filtered audio buffer size from 69632 to 135168
[decaudio] Increasing filtered audio buffer size from 135168 to 200704
[decaudio] Increasing filtered audio buffer size from 200704 to 266240
[decaudio] Increasing filtered audio buffer size from 266240 to 331776
[decaudio] Increasing filtered audio buffer size from 331776 to 388096
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early

2) Playing a 10-bit file via vo=vdpau, desyncs and ultimately doesn't work properly:

[cplayer] mpv 0.1.7 (C) 2000-2013 mpv/MPlayer/mplayer2 projects
 built on Fri Sep 20 22:59:56 CEST 2013
[cplayer] Compiled against libavutil version 52.38.100
[cplayer] Compiled against libavcodec version 55.18.102
[cplayer] Compiled against libavformat version 55.12.100
[cplayer] Compiled against libswscale version 2.3.100
[cfgparser] Reading config file /etc/mpv/mpv.conf
[cfgparser] : No such file or directory
[global] get_path('') -> '/home/adam/.mpv'
[global] get_path('config') -> '/home/adam/.mpv/config'
[cfgparser] Reading config file /home/adam/.mpv/config
[cplayer] Configuration: --prefix=/usr --confdir=/etc/mpv --disable-lircc --disable-joystick --disable-radio --disable-radio-capture --disable-radio-v4l2 --disable-rpath --disable-libbs2b --disable-direct3d --disable-corevideo --disable-cocoa --disable-coreaudio
[cplayer] Command line: '[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv' '-v'
[global] get_path('input.conf') -> '/home/adam/.mpv/input.conf'
[input] Falling back on default (hardcoded) input config
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[global] get_path('[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.conf') -> '/home/adam/.mpv/[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.conf'
[global] get_path('watch_later/99B3F9726EDC41CCFA709D00925EB623') -> '/home/adam/.mpv/watch_later/99B3F9726EDC41CCFA709D00925EB623'
[?1h=[cplayer] Playing [ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.
[open] [file] File size is 397296634 bytes
[open] [stream] [file] [ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv
[demuxer] Trying demuxer: edl (force-level: normal)
[demuxer] Trying demuxer: cue (force-level: normal)
[demuxer] Trying demuxer: rawaudio (force-level: normal)
[demuxer] Trying demuxer: rawvideo (force-level: normal)
[demuxer] Trying demuxer: tv (force-level: normal)
[demuxer] Trying demuxer: libass (force-level: normal)
[demuxer] Trying demuxer: mkv (force-level: normal)
[demux] [mkv] Found the head...
[demux] [mkv] + a segment...
[demux] [mkv] /---- [ parsing seek head ] ---------
[demux] [mkv] |+ segment information...
[demux] [mkv] | + timecode scale: 1000000
[demux] [mkv] | + duration: 1633.640s
[demux] [mkv] | + segment uid b4 28 40 4c 87 1a 0e 65 a1 d8 4c d3 cc c3 96 ef
[demux] [mkv] |+ segment tracks...
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 1
[demux] [mkv] |  + Track type: Video
[demux] [mkv] |  + Video track
[demux] [mkv] |   + Display width: 1280
[demux] [mkv] |   + Display height: 720
[demux] [mkv] |   + Pixel width: 1280
[demux] [mkv] |   + Pixel height: 720
[demux] [mkv] |  + Codec ID: V_MPEG4/ISO/AVC
[demux] [mkv] |  + CodecPrivate, length 42
[demux] [mkv] |  + Default duration: 41.708ms ( = 23.976 fps)
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 2
[demux] [mkv] |  + Track type: Audio
[demux] [mkv] |  + Audio track
[demux] [mkv] |   + Sampling frequency: 48000.000000
[demux] [mkv] |   + Channels: 2
[demux] [mkv] |  + Codec ID: A_VORBIS
[demux] [mkv] |  + CodecPrivate, length 4036
[demux] [mkv] |  + Language: jpn
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 3
[demux] [mkv] |  + Name: Mazui
[demux] [mkv] |  + Track type: Subtitle
[demux] [mkv] |  + Codec ID: S_TEXT/ASS
[demux] [mkv] |  + CodecPrivate, length 2364
[demux] [mkv] /---- [ parsing chapters ] ---------
[demux] [mkv] New edition 0
[demux] [mkv] Default edition flag: 0
[demux] [mkv] Chapter 0 from 00:00:00.000 to 00:00:00.000, Prologue
[demux] [mkv] Chapter 1 from 00:01:29.89000000 to 00:00:00.000, Opening
[demux] [mkv] Chapter 2 from 00:02:59.179000000 to 00:00:00.000, Part A
[demux] [mkv] Chapter 3 from 00:13:20.800000000 to 00:00:00.000, Part B
[demux] [mkv] Chapter 4 from 00:25:37.536000000 to 00:00:00.000, Ending
[demux] [mkv] Chapter 5 from 00:27:07.626000000 to 00:00:00.000, Preview
[demux] [mkv] \---- [ parsing chapters ] ---------
[demux] [mkv] /---- [ parsing attachments ] ---------
[demux] [mkv] Attachment: arial.ttf, application/x-truetype-font, 774476 bytes
[demux] [mkv] Attachment: ARIAL_0.TTF, application/x-truetype-font, 774476 bytes
[demux] [mkv] Attachment: BALZANO.TTF, application/x-truetype-font, 51828 bytes
[demux] [mkv] Attachment: CronosPro-Capt.otf, application/x-truetype-font, 107976 bytes
[demux] [mkv] Attachment: NeoSansIntel.ttf, application/x-truetype-font, 63764 bytes
[demux] [mkv] Attachment: AbyssEPTitleFont.ttf, application/x-truetype-font, 79104 bytes
[demux] [mkv] Attachment: angeleobardo.ttf, application/x-truetype-font, 93660 bytes
[demux] [mkv] \---- [ parsing attachments ] ---------
[demux] [mkv] \---- [ parsing seek head ] ---------
[demux] [mkv] |+ found cluster, headers are parsed completely :)
[demux] [mkv] Aspect: 1.777778
[demux] [mkv] Track ID 1: video (V_MPEG4/ISO/AVC)
[demux] [mkv] Track ID 2: audio (A_VORBIS)
[demux] [mkv] Track ID 3: subtitles (S_TEXT/ASS) "Mazui"
[demuxer] Detected file format: Matroska
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[subreader] Load subtitles in .
[global] get_path('sub/') -> '/home/adam/.mpv/sub/'
[cplayer] [stream] Video (+) --vid=0 (h264)
[cplayer] [stream] Audio (+) --aid=0 --alang=jpn (*) (vorbis)
[cplayer] [stream] Subs  (+) --sid=0 --slang=eng (*) 'Mazui' (ass)
[cplayer] [V] fourcc:0x31637661  size:1280x720  fps:23.976
[vo] X11 opening display: :0
[vo] vo: X11 running at 1366x768 (":0" => local display)
[vo] [x11] Detected wm supports NetWM.
[vo] [x11] Detected wm supports FULLSCREEN state.
[vo] [x11] Detected wm supports ABOVE state.
[vo] [x11] Detected wm supports BELOW state.
[vo] [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
[VS] Software VDPAU backend library initialized
[decvideo] Codec list:
[decvideo]     lavc:h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[decvideo]     lavc:h264_vdpau (h264) - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
[decvideo] Opening video decoder lavc:h264
[decvideo] Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
[vo] Disabling DPMS
[vo] DPMSDisable stat: 1
[decaudio] Codec list:
[decaudio]     lavc:vorbis - Vorbis
[decaudio]     lavc:libvorbis (vorbis) - libvorbis
[decaudio] Opening audio decoder lavc:vorbis
[decaudio] dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
[decaudio] INFO: libavcodec "vorbis" init OK!
[decaudio] Selected audio codec: Vorbis [lavc:vorbis]
[decaudio] AUDIO: 48000 Hz, 2 ch, floatle
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 0Hz empty 0ch ??...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[cplayer] AO: [pulse] 48000Hz stereo 2ch floatle
[cplayer] AO: Description: PulseAudio audio output
AO: Author: Lennart Poettering
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 48000Hz stereo 2ch floatle...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[osd] Subtitle filter chain: ass (ass)
[cplayer] Starting playback...
[decvideo] [ffmpeg/h264] get_buffer() failed
[decvideo] [ffmpeg/h264] thread_get_buffer() failed
[decvideo] [ffmpeg/h264] decode_slice_header error
[decvideo] [ffmpeg/h264] no frame!
[decvideo] Error while decoding frame!
[decvideo] Error using hardware decoding, falling back to software decoding.
[decvideo] [ffmpeg] aspect_ratio: 0.000000
[decvideo] VIDEO:  1280x720  23.976 fps    0.0 kbps ( 0.0 kB/s)
[decvideo] VDec: vo config request - 1280 x 720 (420p10)
[vf] Trying filter chain:
[vf]  [vo] ???
[decvideo] Could not find matching colorspace - retrying with -vf scale...
[vf] Opening video filter: [scale]
[vf] SwScale params: -1 x -1 (-1=no scaling)
[vf] Trying filter chain:
[vf]  [scale] ??? -> ???
[vf]  [vo] ???
[cplayer] VO Config (1280x720->1280x720,flags=0,0x409)
[global] [ffmpeg/swscaler] using unscaled yuv420p10le -> yuv420p special converter
[cplayer] VO: [vdpau] 1280x720 => 1280x720 420p 
[cplayer] VO: Description: VDPAU with X11
[cplayer] VO: Author: Rajib Mahapatra <rmahapatra@nvidia.com> and others
[vo] [vdpau] Got display refresh rate 60.001 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
[vo] [vdpau] Updating CSC matrix
[vo] Window size: 1280x720
[vo] Video source: 1280x720 (1280x720)
[vo] Video display: (0, 0) 1280x720 -> (0, 0) 1280x720
[vo] Video scale: 1.000000/1.000000
[vo] OSD borders: l=0 t=0 r=0 b=0
[vo] Video borders: l=0 t=0 r=0 b=0
[vo] [vdpau] Updating CSC matrix
[vf] Video filter chain:
[vf]  [scale] 1280x720 420p10 0 BT.709 (HD)/TV -> 1280x720 420p 0 BT.709 (HD)/TV
[vf]  [vo] 1280x720 420p 0 BT.709 (HD)/TV
[vo] [vdpau] Updating CSC matrix
[decaudio] Increasing filtered audio buffer size from 0 to 4096
[decaudio] Increasing filtered audio buffer size from 4096 to 69632
[decaudio] Increasing filtered audio buffer size from 69632 to 135168
[decaudio] Increasing filtered audio buffer size from 135168 to 200704
[decaudio] Increasing filtered audio buffer size from 200704 to 266240
[decaudio] Increasing filtered audio buffer size from 266240 to 331776
[decaudio] Increasing filtered audio buffer size from 331776 to 388096
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early
[vo] [vdpau] Frame shown too early

3) Playing a 10-bit file through vo=opengl, works fine

[cplayer] mpv 0.1.7 (C) 2000-2013 mpv/MPlayer/mplayer2 projects
 built on Fri Sep 20 22:59:56 CEST 2013
[cplayer] Compiled against libavutil version 52.38.100
[cplayer] Compiled against libavcodec version 55.18.102
[cplayer] Compiled against libavformat version 55.12.100
[cplayer] Compiled against libswscale version 2.3.100
[cfgparser] Reading config file /etc/mpv/mpv.conf
[cfgparser] : No such file or directory
[global] get_path('') -> '/home/adam/.mpv'
[global] get_path('config') -> '/home/adam/.mpv/config'
[cfgparser] Reading config file /home/adam/.mpv/config
[cplayer] Configuration: --prefix=/usr --confdir=/etc/mpv --disable-lircc --disable-joystick --disable-radio --disable-radio-capture --disable-radio-v4l2 --disable-rpath --disable-libbs2b --disable-direct3d --disable-corevideo --disable-cocoa --disable-coreaudio
[cplayer] Command line: '[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv' '-v'
[global] get_path('input.conf') -> '/home/adam/.mpv/input.conf'
[input] Falling back on default (hardcoded) input config
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('fonts') -> '/home/adam/.mpv/fonts'
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[global] get_path('[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.conf') -> '/home/adam/.mpv/[ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.conf'
[global] get_path('watch_later/99B3F9726EDC41CCFA709D00925EB623') -> '/home/adam/.mpv/watch_later/99B3F9726EDC41CCFA709D00925EB623'
[?1h=[cplayer] Playing [ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv.
[open] [file] File size is 397296634 bytes
[open] [stream] [file] [ANE] Ore no Imouto ga Konna ni Kawaii Wake ga Nai - Ep01 [BDRip 720p x264 Vorbis].mkv
[demuxer] Trying demuxer: edl (force-level: normal)
[demuxer] Trying demuxer: cue (force-level: normal)
[demuxer] Trying demuxer: rawaudio (force-level: normal)
[demuxer] Trying demuxer: rawvideo (force-level: normal)
[demuxer] Trying demuxer: tv (force-level: normal)
[demuxer] Trying demuxer: libass (force-level: normal)
[demuxer] Trying demuxer: mkv (force-level: normal)
[demux] [mkv] Found the head...
[demux] [mkv] + a segment...
[demux] [mkv] /---- [ parsing seek head ] ---------
[demux] [mkv] |+ segment information...
[demux] [mkv] | + timecode scale: 1000000
[demux] [mkv] | + duration: 1633.640s
[demux] [mkv] | + segment uid b4 28 40 4c 87 1a 0e 65 a1 d8 4c d3 cc c3 96 ef
[demux] [mkv] |+ segment tracks...
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 1
[demux] [mkv] |  + Track type: Video
[demux] [mkv] |  + Video track
[demux] [mkv] |   + Display width: 1280
[demux] [mkv] |   + Display height: 720
[demux] [mkv] |   + Pixel width: 1280
[demux] [mkv] |   + Pixel height: 720
[demux] [mkv] |  + Codec ID: V_MPEG4/ISO/AVC
[demux] [mkv] |  + CodecPrivate, length 42
[demux] [mkv] |  + Default duration: 41.708ms ( = 23.976 fps)
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 2
[demux] [mkv] |  + Track type: Audio
[demux] [mkv] |  + Audio track
[demux] [mkv] |   + Sampling frequency: 48000.000000
[demux] [mkv] |   + Channels: 2
[demux] [mkv] |  + Codec ID: A_VORBIS
[demux] [mkv] |  + CodecPrivate, length 4036
[demux] [mkv] |  + Language: jpn
[demux] [mkv] | + a track...
[demux] [mkv] |  + Track number: 3
[demux] [mkv] |  + Name: Mazui
[demux] [mkv] |  + Track type: Subtitle
[demux] [mkv] |  + Codec ID: S_TEXT/ASS
[demux] [mkv] |  + CodecPrivate, length 2364
[demux] [mkv] /---- [ parsing chapters ] ---------
[demux] [mkv] New edition 0
[demux] [mkv] Default edition flag: 0
[demux] [mkv] Chapter 0 from 00:00:00.000 to 00:00:00.000, Prologue
[demux] [mkv] Chapter 1 from 00:01:29.89000000 to 00:00:00.000, Opening
[demux] [mkv] Chapter 2 from 00:02:59.179000000 to 00:00:00.000, Part A
[demux] [mkv] Chapter 3 from 00:13:20.800000000 to 00:00:00.000, Part B
[demux] [mkv] Chapter 4 from 00:25:37.536000000 to 00:00:00.000, Ending
[demux] [mkv] Chapter 5 from 00:27:07.626000000 to 00:00:00.000, Preview
[demux] [mkv] \---- [ parsing chapters ] ---------
[demux] [mkv] /---- [ parsing attachments ] ---------
[demux] [mkv] Attachment: arial.ttf, application/x-truetype-font, 774476 bytes
[demux] [mkv] Attachment: ARIAL_0.TTF, application/x-truetype-font, 774476 bytes
[demux] [mkv] Attachment: BALZANO.TTF, application/x-truetype-font, 51828 bytes
[demux] [mkv] Attachment: CronosPro-Capt.otf, application/x-truetype-font, 107976 bytes
[demux] [mkv] Attachment: NeoSansIntel.ttf, application/x-truetype-font, 63764 bytes
[demux] [mkv] Attachment: AbyssEPTitleFont.ttf, application/x-truetype-font, 79104 bytes
[demux] [mkv] Attachment: angeleobardo.ttf, application/x-truetype-font, 93660 bytes
[demux] [mkv] \---- [ parsing attachments ] ---------
[demux] [mkv] \---- [ parsing seek head ] ---------
[demux] [mkv] |+ found cluster, headers are parsed completely :)
[demux] [mkv] Aspect: 1.777778
[demux] [mkv] Track ID 1: video (V_MPEG4/ISO/AVC)
[demux] [mkv] Track ID 2: audio (A_VORBIS)
[demux] [mkv] Track ID 3: subtitles (S_TEXT/ASS) "Mazui"
[demuxer] Detected file format: Matroska
[global] get_path('subfont.ttf') -> '/home/adam/.mpv/subfont.ttf'
[global] get_path('fonts.conf') -> '/home/adam/.mpv/fonts.conf'
[ass] [ass] Setting up fonts...
[ass] [ass] Done.
[subreader] Load subtitles in .
[global] get_path('sub/') -> '/home/adam/.mpv/sub/'
[cplayer] [stream] Video (+) --vid=0 (h264)
[cplayer] [stream] Audio (+) --aid=0 --alang=jpn (*) (vorbis)
[cplayer] [stream] Subs  (+) --sid=0 --slang=eng (*) 'Mazui' (ass)
[cplayer] [V] fourcc:0x31637661  size:1280x720  fps:23.976
[vo] X11 opening display: :0
[vo] vo: X11 running at 1366x768 (":0" => local display)
[vo] [x11] Detected wm supports NetWM.
[vo] [x11] Detected wm supports FULLSCREEN state.
[vo] [x11] Detected wm supports ABOVE state.
[vo] [x11] Detected wm supports BELOW state.
[vo] [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
[vo] [gl] GLX chose visual with ID 0x29
[vo] [gl] Detected OpenGL 3.0.
[vo] GL_VENDOR='ATI Technologies Inc.'
[vo] GL_RENDERER='AMD Radeon HD 7340 Graphics'
[vo] GL_VERSION='3.0.12441 Compatibility Profile Context 13.20.11'
[vo] GL_SHADING_LANGUAGE_VERSION='4.30'
[vo] [gl] OpenGL legacy compat. found.
[vo] [gl] Detected OpenGL features: [Basic OpenGL] [Legacy OpenGL] [OpenGL 2.0] [OpenGL 2.1] [OpenGL 3.0] [Framebuffers] [VAOs] [sRGB textures] [sRGB framebuffers] [Float textures] [RG textures] [NO_SW]
[vo/opengl] Testing user-set FBO format
[vo/opengl] Create FBO: 16x16
[vo/opengl]    8-bit precision: 0x0p+0
[vo/opengl]    16-bit precision: 0x1.0001p-9
[vo/opengl]    full float: 0x1.01p-9
[vo/opengl]    out of range value (2): 0x1p+0
[vo/opengl] Display depth: R=8, G=8, B=8
[vo/opengl] Testing user-set FBO format
[vo/opengl] Create FBO: 16x16
[vo/opengl]    8-bit precision: 0x0p+0
[vo/opengl]    16-bit precision: 0x1.0001p-9
[vo/opengl]    full float: 0x1.01p-9
[vo/opengl]    out of range value (2): 0x1p+0
[vo/opengl] Reinit rendering.
[decvideo] Codec list:
[decvideo]     lavc:h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[decvideo]     lavc:h264_vdpau (h264) - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
[decvideo] Opening video decoder lavc:h264
[decvideo] Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
[vo] Disabling DPMS
[vo] DPMSDisable stat: 1
[decaudio] Codec list:
[decaudio]     lavc:vorbis - Vorbis
[decaudio]     lavc:libvorbis (vorbis) - libvorbis
[decaudio] Opening audio decoder lavc:vorbis
[decaudio] dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer.
[decaudio] INFO: libavcodec "vorbis" init OK!
[decaudio] Selected audio codec: Vorbis [lavc:vorbis]
[decaudio] AUDIO: 48000 Hz, 2 ch, floatle
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 0Hz empty 0ch ??...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 0Hz empty 0ch ??
[cplayer] AO: [pulse] 48000Hz stereo 2ch floatle
[cplayer] AO: Description: PulseAudio audio output
AO: Author: Lennart Poettering
[decaudio] Building audio filter chain for 48000Hz stereo 2ch floatle -> 48000Hz stereo 2ch floatle...
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatle
[af]   [out] 48000Hz stereo 2ch floatle
[af]   [ao] 48000Hz stereo 2ch floatle
[osd] Subtitle filter chain: ass (ass)
[cplayer] Starting playback...
[decvideo] [ffmpeg] aspect_ratio: 0.000000
[decvideo] VIDEO:  1280x720  23.976 fps    0.0 kbps ( 0.0 kB/s)
[decvideo] VDec: vo config request - 1280 x 720 (420p10)
[vf] Trying filter chain:
[vf]  [vo] ???
[cplayer] VO Config (1280x720->1280x720,flags=0,0x409)
[cplayer] VO: [opengl] 1280x720 => 1280x720 420p10 
[cplayer] VO: Description: Extended OpenGL Renderer
[cplayer] VO: Author: Based on vo_gl.c by Reimar Doeffinger
[vo/opengl] Testing user-set FBO format
[vo/opengl] Create FBO: 16x16
[vo/opengl]    8-bit precision: 0x0p+0
[vo/opengl]    16-bit precision: 0x1.0001p-9
[vo/opengl]    full float: 0x1.01p-9
[vo/opengl]    out of range value (2): 0x1p+0
[vo/opengl] Texture for plane 0: 1280x720
[vo/opengl] Texture for plane 1: 640x360
[vo/opengl] Texture for plane 2: 640x360
[vo/opengl] Reinit rendering.
[vo/opengl] compiling shader program 'frag_osd_libass', header:
[vo/opengl] compiling shader program 'frag_osd_rgba', header:
[vo/opengl] compiling shader program 'final', header:
[vo/opengl] [  1] #define SAMPLE_L sample_bilinear
[vo/opengl] [  2] #define USE_CONV CONV_PLANAR
[vo/opengl] [  3] #define USE_COLORMATRIX 1
[vo/opengl] [  4] #define SAMPLE_C sample_bilinear
[vo/opengl] Resize: 1280x720
[vo] Window size: 1280x720
[vo] Video source: 1280x720 (1280x720)
[vo] Video display: (0, 0) 1280x720 -> (0, 0) 1280x720
[vo] Video scale: 1.000000/1.000000
[vo] OSD borders: l=0 t=0 r=0 b=0
[vo] Video borders: l=0 t=0 r=0 b=0
[vf] Video filter chain:
[vf]  [vo] 1280x720 420p10 0 BT.709 (HD)/TV
[decaudio] Increasing filtered audio buffer size from 0 to 4096
[decaudio] Increasing filtered audio buffer size from 4096 to 69632
[decaudio] Increasing filtered audio buffer size from 69632 to 135168
[decaudio] Increasing filtered audio buffer size from 135168 to 200704
[decaudio] Increasing filtered audio buffer size from 200704 to 266240
[decaudio] Increasing filtered audio buffer size from 266240 to 331776
[decaudio] Increasing filtered audio buffer size from 331776 to 388096

Last edited by aphirst (2014-01-02 23:20:53)


ArchLinux | x86_64 | linux-ck-ivybridge
ThinkPad X230 | 12.5" | i5-3320M (2.5GHz) | HD 4000 | 16GB (1600MHz) | 256GB mSATA SSD | 2TB HDD
ThinkPad T430 | 14.1" | i7-3520M (2.9GHz) | GF108M (NVS 5400M) | 16GB (1600MHz) | 256GB mSATA SSD | 1TB HDD | 500GB HDD

Offline

#2 2013-09-22 08:56:09

sekret
Member
Registered: 2013-07-22
Posts: 303

Re: [SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

I don't know how to solve this, but I can say, that the author of mpv was very responsive and helpful on IRC when I had a problem. I'm sure he'll know what to do!

Please post the solution here!

Offline

#3 2013-09-22 12:41:26

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: [SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

You need to define hwdec=vdpau for example also.


Use the Source, Luke!

Offline

#4 2013-09-22 13:14:53

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: [SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

While it's not a proper solution, you can try to use sws=0 option, it uses a faster scaling algorithm.


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#5 2013-09-22 13:48:03

aphirst
Member
From: Hull, England
Registered: 2008-06-30
Posts: 99
Website

Re: [SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

So, I had a nice long conversation last night with some of the devs on the IRC channel (that I didn't find first-time-round somehow). I'll summarise this in bullet points:

>I'm using an ATI card with the proprietary driver
>I'm exposing VDPAU via a library that uses VA-API underneath
>the vo_vdpau mode for mpv continues to handle file playback even if the vdpau hardware decoder won't initialise
>>i.e. vdpau itself calls the software decoder, and then handles the calls to a software renderer
>because I'm using VDPAU in an indirect "wheels within wheels" library, it's slow as all hell

Solution:

UPDATE: READ THE POST BELOW, A BETTER SOLUTION HAS BEEN IMPLEMENTED
>mpv-git has native VA-API support, vo_vaapi
>compiling and using this works perfectly
>the vaapi handler is able to much more efficiently handle the calls to software decoders/renderers
>8bit h.264 files play fullspeed using hardware decoding
>10bit h.264 files are automatically handed to software-decoding, and play (almost!) as well as they should (i.e. when directly calling vo_opengl or vo_xv)
Note that it's still a little slower than using opengl or xv, which is kind of odd. wm4 on IRC mentioned he might be able to do something about this, by implementing the (hackish, apparently) thing that VLC does, so that vo_vaapi doesn't have to use swscale (slow) before rendering; but I'll wait and see if that pans out.

TL;DR - People using the proprietary ATI driver should compile mpv-git and and use vo=vaapi

@Roberth: I actually did have that enabled, but whether it was or wasn't enabled didn't affect the problem I was having. After all, the problem was with vo_vdpau calling software decoding in an inefficient, roundabout way. vo_vaapi still isn't as efficient at this as it should be, it seems, but it's better than vo_vdpau was on my setup.

@kaszak696: As far as I was aware, sws=0 was the default behaviour, but I do recall forcing that at one point with no effect. Either way, my particular problem is solved/worked around now! Well, almost.

Last edited by aphirst (2013-09-22 23:38:35)


ArchLinux | x86_64 | linux-ck-ivybridge
ThinkPad X230 | 12.5" | i5-3320M (2.5GHz) | HD 4000 | 16GB (1600MHz) | 256GB mSATA SSD | 2TB HDD
ThinkPad T430 | 14.1" | i7-3520M (2.9GHz) | GF108M (NVS 5400M) | 16GB (1600MHz) | 256GB mSATA SSD | 1TB HDD | 500GB HDD

Offline

#6 2013-09-22 23:36:40

aphirst
Member
From: Hull, England
Registered: 2008-06-30
Posts: 99
Website

Re: [SOLVED] [mpv] Fallback to software decode SLOW with vo_vdpau/vaapi

EDIT 02/01/2014: The readback functionality is now basically deprecated, if you use vo_opengl and vdpau (FOSS AMD) or vaapi (Intel) hwdec things should "just work". I think vaapi (Catalyst) still has some use for the readback (the vaapi-opengl interop is mesa only, I think), but I wouldn't be surprised if that changes.

-----------------------------------------------------------

A more full solution has been implemented by wm4 in the branch vaapi-readback, which allows vo drivers like opengl to access the hardware decoders, by copying decoded frames back to RAM. I think that's how it works, anyway. Either way; it does definitely work.

If you build the mpv-git package from the AUR, and change master to vaapi-readback; and then set --vo=opengl --hwdec=auto when running mpv; then all these problems disappear, and the automatic handling works in the way I had initially assumed it would, with the performance to match.

wm4 insists that doing things this way is intrinsically inefficient, and that his current implementation is also less efficient than it possibly could be. He(she?) says that using this copyback method will probably actually be slower on desktop machines; but I imagine that on netbooks/nettops with weak CPUs (but with hardware-decoders), this is just the ticket. I'm happy, at least.

I think it was also said that this may find its way into the main branch, but then the IRC discussion went to discussing the "proper" ways of doing this with vaapi/vdpau, and I imagine that's where most future effort will (and probably should) go.

Last edited by aphirst (2014-01-02 23:24:18)


ArchLinux | x86_64 | linux-ck-ivybridge
ThinkPad X230 | 12.5" | i5-3320M (2.5GHz) | HD 4000 | 16GB (1600MHz) | 256GB mSATA SSD | 2TB HDD
ThinkPad T430 | 14.1" | i7-3520M (2.9GHz) | GF108M (NVS 5400M) | 16GB (1600MHz) | 256GB mSATA SSD | 1TB HDD | 500GB HDD

Offline

Board footer

Powered by FluxBB