New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong color while playing 4K HDR video with vaapi #4555

Closed
JulianLai opened this Issue Jun 27, 2017 · 29 comments

Comments

Projects
None yet
8 participants
@JulianLai

JulianLai commented Jun 27, 2017

mpv version and platform

mpv 0.25.0-225-g4abd5683d5 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Sat Jun 24 21:26:45 CST 2017
ffmpeg library versions:
   libavutil       55.58.100
   libavcodec      57.89.100
   libavformat     57.71.100
   libswscale      4.6.100
   libavfilter     6.82.100
   libswresample   2.7.100
ffmpeg version: 3.3.2

mpv-shot0001
mpv-shot0002

Log file

[cplayer] Command line options: '-v' '--hwdec=vaapi' 'Sony_4K_HDR_Camp.mp4'
[cplayer] mpv 0.25.0-225-g4abd5683d5 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sat Jun 24 21:26:45 CST 2017
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       55.58.100
[cplayer]    libavcodec      57.89.100
[cplayer]    libavformat     57.71.100
[cplayer]    libswscale      4.6.100
[cplayer]    libavfilter     6.82.100
[cplayer]    libswresample   2.7.100
[cplayer] ffmpeg version: 3.3.2
[cplayer] 
[cplayer] Configuration: ./waf configure --prefix=/usr --confdir=/etc/mpv --enable-zsh-comp --enable-libmpv-shared
[cplayer] List of enabled features: 52arch alsa asm atomics audio-input avutil-imgcpy-uc build-date caca cplayer cplugins cuda-hwaccel debug-build dlopen drm egl-drm egl-helpers egl-x11 encoding fchmod gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name glob gnuc iconv is_ffmpeg jack jpeg lcms2 libass libass-osd libav libavcodec libavdevice libbluray libdl libm libmpv-shared librt libv4l2 linux-fstatfs lua nanosleep optimize oss-audio plain-gl posix posix-or-mingw posix-spawn pthreads pulse rubberband shm stdatomic subprocess termios tv tv-v4l2 uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-hwaccel vaapi-wayland vaapi-x-egl vaapi-x11 vapoursynth vapoursynth-core vapoursynth-lazy vdpau vdpau-gl-x11 vdpau-hwaccel videodev vt.h wayland x11 xv zlib zsh-comp
[global] config path: '' -> '/home/laichiaheng/.config/mpv'
[global] config path: 'mpv.conf' -> '/home/laichiaheng/.config/mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/laichiaheng/.config/mpv/config'
[global] config path: 'mpv.conf' -/-> '/home/laichiaheng/.mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/laichiaheng/.mpv/config'
[global] config path: 'mpv.conf' -/-> '/etc/mpv/mpv.conf'
[global] config path: 'config' -/-> '/etc/mpv/config'
[cplayer] Reading config file /home/laichiaheng/.config/mpv/mpv.conf
[cplayer] Setting option 'audio-file-auto' = 'fuzzy' (flags = 4)
[cplayer] Setting option 'sub-auto' = 'fuzzy' (flags = 4)
[cplayer] Setting option 'sub-font' = 'AR PL UKai TW' (flags = 4)
[cplayer] Setting option 'sub-border-size' = '1.5' (flags = 4)
[cplayer] Setting option 'stretch-image-subs-to-screen' = 'yes' (flags = 4)
[cplayer] Setting option 'fs' = '' (flags = 4)
[cplayer] Setting option 'sub-use-margins' = 'no' (flags = 4)
[cplayer] Setting option 'sub-bold' = 'yes' (flags = 4)
[cplayer] Setting option 'sub-shadow-offset' = '1.0' (flags = 4)
[cplayer] Setting option 'sub-shadow-color' = '0.0/0.0/0.0/0.75' (flags = 4)
[cplayer] Setting option 'script-opts' = 'autospeed-xrandr=true,autospeed-osd=true,autospeed-spause=2' (flags = 4)
[cplayer] Setting option 'video-sync' = 'display-resample' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 8)
[global] config path: 'input.conf' -/-> '/home/laichiaheng/.config/mpv/input.conf'
[global] config path: 'input.conf' -/-> '/home/laichiaheng/.mpv/input.conf'
[global] config path: 'input.conf' -/-> '/etc/mpv/input.conf'
[osc] Loading lua script @osc.lua...
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[osc] loading mp.defaults
[osc] loading @osc.lua
[global] config path: 'lua-settings/osc.conf' -/-> '/home/laichiaheng/.config/mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/home/laichiaheng/.mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/etc/mpv/lua-settings/osc.conf'
[osc] lua-settings/osc.conf not found. 
[cplayer] Run command: define-section, flags=0, args=[showhide, mouse_move script-binding osc/__keybinding1
[cplayer] mouse_leave script-binding osc/__keybinding2
[cplayer] , force]
[cplayer] Run command: enable-section, flags=0, args=[showhide, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input, mouse_btn0 script-binding osc/__keybinding3
[cplayer] shift+mouse_btn0 script-binding osc/__keybinding4
[cplayer] mouse_btn2 script-binding osc/__keybinding5
[cplayer] mouse_btn3 script-binding osc/__keybinding6
[cplayer] mouse_btn4 script-binding osc/__keybinding7
[cplayer] axis_up script-binding osc/__keybinding8
[cplayer] axis_down script-binding osc/__keybinding9
[cplayer] mouse_btn0_dbl ignore
[cplayer] shift+mouse_btn0_dbl ignore
[cplayer] mouse_btn2_dbl ignore
[cplayer] , force]
[cplayer] Run command: enable-section, flags=0, args=[input, ]
[cplayer] Run command: define-section, flags=0, args=[input_osc, del script-binding osc/__keybinding10
[cplayer] , default]
[cplayer] Run command: enable-section, flags=0, args=[input_osc, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_forced_osc, , force]
[cplayer] Run command: enable-section, flags=0, args=[input_forced_osc, allow-hide-cursor+allow-vo-dragging]
[cplayer] Done loading @osc.lua.
[ytdl_hook] Loading lua script @ytdl_hook.lua...
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[ytdl_hook] loading mp.defaults
[cplayer] Run command: disable-section, flags=0, args=[input]
[global] config path: 'fonts' -/-> '/home/laichiaheng/.config/mpv/fonts'
[global] config path: 'fonts' -/-> '/home/laichiaheng/.mpv/fonts'
[global] config path: 'fonts' -/-> '/etc/mpv/fonts'
[osd/libass] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.4.6 (COMPLEX)
[global] config path: 'subfont.ttf' -/-> '/home/laichiaheng/.config/mpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/home/laichiaheng/.mpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/etc/mpv/subfont.ttf'
[global] config path: 'fonts.conf' -/-> '/home/laichiaheng/.config/mpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/home/laichiaheng/.mpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/etc/mpv/fonts.conf'
[osd/libass] Setting up fonts...
[ytdl_hook] loading @ytdl_hook.lua
[cplayer] Run command: hook-add, flags=0, args=[on_load, 1, 10]
[cplayer] Run command: hook-add, flags=0, args=[on_preloaded, 2, 10]
[cplayer] Done loading @ytdl_hook.lua.
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[stats] Loading lua script /home/laichiaheng/.config/mpv/scripts/stats.lua...
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[stats] loading mp.defaults
[stats] loading file /home/laichiaheng/.config/mpv/scripts/stats.lua
[global] config path: 'lua-settings/stats.conf' -/-> '/home/laichiaheng/.config/mpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/home/laichiaheng/.mpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/etc/mpv/lua-settings/stats.conf'
[stats] lua-settings/stats.conf not found. 
[cplayer] Run command: define-section, flags=0, args=[input_stats, i script-binding stats/display_stats
[cplayer] , default]
[cplayer] Run command: enable-section, flags=0, args=[input_stats, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_forced_stats, , force]
[cplayer] Run command: enable-section, flags=0, args=[input_forced_stats, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_stats, i script-binding stats/display_stats
[cplayer] I script-binding stats/display_stats_toggle
[cplayer] , default]
[cplayer] Run command: enable-section, flags=0, args=[input_stats, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_forced_stats, , force]
[cplayer] Run command: enable-section, flags=0, args=[input_forced_stats, allow-hide-cursor+allow-vo-dragging]
[cplayer] Done loading /home/laichiaheng/.config/mpv/scripts/stats.lua.
[autospeed] Loading lua script /home/laichiaheng/.config/mpv/scripts/autospeed.lua...
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[autospeed] loading mp.defaults
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[autospeed] loading file /home/laichiaheng/.config/mpv/scripts/autospeed.lua
[cplayer] Done loading /home/laichiaheng/.config/mpv/scripts/autospeed.lua.
[auto_profiles] Loading lua script /home/laichiaheng/.config/mpv/scripts/auto-profiles.lua...
[global] config path: 'scripts' -> '/home/laichiaheng/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/laichiaheng/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[auto_profiles] loading mp.defaults
[auto_profiles] loading file /home/laichiaheng/.config/mpv/scripts/auto-profiles.lua
[auto_profiles] Re-evaluate auto profile Below 540p 
[auto_profiles] Error evaluating: [string "profile Below 540p condition"]:1: attempt to compare nil with number 
[auto_profiles] Re-evaluate auto profile 720p 
[auto_profiles] Re-evaluate auto profile 704p 
[auto_profiles] Re-evaluate auto profile 800p 
[auto_profiles] Re-evaluate auto profile 808p 
[auto_profiles] Re-evaluate auto profile 1040p 
[auto_profiles] Re-evaluate auto profile 1080p 
[auto_profiles] Re-evaluate auto profile Above 1080 
[cplayer] Done loading /home/laichiaheng/.config/mpv/scripts/auto-profiles.lua.
[global] config path: 'watch_later' -> '/home/laichiaheng/.config/mpv/watch_later'
[cplayer] Playing: Sony_4K_HDR_Camp.mp4
[cplayer] Running hook: ytdl_hook/on_load
[cplayer] Run command: hook-ack, flags=0, args=[on_load]
[bdmv/bluray] Opening Sony_4K_HDR_Camp.mp4
[file] Opening Sony_4K_HDR_Camp.mp4
[file] Stream opened successfully.
[demux] Trying demuxers for level=normal.
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: Sony_4K_HDR_Camp.mp4
[find_files] Loading external files in .
[global] config path: 'sub' -/-> '/home/laichiaheng/.config/mpv/sub'
[global] config path: 'sub' -/-> '/home/laichiaheng/.mpv/sub'
[global] config path: 'sub' -/-> '/etc/mpv/sub'
[global] config path: 'audio' -/-> '/home/laichiaheng/.config/mpv/audio'
[global] config path: 'audio' -/-> '/home/laichiaheng/.mpv/audio'
[global] config path: 'audio' -/-> '/etc/mpv/audio'
[cplayer] Running hook: ytdl_hook/on_preloaded
[cplayer] Run command: hook-ack, flags=0, args=[on_preloaded]
[cplayer]  (+) Video --vid=1 (*) (hevc 3840x2160 59.940fps)
[cplayer]  (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[vo/opengl] Initializing OpenGL backend 'x11probe'
[vo/opengl/x11] X11 opening display: :0
[vo/opengl/x11] X11 running at 1920x1080 (":0" => local display)
[vo/opengl/x11] Detected wm supports NetWM.
[vo/opengl/x11] Detected wm supports FULLSCREEN state.
[vo/opengl/x11] Detected wm supports ABOVE state.
[vo/opengl/x11] Detected wm supports BELOW state.
[vo/opengl/x11] Display 0 (HDMI-A-0): [0, 0, 1920, 1080] @ 60.000000 FPS
[vo/opengl/x11] Current display FPS: 60.000000
[vo/opengl] GLX chose FB config with ID 0xb3
[vo/opengl] GLX chose visual with ID 0x309
[vo/opengl] Creating OpenGL 3.3 context...
[vo/opengl] GL_VERSION='4.5 (Core Profile) Mesa 17.1.3'
[vo/opengl] Detected desktop OpenGL 4.5.
[vo/opengl] GL_VENDOR='X.Org'
[vo/opengl] GL_RENDERER='Gallium 0.4 on AMD POLARIS11 (DRM 3.10.0 / 4.11.6-3-ARCH, LLVM 4.0.0)'
[vo/opengl] GL_SHADING_LANGUAGE_VERSION='4.50'
[vo/opengl] Loaded extension GLX_SGI_swap_control.
[vo/opengl] Loaded extension GLX_SGI_video_sync.
[vo/opengl] Loaded extension GL_NV_vdpau_interop.
[vo/opengl] 16 bit texture depth: 16.
[vo/opengl] Testing FBO format 0x805b
[vo/opengl] Create FBO: 16x16 (16x16)
[vo/opengl] Using FBO format 0x805b.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[vo/opengl] Loading hwdec driver 'vaapi-egl'
[vo/opengl] Loading failed.
[vo/opengl] Loading hwdec driver 'vaapi-glx'
[vo/opengl/vaapi-glx/vaapi] libva: VA-API version 0.40.0
[vo/opengl/vaapi-glx/vaapi] libva: va_getDriverName() returns 0
[vo/opengl/vaapi-glx/vaapi] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[vo/opengl/vaapi-glx/vaapi] libva: Found init function __vaDriverInit_0_40
[vo/opengl/vaapi-glx/vaapi] libva: va_openDriver() returns 0
[vo/opengl/vaapi-glx/vaapi] VA API version 0.40
[vo/opengl/vaapi-glx/vaapi] 10 image formats available:
[vo/opengl/vaapi-glx/vaapi]   NV12
[vo/opengl/vaapi-glx/vaapi]   P010
[vo/opengl/vaapi-glx/vaapi]   P016
[vo/opengl/vaapi-glx/vaapi]   YV12
[vo/opengl/vaapi-glx/vaapi]   YUYV
[vo/opengl/vaapi-glx/vaapi]   UYVY
[vo/opengl/vaapi-glx/vaapi]   BGRA
[vo/opengl/vaapi-glx/vaapi]   RGBA
[vo/opengl/vaapi-glx/vaapi]   BGRX
[vo/opengl/vaapi-glx/vaapi]   RGBX
[ffmpeg] AVHWDeviceContext: Unknown driver "mesa gallium vaapi", assuming standard behaviour.
[vo/opengl] Assuming 60.000000 FPS for display sync.
[vd] Container reported FPS: 59.940060
[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd]     hevc_cuvid (hevc) - Nvidia CUVID HEVC decoder
[vd] Opening video decoder hevc
[vd] Probing 'vaapi'...
[vd] Trying hardware decoding.
[vd] Selected video codec: hevc (HEVC (High Efficiency Video Coding))
[ad] Codec list:
[ad]     aac - AAC (Advanced Audio Coding)
[ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening audio decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected audio codec: aac (AAC (Advanced Audio Coding))
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[vd] Requesting pixfmt 'vaapi_vld' from decoder.
[auto_profiles] Re-evaluate auto profile Below 540p 
[auto_profiles] Re-evaluate auto profile 720p 
[af] Audio filter chain:
[auto_profiles] Re-evaluate auto profile 704p 
[af]   [in] 48000Hz stereo 2ch floatp
[auto_profiles] Re-evaluate auto profile 800p 
[af]   [out] 48000Hz stereo 2ch floatp
[auto_profiles] Re-evaluate auto profile 808p 
[af]   [ao] 48000Hz stereo 2ch floatp
[auto_profiles] Re-evaluate auto profile 1040p 
[ao] Trying audio driver 'pulse'
[auto_profiles] Re-evaluate auto profile 1080p 
[auto_profiles] Re-evaluate auto profile Above 1080 
[auto_profiles] Applying profile Above 1080 
[ao/pulse] requested format: 48000 Hz, stereo channels, floatp
[ao/pulse] Library version: 10.0.0
[ao/pulse] Proto: 32
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse]  - #fl
[ao/pulse]  - #fr
[ao/pulse]  - #fc
[ao/pulse]  - #lfe
[ao/pulse]  - #bl
[ao/pulse]  - #br
[ao/pulse]  - #flc
[ao/pulse]  - #frc
[ao/pulse]  - #bc
[ao/pulse]  - #sl
[ao/pulse]  - #sr
[ao/pulse]  - #tc
[ao/pulse]  - #tfl
[ao/pulse]  - #tfc
[ao/pulse]  - #tfr
[ao/pulse]  - #tbl
[ao/pulse]  - #tbc
[ao/pulse]  - #tbr
[ao/pulse] result: stereo
[ao/pulse] device buffer: 6000 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[af] Adding filter lavrresample 
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatp
[af]   [lavrresample] 48000Hz stereo 2ch float [a]
[af]   [out] 48000Hz stereo 2ch float
[af]   [ao] 48000Hz stereo 2ch float
[vd] Using hardware decoding (vaapi).
[vd] Decoder format: 3840x2160 vaapi[p010] bt.2020-ncl/bt.2020/pq/limited SP=0.005000 CL=unknown
[vd] Using bitstream aspect ratio.
[vd] Invalid HDR peak in stream: 0.005000
[vf] Video filter chain:
[vf]   [in] 3840x2160 vaapi[p010] bt.2020-ncl/bt.2020/pq/limited SP=100.000000 CL=unknown
[vf]   [out] 3840x2160 vaapi[p010] bt.2020-ncl/bt.2020/pq/limited SP=100.000000 CL=unknown
[cplayer] Run command: apply-profile, flags=0, args=[Above 1080]
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 68)
[cplayer] VO: [opengl] 3840x2160 vaapi[p010]
[cplayer] VO: Description: Extended OpenGL Renderer
[vo/opengl/x11] not waiting for MapNotify
[vo/opengl] Resize: 1920x1080
[vo/opengl] Window size: 1920x1080
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (0, 0) 1920x1080
[vo/opengl] Video scale: 0.500000/0.500000
[vo/opengl] OSD borders: l=0 t=0 r=0 b=0
[vo/opengl] Video borders: l=0 t=0 r=0 b=0
[vo/opengl] Testing FBO format 0x805b
[vo/opengl] Create FBO: 16x16 (16x16)
[vo/opengl] Using FBO format 0x805b.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[cplayer] set video colors output-levels=0 
[vo/opengl] Reported display depth: 8
[vo/opengl] new shader program:
[vo/opengl] [  1] color.rgb = 1.000000 * vec4(texture(texture0, texcoord0)).rgb;
[vo/opengl] [  2] // color conversion
[vo/opengl] [  3] color.rgb = mat3(colormatrix) * color.rgb + colormatrix_c;
[vo/opengl] [  4] color.a = 1.0;
[vo/opengl] [  5] // color mapping
[vo/opengl] [  6] // linearize
[vo/opengl] [  7] color.rgb = clamp(color.rgb, 0.0, 1.0);
[vo/opengl] [  8] color.rgb = pow(color.rgb, vec3(1.0/78.843750));
[vo/opengl] [  9] color.rgb = max(color.rgb - vec3(0.835938), vec3(0.0)) 
[vo/opengl] [ 10]              / (vec3(18.851562) - vec3(18.687500) * color.rgb);
[vo/opengl] [ 11] color.rgb = pow(color.rgb, vec3(1.0/0.159302));
[vo/opengl] [ 12] color.rgb *= vec3(100.000000);
[vo/opengl] [ 13] color.rgb /= vec3(100.000000);
[vo/opengl] [ 14] // rescale value range;
[vo/opengl] [ 15] color.rgb *= vec3(100.000000);
[vo/opengl] [ 16] color.xyz = rgb2xyz * color.rgb;
[vo/opengl] [ 17] color.xz /= balance;
[vo/opengl] [ 18] // HDR tone mapping
[vo/opengl] [ 19] color.rgb = mix(vec3(1.004949) * (color.rgb + vec3(-0.089557))
[vo/opengl] [ 20]                          / (color.rgb + vec3(0.404949)),
[vo/opengl] [ 21]                 color.rgb,
[vo/opengl] [ 22]                 lessThanEqual(color.rgb, vec3(0.300000)));
[vo/opengl] [ 23] color.xz *= balance;
[vo/opengl] [ 24] color.rgb = xyz2rgb * color.xyz;
[vo/opengl] [ 25] color.rgb = cms_matrix * color.rgb;
[vo/opengl] [ 26] // delinearize
[vo/opengl] [ 27] color.rgb = clamp(color.rgb, 0.0, 1.0);
[vo/opengl] [ 28] color.rgb *= vec3(1.000000);
[vo/opengl] [ 29] color.rgb = pow(color.rgb, vec3(1.0/2.2));
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/noto/NotoSansCJK-DemiLight.ttc, 3, NotoSansCJKtc-DemiLight
[cplayer] first video frame after restart shown
[cplayer] starting audio playback
[cplayer] playback restart complete
[cplayer] Change display sync audio drift: -1
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V: -0.015 DS: 1.000/0
[cplayer] Run command: define-section, flags=0, args=[input_autospeed, y script-binding autospeed/autospeed
[cplayer] , default]
[cplayer] Run command: enable-section, flags=0, args=[input_autospeed, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_forced_autospeed, , force]
[cplayer] Run command: enable-section, flags=0, args=[input_forced_autospeed, allow-hide-cursor+allow-vo-dragging]
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V: -0.015 DS: 1.000/0
[cplayer] Change display sync audio drift: 1
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.029 DS: 1.000/0
[vo/opengl/x11] Disabling screensaver.
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.007 DS: 0.800/0 Dropped: 2
[cplayer] Set property: pause="yes" -> 1
[statusline] (Paused) AV: 00:00:00 / 00:02:07 (0%) A-V:  0.007 DS: 0.800/0 Dropped: 2
[vo/opengl/x11] Enabling screensaver.
[vo/opengl/x11] Display 0 (HDMI-A-0): [0, 0, 1920, 1080] @ 59.940202 FPS
[vo/opengl/x11] Current display FPS: 59.940202
[vo/opengl] Assuming 59.940202 FPS for display sync.
[statusline] (Paused) AV: 00:00:00 / 00:02:07 (0%) A-V:  0.007 DS: 0.800/0 Dropped: 2
[vo/opengl/x11] Disabling screensaver failed (4). Make sure the xdg-screensaver script is installed.
[statusline] (Paused) AV: 00:00:00 / 00:02:07 (0%) A-V:  0.007 DS: 0.800/0 Dropped: 2
[cplayer] Set property: pause="no" -> 1
[vo/opengl/x11] Disabling screensaver.
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.031 DS: 0.818/0 Dropped: 2
[cplayer] Change display sync audio drift: 0
[cplayer] Compensation factor: 0.890429
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V: -0.001 DS: 0.769/0 Dropped: 3
[cplayer] Change display sync audio drift: -1
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V: -0.034 DS: 0.800/0 Dropped: 3
[cplayer] Change display sync audio drift: 1
[statusline] AV: 00:00:02 / 00:02:07 (2%) A-V:  0.015 DS: 1.000/0 Dropped: 3
[cplayer] Run command: quit, flags=9, args=[0]
[cplayer] EOF code: 6  
[ad] Uninit audio decoder.
[af] Removing filter lavrresample 
[vd] Uninit video.
[cplayer] finished playback, success (reason 3)
[cplayer] 
[cplayer] 
[cplayer] Exiting... (Quit)
[stats] Exiting...
[auto_profiles] Exiting...
[osc] Exiting...
[ytdl_hook] Exiting...
[autospeed] Exiting...
[ao/pulse] draining...
[vo/opengl/x11] Enabling screensaver.
[vo/opengl] flushing shader cache
[vo/opengl/x11] uninit ...

