Skip to main content
Topic: Tearing in mpv (Read 3536 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Tearing in mpv

Hello.

It's been about a year since the mpv update brought tearing to my system, it's time to do something about it... Tearing is present when viewing both local and remote files, but in the system itself, when viewing a video in Firefox or dragging windows, there is no tearing, only in mpv. It doesn't matter whether the window is maximized or not...

cat ~/.config/mpv/mpv.conf
Code: [Select]
volume=130
cache-secs=120
title='${filename/no-ext}'
hwdec=auto
hwdec-codecs=all
autofit=100%x75%
af=lavfi=[loudnorm=I=-16:TP=-1:LRA=2]
ytdl-format="bestvideo[vcodec^=avc1][height<=?720][fps<=?60]+bestaudio"
~ ❯

vainfo
Code: [Select]
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
 ❯

mpv --no-config Big\ Buck\ Bunny\ 60fps\ 4K\ -\ Official\ Blender\ Foundation\ Short\ Film\ \[aqz-KE-bpKQ\].mp4

Code: [Select]
● Video  --vid=1  (h264 1280x720 60 fps) [default]
● Audio  --aid=1  (aac 6ch 48000 Hz 386 kbps) [default]
AO: [pulse] 48000Hz 5.1 6ch float
VO: [gpu] 1280x720 yuv420p
AV: 00:00:31 / 00:10:34 (5%) A-V:  0.000 Dropped: 2

mpv -v Big\ Buck\ Bunny\ 60fps\ 4K\ -\ Official\ Blender\ Foundation\ Short\ Film\ \[aqz-KE-bpKQ\].mp4
Code: [Select]
[cplayer] Command line options: '-v' 'Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].mp4'
[cplayer] mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Apr  4 2025 13:33:40
[cplayer] libplacebo version: v7.349.0
[cplayer] FFmpeg version: n7.1
[cplayer] FFmpeg library versions:
[cplayer]    libavcodec      61.19.100
[cplayer]    libavdevice     61.3.100
[cplayer]    libavfilter     10.4.100
[cplayer]    libavformat     61.7.100
[cplayer]    libavutil       59.39.100
[cplayer]    libswresample   5.3.100
[cplayer]    libswscale      8.3.100
[cplayer] Configuration: -Db_pie=true -Dpython.bytecompile=1 -Dlibmpv=true -Dgl-x11=enabled -Dcaca=disabled -Dcdda=enabled -Ddrm=enabled -Ddvbin=enabled -Ddvdnav=enabled -Dlibarchive=enabled -Dopenal=enabled -Dprefix=/usr -Dlibexecdir=lib -Dsbindir=bin -Dauto_features=auto -Dbuildtype=plain -Dwrap_mode=nodownload
[cplayer] List of enabled features: alsa build-date cdda cplugins cuda-hwaccel cuda-interop dmabuf-interop-gl dmabuf-wayland drm dvbin dvdnav egl egl-drm egl-wayland egl-x11 ffmpeg ffnvcodec gbm gl gl-x11 glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs luajit memfd-create memrchr openal pipewire posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 sixel uchardet vaapi vaapi-drm vaapi-wayland vaapi-x11 vapoursynth vdpau vdpau-gl-x11 vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-32 wayland-protocols-1-38 wayland-protocols-1-39 wayland-protocols-1-41 x11 xv zimg zimg-st428 zlib
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[ifo_dvdnav] Opening /etc/mpv/encoding-profiles.conf
[bdmv/bluray] Opening /etc/mpv/encoding-profiles.conf
[file] Opening /etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /home/user/.config/mpv/mpv.conf
[ifo_dvdnav] Opening /home/user/.config/mpv/mpv.conf
[bdmv/bluray] Opening /home/user/.config/mpv/mpv.conf
[file] Opening /home/user/.config/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'volume' = '130' (flags = 4)
[cplayer] Setting option 'cache-secs' = '120' (flags = 4)
[cplayer] Setting option 'title' = '${filename/no-ext}' (flags = 4)
[cplayer] Setting option 'hwdec' = 'auto' (flags = 4)
[cplayer] Setting option 'hwdec-codecs' = 'all' (flags = 4)
[cplayer] Setting option 'autofit' = '100%x75%' (flags = 4)
[cplayer] Setting option 'af' = 'lavfi=[loudnorm=I=-16:TP=-1:LRA=2]' (flags = 4)
[cplayer] Setting option 'ytdl-format' = 'bestvideo[vcodec^=avc1][height<=?720][fps<=?60]+bestaudio' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[ifo_dvdnav] Opening /home/user/.config/mpv/input.conf
[bdmv/bluray] Opening /home/user/.config/mpv/input.conf
[file] Opening /home/user/.config/mpv/input.conf
[input] Parsing input config file /home/user/.config/mpv/input.conf
[input] Input config file /home/user/.config/mpv/input.conf parsed: 6 binds
[clipboard] Initialized vo clipboard backend.
[cplayer] Waiting for scripts...
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: auto_profiles/on_before_start_file
[cplayer] Failed sending hook command auto_profiles/on_before_start_file. Removing hook.
[cplayer] Running hook: auto_profiles/on_load
[cplayer] Failed sending hook command auto_profiles/on_load. Removing hook.
[cplayer] Running hook: ytdl_hook/on_load
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] playlist hook
[ifo_dvdnav] Opening Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].mp4
[bdmv/bluray] Opening Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].mp4
[file] Opening Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].mp4
[demux] Trying demuxers for level=normal.
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[osd/libass] libass API version: 0x1703000
[osd/libass] libass source: commit: 0.17.3-0-ge46aedea0a0d17da4c4ef49d84b94a7994664ab5-dirty
[osd/libass] Shaper: FriBidi 1.0.15 (SIMPLE) HarfBuzz-ng 11.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].mp4
[find_files] Loading external files in .
[cplayer] Running hook: auto_profiles/on_preloaded
[cplayer] Failed sending hook command auto_profiles/on_preloaded. Removing hook.
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 1
[cplayer] ● Video  --vid=1  (h264 1280x720 60 fps) [default]
[cplayer] ● Audio  --aid=1  (aac 6ch 48000 Hz 386 kbps) [default]
[vo/gpu] Probing for best GPU context.
[vo/gpu/auto] Initializing GPU context 'auto'
[vo/gpu/vulkan] Initializing GPU context 'waylandvk'
[vo/gpu/libplacebo] Initialized libplacebo v7.349.0 (API v349)
[vo/gpu/libplacebo] Creating vulkan instance with extensions:
[vo/gpu/libplacebo]     VK_KHR_get_physical_device_properties2
[vo/gpu/libplacebo]     VK_KHR_portability_enumeration
[vo/gpu/libplacebo]     VK_KHR_surface
[vo/gpu/libplacebo]     VK_KHR_wayland_surface
[vo/gpu/libplacebo] Failed creating instance: VK_ERROR_INCOMPATIBLE_DRIVER
[vo/gpu/libplacebo] Failed initializing vulkan instance
[vo/gpu/vulkan] Initializing GPU context 'x11vk'
[vo/gpu/libplacebo] Initialized libplacebo v7.349.0 (API v349)
[vo/gpu/libplacebo] Creating vulkan instance with extensions:
[vo/gpu/libplacebo]     VK_KHR_get_physical_device_properties2
[vo/gpu/libplacebo]     VK_KHR_portability_enumeration
[vo/gpu/libplacebo]     VK_KHR_surface
[vo/gpu/libplacebo]     VK_KHR_xlib_surface
[vo/gpu/libplacebo] Failed creating instance: VK_ERROR_INCOMPATIBLE_DRIVER
[vo/gpu/libplacebo] Failed initializing vulkan instance
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] Display 0 (LVDS-1): [0, 0, 1366, 768] @ 60.018644 FPS
[vo/gpu/x11] Current display FPS: 60.018644
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0xa, visual ID 0x21
[vo/gpu/x11] The XPresent extension was found.
[vo/gpu/x11] XPresent enabled.
[vo/gpu/opengl] GL_VERSION='4.2 (Core Profile) Mesa 25.0.3-arch1.1'
[vo/gpu/opengl] Detected desktop OpenGL 4.2.
[vo/gpu/opengl] GL_VENDOR='Intel'
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) HD Graphics 4000 (IVB GT2)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.20'
[vo/gpu/opengl] Loaded extension GL_ARB_invalidate_subdata.
[vo/gpu/opengl] Loaded extension GL_ARB_buffer_storage.
[vo/gpu/opengl] Loaded extension GL_ARB_shader_storage_buffer_object.
[vo/gpu/opengl] Loaded extension GL_ARB_compute_shader.
[vo/gpu/opengl] Loaded extension GL_ARB_arrays_of_arrays.
[vo/gpu/opengl] Loaded extension GL_ARB_debug_output.
[vo/gpu/opengl] Loaded extension GL_KHR_debug.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Assuming 60.018644 FPS for display sync.
[vd] Container reported FPS: 60.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_qsv (h264) - H264 video (Intel Quick Sync Video acceleration)
[vd]     h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] Looking at hwdec h264-nvdec...
[vo/gpu] Loading hwdec drivers for format: 'cuda'
[vo/gpu] Loading hwdec driver 'cuda'
Cannot load libcuda.so.1
[vo/gpu/cuda] Failed to load CUDA symbols
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec h264-vaapi...
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] Using EGL dmabuf interop via GL_EXT_EGL_image_storage
[vo/gpu/vaapi] Trying to open a x11 VA display...
[vo/gpu/vaapi/vaapi] libva: VA-API version 1.22.0
[vo/gpu/vaapi/vaapi] libva: User environment variable requested driver 'i965'
[vo/gpu/vaapi/vaapi] libva: Trying to open /usr/lib/dri/i965_drv_video.so
[vo/gpu/vaapi/vaapi] libva: Found init function __vaDriverInit_1_21
[vo/gpu/vaapi/vaapi] libva: va_openDriver() returns 0
[vo/gpu/vaapi/vaapi] Initialized VAAPI: version 1.22
[vo/gpu/vaapi] Going to probe surface formats (may log bogus errors)...
[vo/gpu/vaapi/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi] Done probing surface formats.
[vd] Trying hardware decoding via h264-vaapi.
[vd] Selected decoder: h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vf] User filter list:
[vf]   (empty)
[ad] Codec list:
[ad]     aac - AAC (Advanced Audio Coding)
[ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected decoder: aac - AAC (Advanced Audio Coding)
[user_filter_wrapper] Setting option 'graph' = 'loudnorm=I=-16:TP=-1:LRA=2' (flags = 0)
[af] User filter list:
[af]   lavfi (lavfi.00)
[cplayer] Starting playback...
[osd/libass] libass API version: 0x1703000
[osd/libass] libass source: commit: 0.17.3-0-ge46aedea0a0d17da4c4ef49d84b94a7994664ab5-dirty
[osd/libass] Shaper: FriBidi 1.0.15 (SIMPLE) HarfBuzz-ng 11.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[af] [in] 48000Hz 5.1 6ch floatp
[af] [lavfi] 48000Hz 5.1 6ch floatp
[af] [userspeed] 192000Hz 5.1 6ch double
[af] [userspeed] (disabled)
[af] [convert] 192000Hz 5.1 6ch double
[vd] Pixel formats supported by decoder: vdpau vulkan cuda vaapi yuv420p
[vd] Codec profile: Main (0x4d)
[vd] Requesting pixfmt 'vaapi' from decoder.
[vd] Using hardware decoding (vaapi).
[vd] Decoder format: 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 crop=1280x720+0+0
[vd] Using container aspect ratio.
[vf] [in] 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[vf] [userdeint] 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[vf] [userdeint] (disabled)
[vf] [autorotate] 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[vf] [autorotate] (disabled)
[vf] [convert] 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vf] [out] 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[ao] Trying audio driver 'pipewire'
[ao/pipewire] requested format: 192000 Hz, 5.1 channels, double
[ao/pipewire] Headers version: 1.4.1
[ao/pipewire] Library version: 1.4.1
[ao/pipewire] Could not connect to context '(null)': Host is down
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 192000 Hz, 5.1 channels, double
[ao/pulse] Library version: 17.0.0
[ao/pulse] Proto: 35
[ao/pulse] Server proto: 35
[ao/pulse] Unsupported format, using default
[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: 5.1
[ao/pulse] device buffer: 19200 samples.
[ao/pulse] using soft-buffer of 38400 samples.
[cplayer] AO: [pulse] 192000Hz 5.1 6ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 192000Hz 5.1 double -> 192000Hz 5.1 float
[af] [out] 192000Hz 5.1 6ch float
[cplayer] VO: [gpu] 1280x720 vaapi[nv12]
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1280x720+0+0
[vo/gpu/x11] not waiting for MapNotify
[vo/gpu] Resize: 1024x576
[vo/gpu] Window size: 1024x576 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1024x576
[vo/gpu] Video scale: 0.800000/0.800000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Dither to 8.
[cplayer] first video frame after restart shown
[cplayer] audio ready
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.000000, audio=playing, video=playing
[ao/pulse] starting AO
[vo/gpu] Resize: 1352x706
[vo/gpu] Window size: 1352x706 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (48, 0) 1255x706
[vo/gpu] Video scale: 0.980469/0.980556
[vo/gpu] OSD borders: l=48 t=0 r=49 b=0
[vo/gpu] Video borders: l=48 t=0 r=49 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu/x11] Disabling screensaver.
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/TTF/DejaVuSans.ttf, 0, DejaVuSans
[osd/libass] fontselect: (mpv-osd-symbols, 400, 0) -> mpv-osd-symbols-Regular, 0, mpv-osd-symbols-Regular
[vo/gpu] Reallocating OSD texture to 2048x256.
[cplayer] Set property: fullscreen -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[vo/gpu] Resize: 1352x706
[vo/gpu] Window size: 1352x706 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (48, 0) 1255x706
[vo/gpu] Video scale: 0.980469/0.980556
[vo/gpu] OSD borders: l=48 t=0 r=49 b=0
[vo/gpu] Video borders: l=48 t=0 r=49 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Resize: 1366x736
[vo/gpu] Window size: 1366x736 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (29, 0) 1308x736
[vo/gpu] Video scale: 1.021875/1.022222
[vo/gpu] OSD borders: l=29 t=0 r=29 b=0
[vo/gpu] Video borders: l=29 t=0 r=29 b=0
[vo/gpu] Reported display depth: 8
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[vo/gpu] Resize: 1366x768
[vo/gpu] Window size: 1366x768 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1366x768
[vo/gpu] Video scale: 1.067187/1.066667
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"t":0,"l":0} -> 1
[cplayer] Set property: pause -> 1
[vo/gpu/x11] Enabling screensaver.
[cplayer] Set property: pause -> 1
[vo/gpu/x11] Disabling screensaver.
[cplayer] EOF code: 5 
[vo/gpu/x11] Enabling screensaver.
[statusline] AV: 00:00:28 / 00:10:34 (5%) A-V: -0.000 Dropped: 5

