mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.25k stars 2.9k forks source link

video is bleeding through on vpdau #6899

Closed lvmm closed 5 years ago

lvmm commented 5 years ago

Video is bleeding to other windows through vdpau overlay colour on linux. I am not really concerned with what happens during the playback, but it continues even when video is paused and mpv is windowed and minimized; the only way to restore normal system behaviour is to exit mpv. Is it possible to temporarily disable overlay mode when video is paused and/or when mpv is minimized?

mpv version and platform

mpv git-2019-08-03, linux-64 (ubuntu 18.04), nvidia GT1030 video card with drivers 390.116 (not limited to this configuration, same thing happens on other vdpau linux setups)

Reproduction steps

1 start fullscreen video playback 2 pause video 3 exit fullscreen mode 4 minimise mpv window 5 open gimp or any other graphics program 6 create new image 7 select pencil tool with 020507 RGB colour (assuming overlay colour is not overridden via vo-vdpau-colorkey) 8 start drawing with this colour

Expected behavior

almost black colour

Actual behavior

still frame paused in mpv starts bleeding through the applied colour

Log file

[cplayer] Command line options: '-v' 'WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts' [cplayer] mpv git-2019-08-03-c379950 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects
[cplayer] built on Thu Jul 4 13:30:17 UTC 2019
[cplayer] ffmpeg library versions:
[cplayer] libavutil 56.26.100
[cplayer] libavcodec 58.52.100
[cplayer] libavformat 58.27.103
[cplayer] libswscale 5.4.100
[cplayer] libavfilter 7.50.100
[cplayer] libswresample 3.4.100
[cplayer] ffmpeg version: git-2019-04-28-3dee6c0
[cplayer]
[cplayer] Configuration: ./waf configure --enable-pdf-build --enable-dvbin --enable-dvdread --enable-dvdnav --enable-html-build --enable-javascript --enable-cdda --enable-zsh-comp --zshdir=/usr/share/zsh/vendor-completions --prefix=/usr --confdir=/etc/mpv
[cplayer] List of enabled features: 52arch alsa asm atomics build-date cdda cplayer cplugins cuda-hwaccel debug-build drm dvbin dvdnav dvdread dvdread-common egl-drm egl-helpers egl-x11 fchmod ffmpeg ffnvcodec gbm gbm.h gl gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv jack javascript jpeg lcms2 libaf libarchive libass libass-osd libav-any libavcodec libavdevice libbluray libdl libm libplacebo librt linux-fstatfs lua optimize oss-audio posix posix-or-mingw posix-spawn posix-spawn-native pthreads pulse rubberband shaderc shaderc-shared stdatomic uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vt.h vulkan x11 xv zlib zsh-comp
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[cplayer] Reading config file /etc/mpv/mpv.conf
[cplayer] Reading config file /home/lvm/.config/mpv/mpv.conf
[ifo] Opening /home/lvm/.config/mpv/input.conf
[ifo_dvdnav] Opening /home/lvm/.config/mpv/input.conf
[bdmv/bluray] Opening /home/lvm/.config/mpv/input.conf
[file] Opening /home/lvm/.config/mpv/input.conf
[input] Parsing input config file /home/lvm/.config/mpv/input.conf
[input] Input config file /home/lvm/.config/mpv/input.conf parsed: 56 binds
[cplayer] Waiting for scripts...
[ytdl_hook] script-opts/ytdl_hook.conf not found.
[ytdl_hook] lua-settings/ytdl_hook.conf not found.
[stats] script-opts/stats.conf not found.
[stats] lua-settings/stats.conf not found.
[cplayer] Done loading scripts.
[cplayer] Playing: WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts [cplayer] Running hook: ytdl_hook/on_load [ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[ifo] Opening WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts
[ifo_dvdnav] Opening WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts
[bdmv/bluray] Opening WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts
[file] Opening WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts
[demux] Trying demuxers for level=normal.
[lavf] Found 'mpegts' at score=50 size=2048.
[lavf] avformat_find_stream_info() finished after 0 bytes.
[demux] Detected file format: mpegts (libavformat)
[cplayer] Opening done: WRC.2019.Round10.Germany.Day3.Highlights.Sat.Feed.1080i.H264.English.Natural.Sounds.ts
[find_files] Loading external files in .
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 1
[cplayer] (+) Video --vid=1 (h264 1920x1080 25.000fps) [cplayer] (+) Audio --aid=1 --alang=eng (mp2 2ch 48000Hz) [cplayer] Audio --aid=2 --alang=spa (mp2 2ch 48000Hz) [cplayer] Audio --aid=3 --alang=ger (mp2 2ch 48000Hz) [cplayer] Audio --aid=4 --alang=fre (mp2 2ch 48000Hz) [vo/vdpau/x11] X11 opening display: :0 [vo/vdpau/x11] X11 running at 1920x1200 (":0" => local display)
[vo/vdpau/x11] Detected wm supports NetWM.
[vo/vdpau/x11] Detected wm supports FULLSCREEN state.
[vo/vdpau/x11] Detected wm supports ABOVE state.
[vo/vdpau/x11] Detected wm supports BELOW state.
[vo/vdpau/x11] Detected wm supports STAYS_ON_TOP state.
[vo/vdpau/x11] Display 0 (HDMI-0): [0, 0, 1920, 1200] @ 59.950171 FPS
[vo/vdpau/x11] Current display FPS: 59.950171
[vo/vdpau] Assuming 59.950171 FPS for display sync.
[vd] Container reported FPS: 25.000000
[vd] Codec list:
[vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] Looking at hwdec h264-vdpau...
[vd] Trying hardware decoding via h264-vdpau.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[vf] User filter list:
[vf] (empty)
[ad] Codec list:
[ad] mp2 - MP2 (MPEG audio layer 2)
[ad] mp2float (mp2) - MP2 (MPEG audio layer 2)
[ad] Opening decoder mp2
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: mp2 (MP2 (MPEG audio layer 2))
[af] User filter list:
[af] (empty)
[cplayer] Starting playback...
[af] [in] 48000Hz stereo 2ch s16p
[af] [userspeed] 48000Hz stereo 2ch s16p
[af] [userspeed] (disabled)
[af] [convert] 48000Hz stereo 2ch s16p
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, stereo channels, s16p
[ao/pulse] Library version: 11.1.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: 4800 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz stereo 2ch s16 [cplayer] AO: Description: PulseAudio audio output [autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 48000Hz stereo s16p -> 48000Hz stereo s16
[af] [out] 48000Hz stereo 2ch s16
[vd] Pixel formats supported by decoder: vdpau cuda vaapi_vld yuv420p
[vd] Codec profile: High (0x64)
[vd] Requesting pixfmt 'vdpau' from decoder.
[vd] Using hardware decoding (vdpau). [vd] Decoder format: 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 (auto 0.000000/0.000000/0.000000) [vf] [in] 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [userdeint] 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [userdeint] (disabled) [vf] [autorotate] 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [autorotate] (disabled) [vf] [convert] 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [convert] (disabled) [vf] [out] 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [cplayer] VO: [vdpau] 1920x1080 vdpau[yuv420p] [cplayer] VO: Description: VDPAU with X11 [vo/vdpau] reconfig to 1920x1080 vdpau[yuv420p] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vo/vdpau] Window size: 1920x1200 [vo/vdpau] Video source: 1920x1080 (1:1) [vo/vdpau] Video display: (0, 0) 1920x1080 -> (0, 60) 1920x1080 [vo/vdpau] Video scale: 1.000000/1.000000 [vo/vdpau] OSD borders: l=0 t=60 r=0 b=60 [vo/vdpau] Video borders: l=0 t=60 r=0 b=60 [vo/vdpau] Recreating vdpau video mixer. [cplayer] first video frame after restart shown [cplayer] starting audio playback [cplayer] playback restart complete @ 0.000000 [vo/vdpau/x11] Disabling screensaver. [statusline] AV: 00:00:01 / 00:26:01 (0%) A-V: 0.000 Cache: 91s+150MB [cplayer] Set property: pause -> 1 [statusline] (Paused) AV: 00:00:01 / 00:26:01 (0%) A-V: 0.000 Cache: 91s+150MB [vo/vdpau/x11] Enabling screensaver. [statusline] (Paused) AV: 00:00:01 / 00:26:01 (0%) A-V: 0.000 Cache: 91s+150MB [vo/vdpau] Window size: 1920x1200 [vo/vdpau] Video source: 1920x1080 (1:1) [vo/vdpau] Video display: (0, 0) 1920x1080 -> (0, 60) 1920x1080 [vo/vdpau] Video scale: 1.000000/1.000000 [vo/vdpau] OSD borders: l=0 t=60 r=0 b=60 [vo/vdpau] Video borders: l=0 t=60 r=0 b=60 [cplayer] Set property: fullscreen -> 1 [statusline] (Paused) AV: 00:00:01 / 00:26:01 (0%) A-V: 0.000 Cache: 91s+150MB [vo/vdpau] Window size: 1920x1080 [vo/vdpau] Video source: 1920x1080 (1:1) [vo/vdpau] Video display: (0, 0) 1920x1080 -> (0, 0) 1920x1080 [vo/vdpau] Video scale: 1.000000/1.000000 [vo/vdpau] OSD borders: l=0 t=0 r=0 b=0 [vo/vdpau] Video borders: l=0 t=0 r=0 b=0 [statusline] (Paused) AV: 00:00:01 / 00:26:01 (0%) A-V: 0.000 Cache: 91s+150MB

CounterPillow commented 5 years ago

This sounds like an nvidia driver bug and you should most definitely not use the vdpau VO, as the 1030 should be good enough for the GPU VO.

lvmm commented 5 years ago

If it were indeed a driver bug, it would behave the same way with vo=gpu, wouldn't it? And other video players capable of using vdpau acceleration would exhibit the same symptoms, which isn't happening either, only mpv has this issue, but not e.g. mplayer.

CounterPillow commented 5 years ago

If it were indeed a driver bug, it would behave the same way with vo=gpu, wouldn't it?

No, because the GPU VO uses the normal shading pipeline, not the hardware overlay.

And other video players capable of using vdpau acceleration would exhibit the same symptoms

Are you using vdpau hardware decoding there, or also the vdpau video output? Because the two are different things. You can use vdpau hardware decoding without the vdpau VO.

Gusar321 commented 5 years ago

That's how overlays work. This isn't a bug. If other software doesn't show this behavior, that software is using the vdpau blitter instead of the overlay. Or that software configures a colorkey that's unlikely to found anywhere else on the desktop. mplayer uses {0.01, 0.02, 0.03, 0}, so almost but not completely black. There's nothing you can do about it, it's just how overlays work.

Edit: Wait, this happens if you minimize the mpv window?? That's not supposed to happen, it should only happen if the mpv window is still there, just behind other windows. If it happens when the window is minimized, that is a bug then. But the devs don't really care about vo=vdpau (cos there's not really any reason to use it), so it probably won't get fixed unless you provide a patch yourself.

lvmm commented 5 years ago

If other software doesn't show this behavior, that software is using the vdpau blitter instead of the overlay.

Not necessarily. As I said, I am not concerned with what happens during the playback, but when video playback is paused and the player is minimized it should release the overlay and initialize once again when the playback resumes.

mc4man commented 5 years ago

With same mpv build on 2 machines, 755m (optimus), GTX 1060m (no optimus), can't duplicate your issue at all. Anyway why not install a newer driver (may work better), 430.xx is readily available or just use the defaut vo (GPU) & if you want hwdec use nvdec (- your mpv build requires a min. nvidia driver of 396.24/410.48 for nvdec, that's likely to increase to at least 418.30 in near future.

ghost commented 5 years ago

You can customize the overlay colorkey with --vo-vdpau-colorkey. Other than that, just don't use this VO. It's outdated technology.

lvmm commented 5 years ago

As someone suggested in this issue, I tried to use vo=gpu, but couldn't - video is breaking up, so, I am afraid, this outdated technology is the only one that works.

ghost commented 5 years ago

I don't see where you said that before. Anyway, that must be some other hard to diagnose brokenness in your system. We had exactly the same problems with vo=xv years ago, doesn't mean we want anyone to use vo=xv.

CounterPillow commented 5 years ago

@lvmm fix your GPU's 3d acceleration (it's entirely possible you're currently falling back to llvmpipe, which would be very slow), and if you're on an Intel Atom or Centrino or Pentium disable vd-lavc-dr.

lvmm commented 5 years ago

@lvmm fix your GPU's 3d acceleration (it's entirely possible you're currently falling back to llvmpipe, which would be very slow)

How can I check it? It doesn't look like a performance issue and there is no difference between gpu and vdpau, for both CPU usage during video playback is negligible and GPU video decoder usage doesn't go above 20-30% and not event at maximum clock speed.

CounterPillow commented 5 years ago

@lvmm Make sure the glxinfo renderer string doesn't mention llvmpipe. Additionally, be aware that you need nvidia's proprietary drivers for the 1030 to be able to use it at any clock speed above the minimum clock, as nvidia prevents you from reclocking without their firmware.

Also I have no clue what you mean by "video is breaking up" so maybe you should elaborate if you don't mean there's framedrops.

lvmm commented 5 years ago

@CounterPillow glxinfo doesn't mention llvmpipe, I am using proprietary nvidia drivers, clock speed does change, and even locking it at maximum has no effect. What I am seeing may be vsync-related which is strange as it is a 60fps video - the same rate as the monitor: when video is panning the top part of the screen may look shifted and blocky. It is not reproducible when I try to view it frame by frame.

CounterPillow commented 5 years ago

Okay, so that is a vsync issue. The framerate doesn't matter, the problem is that the refresh of the monitor is not synced with the presentation.

The mpv FAQ on the wiki has a section on tearing on different setups and how to possibly alleviate it, see https://github.com/mpv-player/mpv/wiki/FAQ#X11Nvidia

lvmm commented 5 years ago

The mpv FAQ on the wiki has a section on tearing on different setups and how to possibly alleviate it, see https://github.com/mpv-player/mpv/wiki/FAQ#X11Nvidia

And what does it say? Try --vo=vdpau. QED.

ghost commented 5 years ago

It was us who added that, it doesn't invalidate any of our points. See what I've wrote in this issue before. I'm sorry that you spent so much money on a GPU with bad drivers.

CounterPillow commented 5 years ago

And what does it say? Try --vo=vdpau. QED.

Wow you conveniently didn't read any of the other things! Fantastic, I love people who are so interested in fixing their own problems instead of being passive aggressive on the issue tracker.

vdpau is a last resort for people who are too confused in their own mess of compositor and driver stacks to correctly get tearfree 3d acceleration working. As a last resort option, it comes with last resort issues, such as being a dead API based on outdated concepts.

Consider buying AMD next time.

mc4man commented 5 years ago

Sounds like an issue you could resolve in an interactive forum somewhere rather than here.

If you're using gnome-shell/mutter or unity-shell/compiz than tearing shouldn't be an issue. On a desktop GPU you would have had to have disabled vsync in nvidia-settings to cause. With an optimus device you'd need to use prime sync to eliminate, trivial to do so. If you are using some other version like Xubuntu than tearing is possible, searching a solution is easy.. There are many tear test vids around that would basically show if affected.

As far as driver, why use an old driver with that GPU, get either 430 or 435 from graphics-driver ppa. Also not mentioned is if you see such nonsense with progressive vids or just that/those interlaced ones.

If you have anywhere near a decent cpu you wouldn't need hwdec anyway with those sat dumps.. Anyway the default vo should work just fine with or without hwdec, with or without deinterlacing (- how easy it is to deinterlace with cuda I don't know, to me the man is a bit confusing there..

If inclined inxi -SCG would present basic info