Sample files

Sony_4K_HDR_Camp

@wiiaboo

This comment has been minimized.

Member

wiiaboo commented Jun 27, 2017

Looks like your hardware is trying to decode 10-bit as if it were 8-bit. Probably not an issue to do with mpv.

@wm4

This comment has been minimized.

Contributor

wm4 commented Jun 27, 2017

Also might just be because it uses the legacy GLX rendering method. It's not supposed to be used.

@Gusar321

This comment has been minimized.

Contributor

Gusar321 commented Jun 27, 2017

The problem is, only Intel supports EGL interop, legacy GLX is all there is for the radeonsi driver used here.

@JulianLai try --vo=vaapi

@haasn

This comment has been minimized.

Member

haasn commented Jun 27, 2017

@Gusar321 --vo=vaapi won't fare any better when it comes to rendering HDR etc.. Only --vo=opengl is capable of that.

@vanvugt

This comment has been minimized.

vanvugt commented Jul 7, 2017

Confirmed the wrong colours when playing the Sony 4K Camp video. But they're only wrong in mpv. If I use gstreamer-vaapi (totem or gst-play-1.0) then everything is rendered just fine.

Also strange that this discolouration only seems to happen with that one video. Not in any other test video I've seen...

P.S. You might need Kaby Lake for that video. I have not seen anything older play it successfully.