The log obtained when executing command mpv -v --log-file=./log Big\ Buck\ Bunny\ 60fps\ 4K\ -\ Official\ Blender\ Foundation\ Short\ Film\ \[aqz-KE-bpKQ\].mp4 is attached as a file.

What can be done?

Re: Tearing in mpv

Reply #1
Code: [Select]
gpu-api=opengl # vulkan is incomplete and unofficial for anything below skylake.
vo=gpu
hwdec-codecs=all
hwdec=vaapi
video-sync = display-resample
ao=alsa # pulse sucks ass
Try this in mpv.conf, also press shift+i for information when it's playing the video.

Re: Tearing in mpv

Reply #2
Tried it, nothing changed. I also tried vulkan, but it works a little worse. I don't understand what to look at when pressing shift+i?

UPD.

The problem is observed on pantheon, xfce and mate (I don’t want to install environments on qt, because I’ll be exhausted cleaning the system later) and on all available kernels (stable, hardened, lts).

Re: Tearing in mpv

Reply #3
I'd be curious if the window manager / DE / Compositor was having a hand in this ?

With X you could
Disable any display manager.
Install xorg-xinit
start X with
Code: [Select]
startx /usr/bin/konsole
(substitute konsole with a terminal emulator you have)
run mpv and see if it still happens