@haasn

This comment has been minimized.

Member

haasn commented Jul 7, 2017

@vanvugt By “just fine” do you mean “decodes correctly” or do you mean “displays correctly”? HDR clips need special handling in the video output as well.

Anyway, as for that particular clip, if it's just the one I really wouldn't worry about it. It's a very horrifically badly made clip, with lots of corrupt metadata (e.g. the mastering side-data contains invalid values), shit mastering, and shit quality.

@vanvugt

This comment has been minimized.

vanvugt commented Jul 7, 2017

The same video displays perfectly with gstreamer-vaapi.

This is indeed a corner case, not worth much investigation right now. The discolouration is only with the one video when played with mpv --hwdec. And if it is 10-bit HEVC then I guess it also requires Kaby Lake.

@haasn

This comment has been minimized.

Member

haasn commented Jul 7, 2017

The same video displays perfectly with gstreamer-vaapi.

That's weird, according to the gstreamer source code it doesn't seem to support HDR? At least not according to https://github.com/GStreamer/gst-plugins-base/blob/master/gst-libs/gst/video/video-color.h#L71

wm4 pushed a commit that referenced this issue Jul 7, 2017

wm4
vo_opengl: do not use vaapi-over-GLX
This backend is selected if vaapi is available, but vaapi-over-EGL is
not. This causes various issues around the forced RGB conversion, which
is done with fixed, usually incorrect parameters.

It seems the existing auto probing check is too weak, and doesn't really
prevent it from getting loaded. Fix this by adding a flag to not ever
load this during auto probing.

I'm still not deleting it, because it's useful for testing on nvidia
machines.

See #4555.
@vanvugt

This comment has been minimized.

vanvugt commented Jul 8, 2017

It appears that video is not HDR, or 10-bit, but more like 8-bit HEVC. I can tell because my Cherry Trail Atom can play the same video with full acceleration. And Cherry Trail can only play 8-bit HEVC (I confirmed it hits a brick wall if you try 10-bit). Same behaviour observed on the Atom too: Discolouration and corruption only occurs in mpv but not with gstreamer-vaapi.

I think there were some interesting log messages too. I'll reproduce the issue again and attach logs later. It's not an important issue but still a little intriguing. :)

@haasn

This comment has been minimized.

Member

haasn commented Jul 8, 2017

@vanvugt There are two versions of the Sony Camp clip, the one named Sony_4K_Camp.mp4 and the one named Sony_4K_HDR_Camp.mp4

The former is 8-bit SDR, the latter is 10-bit HDR. Your mpv log also identifies it as such:
[vf] [in] 3840x2160 vaapi[p010] bt.2020-ncl/bt.2020/pq/limited SP=100.000000 CL=unknown