Alternatively you could try installing a 'simple' window manager like openbox and starting that from your display manager.

This clearly won't fix the issue but could help let you know if it is entirely an mpv issue or not?

Edit:My skim reading missed the bit where you listed DE's you'd tried. My bad. But you'll lose little bar a bit of time trying the above.



Re: Tearing in mpv

Reply #4
gripped, once upon a time, tearing could be fixed with the TearFree option, but that was only for xf86-video-intel. I checked and it doesn't work anymore... Modern modesetting only supports this option with xorg-server-git, but I really don't want to compile X from source to check if it works.

Another option is to use a wayland session, but I can't get it to work and even created a topic on the forum.

Re: Tearing in mpv

Reply #5
I had a similar problem. I want to note that tearing only occurs with herbstluftwm, xmonad and awesome wm. I solved the problem by using mpv --no-keepaspect-window

P.S.

I am using the open source nvidia driver.

Re: Tearing in mpv

Reply #6
but I really don't want to compile X from source to check if it works.
Why not ? It's just installing a package from AUR. If it doesn't work install standard xorg-server again.



Re: Tearing in mpv

Reply #8
I was curious if the patches from https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1006 would apply to the standard Artix xorg-server source.
With a tiny one character change to the diff they did.
Spoiler (click to show/hide)

I built it and installed the produced  xorg-server xorg-server-common packages and rebooted. My X still worked but I have no way to test further as I don't have an intel GPU.

So in theory you can have this tearfree option without having all the changes xorg-server-git introduces.


Re: Tearing in mpv

Reply #9
I had tearing with nouveau on a Dell M4500 playing HD videos in Waterfox, it wasn't so bad with lower resolutions like SD, but I found a tip online that suggested selecting a menu option to turn off hardware acceleration in the browser. This works much better even if it sounds counter-intuitive. It looks like you have Intel graphics amongst other differences in this issue though. You could try VLC to see if the problem exists there too. I usually use VLC myself, so the suggestions from others here are likely to be more helpful and relevant.  :D

 

Re: Tearing in mpv

Reply #10
but I really don't want to compile X from source to check if it works.
Why not ? It's just installing a package from AUR. If it doesn't work install standard xorg-server again.


Because TearFree fixed the tearing system-wide, and since the problem only occurs in mpv, the problem is most likely in mpv, building the package in this case seems too radical.

Re: Tearing in mpv

Reply #11
I had tearing with nouveau on a Dell M4500 playing HD videos in Waterfox, it wasn't so bad with lower resolutions like SD, but I found a tip online that suggested selecting a menu option to turn off hardware acceleration in the browser. This works much better even if it sounds counter-intuitive. It looks like you have Intel graphics amongst other differences in this issue though. You could try VLC to see if the problem exists there too. I usually use VLC myself, so the suggestions from others here are likely to be more helpful and relevant.  :D
I certainly won't install VLC since it's on qt and I'm a toolkitphobe :) I can tell you exactly where there is no tearing - in mplayer! Despite the lack of vaapi, it puts less load on the processor, and the laptop heats up much less when watching than in mpv, and there is no green screen when rewinding. But it doesn't have a proper osd (or whatever it's called) where you can conveniently click the mouse and rewind to where you need...

Re: Tearing in mpv

Reply #12
building the package in this case seems too radical.
You do you my friend. We obviously have very different ideas of what is radical and that is in no way to suggest that you are wrong.
For me patching packages is very normal. I'd try it just to see what happens and maybe gain information. Because switching back is very simple.

You are right that if this is only happening with mpv it suggests some issue between mpv and the video driver and or compositor ? It can't just be mpv or we'd all have the same issue.
Maybe there is a simple option, whether mpv, kernel or video driver, that can fix this?

Maybe this 'tearfree' xorg-server build would fix it but introduce system wide slowdowns, or other issues, which are unacceptable?
As ####### said you could just not use mpv. Personally I'd find that hard as mpv is my favourite player.

Re: Tearing in mpv

Reply #13
Alternatively you could try installing a 'simple' window manager like openbox and starting that from your display manager.

Or just try to run mpv from a TTY directly for a start?

Re: Tearing in mpv

Reply #14
I wasn't suggesting any permanent switch to VLC, just do pacman -S vlc, try a couple of videos, then pacman -Rs vlc afterwards to remove it plus it's dependencies, and I doubt there will be a huge amount of deps in terms of mb either.  Probably take about 5 or 10 minutes, it would be a simple test which might add a bit more info if any mpv devs happened to be searching about. All these apps are likely to have both differences and similarities in how they work under the hood which might help someone debug mpv. But if you don't want to that's fine by me, after all I only occasionally install and use mpv for testing things as a quick comparison...  :D