@vanvugt

This comment has been minimized.

vanvugt commented Jul 9, 2017

I'll try and find the original file again and verify. But given I have multiple machines exhibiting identical discolouration and stripes to that shown in the above screenshots, it appears to be the same bug. All three of those machines play the video smoothly through VAAPI with the same visible flaws, and only one of them is capable of 10-bit. In all cases the flaws are only visible in mpv and not in gstreamer-vaapi apps. So this is starting to sound like the file is named and possibly encoded incorrectly. It looks like VAAPI is decoding it correctly and just the wrong GL shader is used under mpv (causing some colour value distortion?).

@Gusar321

This comment has been minimized.

Contributor

Gusar321 commented Jul 9, 2017

All three of those machines play the video smoothly through VAAPI with the same visible flaws, and only one of them is capable of 10-bit.

Which means all these machines are decoding the video as if it's 8bit, even the one which could decode it as 10bit.

In all cases the flaws are only visible in mpv and not in gstreamer-vaapi apps.

Which leads me to believe that the gstreamer apps aren't actually using hardware decoding. There's no other explanation why they'd decode correctly even on machines without a 10bit hardware decoder.

It looks like VAAPI is decoding it correctly and just the wrong GL shader is used under mpv

No, it looks like gstreamer isn't actually using vaapi.

What I see as bugs here is that mpv does hardware decoding of the clip even if the hardware isn't cabable of 10bit, and that the video is decoded as 8bit even when a 10bit decoder is available. But this may not necessarily be a mpv bug, could also be something in ffmpeg or even the radeonsi vaapi driver.

@haasn

This comment has been minimized.

Member

haasn commented Jul 9, 2017

just the wrong GL shader is used under mpv (causing some colour value distortion?).

No, it's a decoding error, caused by the hardware decoder trying to decode 10-bit content as 8-bit. Either:

A) the hardware decoder advertises 10-bit support but fails to render it properly (driver bug)
B) the hardware decoder does not advertise 10-bit support but mpv mistakenly tries it anyway (mpv bug)
C) there's no way to figure out whether the hardware decoder supports 10-bit or not (wouldn't surprise me given how shitty these APIs are)

There was also the commit ae4c013 which disables the use of vaapi-over-GLX. Have you tried again since that commit?

@vanvugt

This comment has been minimized.

vanvugt commented Jul 9, 2017

You are suggesting something that's impossible: "No, it looks like gstreamer isn't actually using vaapi.". Because it's just a 2 watt Cherry Trail Atom chip and is playing 4K HEVC H.265 flawlessly smooth.

I have a collection of 8-bit and 10-bit HEVC videos and the 10-bit ones simply don't play at all (VAAPI reports unsupported profile) on Cherry Trail and Braswell. All the 8-bit ones play smoothly.

Furthermore, I know of no CPU that can play this video smoothly in software, let alone a 2W Atom chip, It only works when VAAPI works.

Further evidence that Cherry Trail/View and Braswell only support 8-bit and not 10-bit:
https://github.com/01org/intel-vaapi-driver/blob/master/README

I am aware of what the log messages show. It just seems like VAAPI itself has correctly detected the video stream as 8-bit but mpv thinks it's 10-bit. That's why I think the file might be encoded incorrectly. So it fools mpv into using the wrong shader, but not gstreamer.

@vanvugt

This comment has been minimized.

vanvugt commented Jul 9, 2017

Also, the hardware decoder works. Because:
(a) It maintains full frame rate on an Atom chip (my Xeon desktop can't even do that in software); and
(b) gstreamer-vaapi also renders the correct colours (does not have this bug)

@vanvugt

This comment has been minimized.

vanvugt commented Jul 10, 2017

Here's my log from playing the video. The on-screen corruption is identical to the above screenshots, and identical regardless of which machine I use (same for Kaby Lake, Cherry Trail and Braswell laptops)...

$ mpv -v --hwdec=vaapi 4K_Sony_Camp_HEVC.mp4
[cplayer] Command line options: '-v' '--hwdec=vaapi' '4K_Sony_Camp_HEVC.mp4'
[cplayer] mpv 0.25.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[cplayer]  built on UNKNOWN
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       55.34.101
[cplayer]    libavcodec      57.64.101
[cplayer]    libavformat     57.56.101
[cplayer]    libswscale      4.2.100
[cplayer]    libavfilter     6.65.100
[cplayer]    libswresample   2.3.100
[cplayer] ffmpeg version: 3.2.6-1
[cplayer] 
[cplayer] Configuration: ./waf configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --confdir=/etc/mpv --zshdir=/usr/share/zsh/vendor-completions --enable-cdda --enable-sdl2 --enable-sndio --enable-zsh-comp --enable-libmpv-shared --enable-encoding --enable-dvdnav --enable-dvdread --disable-build-date
[cplayer] List of enabled features: alsa asm atomics audio-input c11-tls caca cdda cplayer debug-build dlopen drm dvbin dvdnav dvdread dvdread-common egl-drm egl-helpers egl-x11 encoding fchmod gbm gbm.h gcc-tls gl gl-wayland gl-x11 glibc-thread-name glob gnuc iconv is_ffmpeg jack jpeg lcms2 libass libass-osd libav libavcodec libavdevice libbluray libdl libm libmpv-shared librt libsmbclient libv4l2 linux-fstatfs lua nanosleep optimize oss-audio oss-audio-native plain-gl posix posix-or-mingw posix-spawn pthreads pulse rubberband sdl2 shm sndio sse4-intrinsics stdatomic subprocess termios tv tv-v4l2 uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-hwaccel vaapi-hwaccel-old vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vdpau-hwaccel vdpau-hwaccel-old videodev vt.h wayland x11 xv zlib zsh-comp
[global] config path: '' -> '/home/dan/.config/mpv'
[global] config path: 'mpv.conf' -/-> '/home/dan/.config/mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/dan/.config/mpv/config'
[global] config path: 'mpv.conf' -/-> '/home/dan/.mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/dan/.mpv/config'
[global] config path: 'mpv.conf' -/-> '/etc/mpv/mpv.conf'
[global] config path: 'config' -/-> '/etc/mpv/config'
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 8)
[global] config path: 'input.conf' -/-> '/home/dan/.config/mpv/input.conf'
[global] config path: 'input.conf' -/-> '/home/dan/.mpv/input.conf'
[global] config path: 'input.conf' -/-> '/etc/mpv/input.conf'
[osc] Loading lua script @osc.lua...
[global] config path: 'scripts' -/-> '/home/dan/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/dan/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[osc] loading mp.defaults
[osc] loading @osc.lua
[global] config path: 'lua-settings/osc.conf' -/-> '/home/dan/.config/mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/home/dan/.mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/etc/mpv/lua-settings/osc.conf'
[osc] lua-settings/osc.conf not found. 
[cplayer] Run command: define-section, flags=0, args=[showhide, mouse_move script-binding osc/__keybinding1
[cplayer] mouse_leave script-binding osc/__keybinding2
[cplayer] , force]
[cplayer] Run command: enable-section, flags=0, args=[showhide, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input, mouse_btn0 script-binding osc/__keybinding3
[cplayer] shift+mouse_btn0 script-binding osc/__keybinding4
[cplayer] mouse_btn2 script-binding osc/__keybinding5
[cplayer] mouse_btn3 script-binding osc/__keybinding6
[cplayer] mouse_btn4 script-binding osc/__keybinding7
[cplayer] mouse_btn0_dbl ignore
[cplayer] shift+mouse_btn0_dbl ignore
[cplayer] mouse_btn2_dbl ignore
[cplayer] , force]
[cplayer] Run command: enable-section, flags=0, args=[input, ]
[cplayer] Run command: define-section, flags=0, args=[input_osc, del script-binding osc/__keybinding8
[cplayer] , default]
[cplayer] Run command: enable-section, flags=0, args=[input_osc, allow-hide-cursor+allow-vo-dragging]
[cplayer] Run command: define-section, flags=0, args=[input_forced_osc, , force]
[cplayer] Run command: enable-section, flags=0, args=[input_forced_osc, allow-hide-cursor+allow-vo-dragging]
[cplayer] Done loading @osc.lua.
[ytdl_hook] Loading lua script @ytdl_hook.lua...
[global] config path: 'scripts' -/-> '/home/dan/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/dan/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[ytdl_hook] loading mp.defaults
[cplayer] Run command: disable-section, flags=0, args=[input]
[global] config path: 'fonts' -/-> '/home/dan/.config/mpv/fonts'
[global] config path: 'fonts' -/-> '/home/dan/.mpv/fonts'
[global] config path: 'fonts' -/-> '/etc/mpv/fonts'
[osd/libass] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.4.2 (COMPLEX)
[global] config path: 'subfont.ttf' -/-> '/home/dan/.config/mpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/home/dan/.mpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/etc/mpv/subfont.ttf'
[global] config path: 'fonts.conf' -/-> '/home/dan/.config/mpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/home/dan/.mpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/etc/mpv/fonts.conf'
[osd/libass] Setting up fonts...
[ytdl_hook] loading @ytdl_hook.lua
[cplayer] Run command: hook-add, flags=0, args=[on_load, 1, 10]
[cplayer] Run command: hook-add, flags=0, args=[on_preloaded, 2, 10]
[cplayer] Done loading @ytdl_hook.lua.
[global] config path: 'scripts' -/-> '/home/dan/.config/mpv/scripts'
[global] config path: 'scripts' -/-> '/home/dan/.mpv/scripts'
[global] config path: 'scripts' -/-> '/etc/mpv/scripts'
[global] config path: 'watch_later' -> '/home/dan/.config/mpv/watch_later'
[cplayer] Playing: 4K_Sony_Camp_HEVC.mp4
[cplayer] Running hook: ytdl_hook/on_load
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Run command: hook-ack, flags=0, args=[on_load]
[ifo] Opening 4K_Sony_Camp_HEVC.mp4
[ifo_dvdnav] Opening 4K_Sony_Camp_HEVC.mp4
[bdmv/bluray] Opening 4K_Sony_Camp_HEVC.mp4
[file] Opening 4K_Sony_Camp_HEVC.mp4
[file] Stream opened successfully.
[demux] Trying demuxers for level=normal.
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[lavf] Could not set AVOption advanced_editlist='0'
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: 4K_Sony_Camp_HEVC.mp4
[find_files] Loading external files in .
[global] config path: 'sub' -/-> '/home/dan/.config/mpv/sub'
[global] config path: 'sub' -/-> '/home/dan/.mpv/sub'
[global] config path: 'sub' -/-> '/etc/mpv/sub'
[cplayer] Running hook: ytdl_hook/on_preloaded
[cplayer] Run command: hook-ack, flags=0, args=[on_preloaded]
[cplayer]  (+) Video --vid=1 (*) (hevc 3840x2160 59.940fps)
[cplayer]  (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[vo/opengl] Initializing OpenGL backend 'x11probe'
[vo/opengl/x11] X11 opening display: :0
[vo/opengl/x11] X11 running at 1920x1080 (":0" => local display)
[vo/opengl/x11] Detected wm supports NetWM.
[vo/opengl/x11] Detected wm supports FULLSCREEN state.
[vo/opengl/x11] Detected wm supports ABOVE state.
[vo/opengl/x11] Detected wm supports BELOW state.
[vo/opengl/x11] Display 0 (eDP-1): [0, 0, 1920, 1080] @ 60.049471 FPS
[vo/opengl/x11] Current display FPS: 60.049471
[vo/opengl] GLX chose FB config with ID 0x8a
[vo/opengl] GLX chose visual with ID 0xc3
[vo/opengl] Creating OpenGL 3.3 context...
[vo/opengl] GL_VERSION='4.5 (Core Profile) Mesa 17.1.2'
[vo/opengl] Detected desktop OpenGL 4.5.
[vo/opengl] GL_VENDOR='Intel Open Source Technology Center'
[vo/opengl] GL_RENDERER='Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) '
[vo/opengl] GL_SHADING_LANGUAGE_VERSION='4.50'
[vo/opengl] Loaded extension GLX_SGI_swap_control.
[vo/opengl] Loaded extension GLX_SGI_video_sync.
[vo/opengl] No vdpau support found - probing more things.
[vo/opengl/x11] uninit ...
[vo/opengl] Initializing OpenGL backend 'x11egl'
[vo/opengl/x11] X11 opening display: :0
[vo/opengl/x11] X11 running at 1920x1080 (":0" => local display)
[vo/opengl/x11] Detected wm supports NetWM.
[vo/opengl/x11] Detected wm supports FULLSCREEN state.
[vo/opengl/x11] Detected wm supports ABOVE state.
[vo/opengl/x11] Detected wm supports BELOW state.
[vo/opengl/x11] Display 0 (eDP-1): [0, 0, 1920, 1080] @ 60.049471 FPS
[vo/opengl/x11] Current display FPS: 60.049471
[vo/opengl] EGL_VERSION=1.4 (DRI2)
[vo/opengl] EGL_VENDOR=Mesa Project
[vo/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/opengl] Trying to create Desktop OpenGL context.
[vo/opengl] chose visual 0x21
[vo/opengl] GL_VERSION='4.5 (Core Profile) Mesa 17.1.2'
[vo/opengl] Detected desktop OpenGL 4.5.
[vo/opengl] GL_VENDOR='Intel Open Source Technology Center'
[vo/opengl] GL_RENDERER='Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) '
[vo/opengl] GL_SHADING_LANGUAGE_VERSION='4.50'
[vo/opengl] swap_control extension missing.
[vo/opengl] 16 bit texture depth: 16.
[vo/opengl] Testing FBO format 0x805b
[vo/opengl] Create FBO: 16x16 (16x16)
[vo/opengl] Using FBO format 0x805b.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[vo/opengl] Loading hwdec driver 'vaapi-egl'
[vo/opengl/vaapi-egl] Trying to open a x11 VA display...
[vo/opengl/vaapi-egl/vaapi] libva: VA-API version 0.40.0
[vo/opengl/vaapi-egl/vaapi] libva: va_getDriverName() returns 0
[vo/opengl/vaapi-egl/vaapi] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
[vo/opengl/vaapi-egl/vaapi] libva: Found init function __vaDriverInit_0_40
[vo/opengl/vaapi-egl/vaapi] libva: va_openDriver() returns 0
[vo/opengl/vaapi-egl/vaapi] VA API version 0.40
[vo/opengl/vaapi-egl/vaapi] 9 image formats available:
[vo/opengl/vaapi-egl/vaapi]   YV12
[vo/opengl/vaapi-egl/vaapi]   I420
[vo/opengl/vaapi-egl/vaapi]   NV12
[vo/opengl/vaapi-egl/vaapi]   YUY2
[vo/opengl/vaapi-egl/vaapi]   UYVY
[vo/opengl/vaapi-egl/vaapi]   422H
[vo/opengl/vaapi-egl/vaapi]   RGBX
[vo/opengl/vaapi-egl/vaapi]   BGRX
[vo/opengl/vaapi-egl/vaapi]   P010
[vo/opengl/vaapi-egl] using VAAPI EGL interop
[vo/opengl/vaapi-egl] Supported formats:
[vo/opengl/vaapi-egl]  nv12
[vo/opengl] Assuming 60.049471 FPS for display sync.
[vd] Container reported FPS: 59.940060
[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd] Opening video decoder hevc
[vd] Probing 'vaapi'...
[vd] Trying hardware decoding.
[vd] Selected video codec: hevc (HEVC (High Efficiency Video Coding))
[ad] Codec list:
[ad]     aac - AAC (Advanced Audio Coding)
[ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening audio decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected audio codec: aac (AAC (Advanced Audio Coding))
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld vdpau yuv420p
[vd] Codec profile: Main (0x1)
[vaapi] Using profile 'VAProfileHEVCMain'.
[vd] Requesting pixfmt 'vaapi_vld' from decoder.
[lavf] Edit lists are not correctly supported (FFmpeg issue).
[vd] Invalid HDR reference peak in stream: 0.500000
[vd] Using hardware decoding (vaapi).
[vd] Decoder format: 3840x2160 vaapi[nv12] bt.709/bt.709/bt.1886/limited CL=unknown
[vf] Video filter chain:
[vf]   [in] 3840x2160 vaapi[nv12] bt.709/bt.709/bt.1886/limited CL=unknown
[vf]   [out] 3840x2160 vaapi[nv12] bt.709/bt.709/bt.1886/limited CL=unknown
[cplayer] VO: [opengl] 3840x2160 vaapi[nv12]
[cplayer] VO: Description: Extended OpenGL Renderer
[vo/opengl/x11] not waiting for MapNotify
[vo/opengl] Resize: 1920x1023
[vo/opengl] Window size: 1920x1023
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (51, 0) 1818x1023
[vo/opengl] Video scale: 0.473438/0.473611
[vo/opengl] OSD borders: l=51 t=0 r=51 b=0
[vo/opengl] Video borders: l=51 t=0 r=51 b=0
[vo/opengl] Testing FBO format 0x805b
[vo/opengl] Create FBO: 16x16 (16x16)
[vo/opengl] Using FBO format 0x805b.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[cplayer] set video colors output-levels=0 
[vo/opengl] Reported display depth: 8
[vo/opengl] new shader program:
[vo/opengl] [  1] color.r = 1.000000 * vec4(texture(texture0, texcoord0)).r;
[vo/opengl] [  2] color.gb = 1.000000 * vec4(texture(texture1, texcoord1)).rg;
[vo/opengl] [  3] // color conversion
[vo/opengl] [  4] color = color.rgba;
[vo/opengl] [  5] color.rgb = mat3(colormatrix) * color.rgb + colormatrix_c;
[vo/opengl] [  6] color.a = 1.0;
[vo/opengl] [  7] // color mapping
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf, 0, DejaVuSans
[cplayer] first video frame after restart shown
[vo/opengl] Resize: 1920x1025
[vo/opengl] Window size: 1920x1025
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (49, 0) 1822x1025
[vo/opengl] Video scale: 0.474479/0.474537
[vo/opengl] OSD borders: l=49 t=0 r=49 b=0
[vo/opengl] Video borders: l=49 t=0 r=49 b=0
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatp
[af]   [out] 48000Hz stereo 2ch floatp
[af]   [ao] 48000Hz stereo 2ch floatp
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, stereo channels, floatp
[ao/pulse] Library version: 10.0.0
[ao/pulse] Proto: 32
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse]  - #fl
[ao/pulse]  - #fr
[ao/pulse]  - #fc
[ao/pulse]  - #lfe
[ao/pulse]  - #bl
[ao/pulse]  - #br
[ao/pulse]  - #flc
[ao/pulse]  - #frc
[ao/pulse]  - #bc
[ao/pulse]  - #sl
[ao/pulse]  - #sr
[ao/pulse]  - #tc
[ao/pulse]  - #tfl
[ao/pulse]  - #tfc
[ao/pulse]  - #tfr
[ao/pulse]  - #tbl
[ao/pulse]  - #tbc
[ao/pulse]  - #tbr
[ao/pulse] result: stereo
[ao/pulse] device buffer: 6000 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[af] Adding filter lavrresample 
[af] Audio filter chain:
[af]   [in] 48000Hz stereo 2ch floatp
[af]   [lavrresample] 48000Hz stereo 2ch float [a]
[af]   [out] 48000Hz stereo 2ch float
[af]   [ao] 48000Hz stereo 2ch float
[cplayer] starting audio playback
[cplayer] playback restart complete
[vo/opengl/x11] Disabling screensaver.
[vd] Invalid HDR reference peak in stream: 0.500000
[vd] Invalid HDR reference peak in stream: 0.500000
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.000
[vd] Invalid HDR reference peak in stream: 0.500000
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.000
[vd] Invalid HDR reference peak in stream: 0.500000
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.000
[vd] Invalid HDR reference peak in stream: 0.500000
[statusline] AV: 00:00:00 / 00:02:07 (0%) A-V:  0.000
[vd] Invalid HDR reference peak in stream: 0.500000
...
@haasn

This comment has been minimized.

Member

haasn commented Jul 10, 2017

Well that log you posted is for playback of an 8-bit file. If it exhibits the same corruption as in your initial post, on all three machines, then there's a good chance that the bug has nothing to do with 10-bit vs 8-bit.

@Gusar321

This comment has been minimized.

Contributor

Gusar321 commented Jul 10, 2017

@haasn: vanvugt is not the initial reporter, JulianLai is. It seems vanvugt wanted to confirm JulianLai's observations, but he has a different version of the video.

@vanvugt: Please also get the 10bit HDR version of the video and test that one with both mpv and gstreamer-vaapi on your Kaby Lake machine (the other two won't be able to handle the clip anyway).

Anyway, it does look like mpv screws up playing both versions for some reason, while gstreamer-vaapi handles at least the 8bit version ok.

@haasn

This comment has been minimized.

Member

haasn commented Jul 10, 2017

@Gusar321 Oh, my bad. This is why it's better to keep separate issues separate..

@fhvwy

This comment has been minimized.

Contributor

fhvwy commented Jul 10, 2017

I can reproduce the original problem from @JulianLai on a Polaris 11 card here. It must be some sort of decoder issue with AMD/Mesa/libavcodec (consider that the boundaries of the eight slices are visible in the first screenshot). It also happens with ffmpeg using VAAPI decode directly; other H.265 Main10 files do decode fine, so it isn't a 10-bit problem generally but something about that file specifically.

No idea about the issue from @vanvugt . The file decodes sensibly on Kaby Lake for me, both with VAAPI-EGL and VAAPI-copy (though I don't have any means to tell whether the colours are actually correct).

@vanvugt

This comment has been minimized.

vanvugt commented Jul 13, 2017

I can confirm Sony_4K_HDR_Camp.mp4 has the same problems under mpv. The corruption is very similar to the 8-bit version of the file, only slightly different.

Furthermore, playing Sony_4K_HDR_Camp.mp4 in gst-play-1.0 or totem using gstreamer-vaapi exhibits no corruption at all. Although it's a bit dull (which seems to be true for all HDR videos when played on my 8-bit screen).

@fhvwy

This comment has been minimized.

Contributor

fhvwy commented Jul 13, 2017

Fixed for me by https://lists.freedesktop.org/archives/mesa-dev/2017-July/162896.html. (If anyone feels like building Mesa and could test that, please do!)

@vanvugt I suspect you might have an old version of ffmpeg which suffers from the converse bug - like in Mesa, some code was copied from the VDPAU implementation without noticing that the scaling list ordering was different. This was fixed a while ago - please try an up to date ffmpeg (it is fine for me on Kaby Lake with the current version).

@wm4

This comment has been minimized.

Contributor

wm4 commented Jul 13, 2017

Oh nice, so it was a driver bug all along?

@AndyFurniss

This comment has been minimized.

AndyFurniss commented Jul 16, 2017

So is this still needed?

It regresses h264 radeonsi hwdec=vaapi --vo=opengl[-hq] for me.

--vo=vaapi still works, but it seems a shame to loose something that worked and was better in the case of hq. OK so I can still use vdpau for 264 anyway, not so sure about whether that's a future proof option for 265 10bit as I don't have a card that will do that.

commit ae4c013
Author: wm4 wm4@nowhere
Date: Fri Jul 7 12:29:29 2017 +0200

vo_opengl: do not use vaapi-over-GLX

snip
See #4555.

@wm4

This comment has been minimized.

Contributor

wm4 commented Jul 16, 2017

You can still force it. But in general, just use vdpau with radeon. At least until they implement EGL interop.

@AndyFurniss

This comment has been minimized.

AndyFurniss commented Jul 16, 2017

OK, what command forces?

@haasn

This comment has been minimized.

Member

haasn commented Jul 16, 2017

Although it's a bit dull (which seems to be true for all HDR videos when played on my 8-bit screen).

Sounds an awful lot like it doesn't actually support HDR

@vanvugt

This comment has been minimized.

vanvugt commented Jul 17, 2017

Yes, that's correct. I don't consider the dull rendering of HDR to be a bug. That is unrelated to this bug so I should not have mentioned it.

@fhvwy

This comment has been minimized.

Contributor

fhvwy commented Jul 18, 2017

Fixed in Mesa by https://cgit.freedesktop.org/mesa/mesa/commit/?id=63dcfed81f011dae5ca68af3369433be28135415.

If there is another similar issue here then please open a new bug with full reproduction instructions.

@haasn haasn closed this Jul 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment