mpv-player / mpv

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

Videos open much slower than expected. #11391

Closed Schweiger-Jacob closed 1 year ago

Schweiger-Jacob commented 1 year ago

Important Information

Provide following Information:

ffmpeg] AVHWDeviceContext: Failed to query surface attributes: 20 (the requested function is not implemented). [vo/gpu/vaapi-egl] failed to retrieve libavutil frame constraints

If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Try to reproduce your issue with --no-config first. If it isn't reproducible with --no-config try to first find out which option or script causes your issue.

Describe the reproduction steps as precise as possible. It's very likely that the bug you experience wasn't reproduced by the developer because the workflow differs from your own.

Expected behavior

video opens in less than a second or so

Actual behavior

video takes more than 6 seconds to open (i timed it =)

Log file

Make a log file made with -v or --log-file=output.txt, paste it to https://0x0.st/ or attach it to the github issue, and replace this text with a link to it.

The issue will be closed for ignoring the issue template.

Sample files

Sample files needed to reproduce this issue can be uploaded to https://0x0.st/ or similar sites. (Only needed if the issue cannot be reproduced without it.) Do not use garbage like "cloud storage", especially not Google Drive.

Schweiger-Jacob commented 1 year ago

I did't see an option to attach the log to the github post so here it is [cplayer] Command line options: '--profile=terminal-watching' '-v' 'The Title of this Video was Typed with Donkey Kong Bongos [ueZaTTSFU28].webm' [cplayer] mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects [cplayer] built on UNKNOWN [cplayer] FFmpeg library versions: [cplayer] libavutil 56.70.100 [cplayer] libavcodec 58.134.100 [cplayer] libavformat 58.76.100 [cplayer] libswscale 5.9.100 [cplayer] libavfilter 7.110.100 [cplayer] libswresample 3.9.100 [cplayer] FFmpeg version: 4.4.2-0ubuntu0.22.04.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-dvdnav --enable-libmpv-shared --enable-sdl2 --disable-build-date --enable-dvbin [cplayer] List of enabled features: alsa asm caca cdda cplayer cplugins cuda-hwaccel cuda-interop debug-build drm dvbin dvdnav egl egl-drm egl-helpers egl-x11 ffmpeg ffmpeg-aviocontext-bytes-read ffnvcodec gbm gbm.h gl gl-wayland glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libm libmpv-shared libplacebo librt linux-fstatfs linux-input-event-codes lua lua52 memfd_create optimize plain-gl posix posix-or-mingw pthreads pulse rubberband sdl2 sdl2-audio sdl2-gamepad sdl2-video sixel spirv-cross spirv-cross-shared stdatomic uchardet vaapi vaapi-drm vaapi-egl vaapi-vulkan vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vector vt.h vulkan wayland wayland-protocols x11 xv zimg zlib [cplayer] Reading config file /etc/mpv/encoding-profiles.conf [cplayer] Applying profile 'default'... [cplayer] Reading config file /etc/mpv/mpv.conf [cplayer] Applying profile 'default'... [cplayer] Setting option 'hwdec' = 'vaapi' (flags = 4) [cplayer] Reading config file /home/jacob/.config/mpv/mpv.conf [cplayer] Applying profile 'default'... [cplayer] Setting option 'profile' = 'norm' (flags = 4) [cplayer] Applying profile 'norm'... [cplayer] Setting option 'volume' = '100' (flags = 4) [cplayer] Setting option 'volume-max' = '300' (flags = 4) [cplayer] Setting option 'border' = '' (flags = 4) [cplayer] Setting option 'keepaspect-window' = '' (flags = 4) [cplayer] Setting option 'geometry' = '' (flags = 4) [cplayer] Setting option 'profile' = 'terminal-watching' (flags = 8) [cplayer] Applying profile 'terminal-watching'... [cplayer] Setting option 'volume' = '100' (flags = 12) [cplayer] Setting option 'volume-max' = '300' (flags = 12) [cplayer] Setting option 'border' = 'no' (flags = 12) [cplayer] Setting option 'monitoraspect' = '1.6' (flags = 12) [cplayer] Setting option 'keepaspect-window' = 'no' (flags = 12) [cplayer] Setting option 'geometry' = '50%x100%' (flags = 12) [cplayer] Setting option 'v' = '' (flags = 8) [ifo_dvdnav] Opening /home/jacob/.config/mpv/input.conf [bdmv/bluray] Opening /home/jacob/.config/mpv/input.conf [file] Opening /home/jacob/.config/mpv/input.conf [input] Parsing input config file /home/jacob/.config/mpv/input.conf [input] Input config file /home/jacob/.config/mpv/input.conf parsed: 7 binds [cplayer] Waiting for scripts... [osd/libass] libass API version: 0x1502000 [osd/libass] libass source: tarball: 0.15.2 [osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX) [osd/libass] Setting up fonts... [osd/libass] Using font provider fontconfig [osd/libass] Done. [cplayer] Set property: shared-script-properties -> 1 [cplayer] Set property: shared-script-properties -> 1 [cplayer] Done loading scripts. [cplayer] Running hook: ytdl_hook/on_load [ytdl_hook] ytdl:// hook [ytdl_hook] not a ytdl:// url [ifo_dvdnav] Opening The Title of this Video was Typed with Donkey Kong Bongos [ueZaTTSFU28].webm [bdmv/bluray] Opening The Title of this Video was Typed with Donkey Kong Bongos [ueZaTTSFU28].webm [file] Opening The Title of this Video was Typed with Donkey Kong Bongos [ueZaTTSFU28].webm [cplayer] Set property: shared-script-properties -> 1 [demux] Trying demuxers for level=normal. [osd/libass] libass API version: 0x1502000 [osd/libass] libass source: tarball: 0.15.2 [mkv] Deferring reading cues. [mkv] All headers are parsed! [osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX) [osd/libass] Setting up fonts... [demux] Detected file format: Matroska [cplayer] Opening done: The Title of this Video was Typed with Donkey Kong Bongos [ueZaTTSFU28].webm [osd/libass] Using font provider fontconfig [osd/libass] Done. [cplayer] Set property: shared-script-properties -> 1 [find_files] Loading external files in . [cplayer] Running hook: ytdl_hook/on_preloaded [mkv] select track 0 [mkv] select track 1 [cplayer] (+) Video --vid=1 () (vp9 1920x1080 30.000fps) [cplayer] (+) Audio --aid=1 --alang=eng () (opus 2ch 48000Hz) [vo/gpu] Probing for best GPU context. [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 (eDP-1): [0, 0, 3072, 1920] @ 60.137817 FPS [vo/gpu/x11] Current display FPS: 60.137817 [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 0x15, visual ID 0x21 [vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 22.2.5' [vo/gpu/opengl] Detected desktop OpenGL 4.6. [vo/gpu/opengl] GL_VENDOR='Intel' [vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) UHD Graphics (TGL GT1)' [vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60' [vo/gpu] Testing FBO format rgba16f [vo/gpu] Using FBO format rgba16f. [vo/gpu] No advanced processing required. Enabling dumb mode. [vo/gpu] Assuming 60.137817 FPS for display sync. [vd] Container reported FPS: 30.000000 [vd] Codec list: [vd] vp9 - Google VP9 [vd] vp9_v4l2m2m (vp9) - V4L2 mem2mem VP9 decoder wrapper [vd] libvpx-vp9 (vp9) - libvpx VP9 [vd] vp9_cuvid (vp9) - Nvidia CUVID VP9 decoder [vd] vp9_qsv (vp9) - VP9 video (Intel Quick Sync Video acceleration) [vd] Opening decoder vp9 [vd] Looking at hwdec vp9-vaapi... [vo/gpu] Loading hwdec driver 'vaapi-egl' [vo/gpu/vaapi-egl] using VAAPI EGL interop [vo/gpu/vaapi-egl] Trying to open a x11 VA display... [vo/gpu/vaapi-egl/vaapi] Initialized VAAPI: version 1.14 [vo/gpu/vaapi-egl] Going to probe surface formats (may log bogus errors)... [ffmpeg] AVHWDeviceContext: Failed to query surface attributes: 20 (the requested function is not implemented). [vo/gpu/vaapi-egl] failed to retrieve libavutil frame constraints [vo/gpu/vaapi-egl] Done probing surface formats. [vo/gpu] Loading hwdec driver 'cuda-nvdec' [vo/gpu/cuda-nvdec] cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected [vo/gpu] Loading failed. [vo/gpu] Loading hwdec driver 'drmprime-drm' [vo/gpu/drmprime-drm] Failed to retrieve DRM fd from native display. [vo/gpu] Loading failed. [vd] Trying hardware decoding via vp9-vaapi. [vd] Selected codec: vp9 (Google VP9) [vf] User filter list: [vf] (empty) [ad] Codec list: [ad] opus - Opus [ad] libopus (opus) - libopus Opus [ad] Opening decoder opus [ad] Requesting 1 threads for decoding. [ad] Selected codec: opus (Opus) [af] User filter list: [af] (empty) [cplayer] Starting playback... [af] [in] 48000Hz stereo 2ch floatp [af] [userspeed] 48000Hz stereo 2ch floatp [af] [userspeed] (disabled) [af] [convert] 48000Hz stereo 2ch floatp [vd] Pixel formats supported by decoder: cuda vaapi_vld vdpau yuv420p [vd] Codec profile: Profile 0 (0x0) [vd] Requesting pixfmt 'vaapi_vld' from decoder. [vd] Using hardware decoding (vaapi). [vd] Decoder format: 1920x1080 [0:1] vaapi[nv12] bt.709/auto/auto/limited/auto CL=unknown [vd] Using container aspect ratio. [vf] [in] 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [userdeint] 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [userdeint] (disabled) [vf] [autorotate] 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [autorotate] (disabled) [vf] [convert] 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vf] [convert] (disabled) [vf] [out] 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [ao] Trying audio driver 'pulse' [ao/pulse] requested format: 48000 Hz, stereo channels, floatp [ao/pulse] Library version: 15.99.0 [ao/pulse] Proto: 35 [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 float [cplayer] AO: Description: PulseAudio audio output [autoconvert] inserting resampler [swresample] format change, reinitializing resampler [swresample] 48000Hz stereo floatp -> 48000Hz stereo float [af] [out] 48000Hz stereo 2ch float [cplayer] VO: [gpu] 1920x1080 vaapi[nv12] [cplayer] VO: Description: Shader-based GPU Renderer [vo/gpu] reconfig to 1920x1080 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 [vo/gpu/x11] not waiting for MapNotify [vo/gpu] Resize: 1536x1840 [vo/gpu] Window size: 1536x1840 (Borders: l=0 t=0 r=0 b=0) [vo/gpu] Video source: 1920x1080 (1:1) [vo/gpu] Video display: (0, 0) 1920x1080 -> (0, 488) 1536x864 [vo/gpu] Video scale: 0.800000/0.800000 [vo/gpu] OSD borders: l=0 t=488 r=0 b=488 [vo/gpu] Video borders: l=0 t=488 r=0 b=488 [vo/gpu] Reported display depth: 8 [vo/gpu] Testing FBO format rgba16f [vo/gpu] Using FBO format rgba16f. [vo/gpu] No advanced processing required. Enabling dumb mode. [cplayer] first video frame after restart shown [cplayer] Set property: shared-script-properties -> 1 [cplayer] audio ready [cplayer] delaying audio start 0.001000 vs. 0.000000, diff=0.001000 [cplayer] playback restart complete @ 0.000000, audio=ready, video=playing [statusline] AV: 00:00:00 / 00:20:39 (0%) A-V: 0.000 Cache: 685s/150MB [cplayer] starting audio playback [vo/gpu/x11] Disabling screensaver. [ao/pulse] starting AO [cplayer] Set property: shared-script-properties -> 1 [statusline] AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 683s/150MB [cplayer] Set property: shared-script-properties -> 1 [statusline] AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 683s/150MB [osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/truetype/dejavu/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 2048x1024. [statusline] AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 684s/150MB [cplayer] Set property: pause -> 1 [statusline] (Paused) AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 684s/150MB [vo/gpu/x11] Enabling screensaver. [statusline] (Paused) AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 684s/150MB [cplayer] Set property: shared-script-properties -> 1 [statusline] (Paused) AV: 00:00:04 / 00:20:39 (0%) A-V: 0.000 Cache: 684s/150MB

CounterPillow commented 1 year ago

Please use --log-file, not -v, so that it includes timestamps for the log lines.

Schweiger-Jacob commented 1 year ago

log.txt

CounterPillow commented 1 year ago

the problem is here:

[   0.265][v][vo/gpu] Loading hwdec driver 'cuda-nvdec'
[   5.027][v][vo/gpu/cuda-nvdec] cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

mpv is probing which hwdec interop to use for gpu<->hwdec interop. This leads to it loading some CUDA related driver still on your system that is very slow to load (as is expected of anything nvidia).

To confirm this, try running with the option --gpu-hwdec-interop=vaapi.

Schweiger-Jacob commented 1 year ago

the problem is here:

[   0.265][v][vo/gpu] Loading hwdec driver 'cuda-nvdec'
[   5.027][v][vo/gpu/cuda-nvdec] cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

mpv is probing which hwdec interop to use for gpu<->hwdec interop. This leads to it loading some CUDA related driver still on your system that is very slow to load (as is expected of anything nvidia).

To confirm this, try running with the option --gpu-hwdec-interop=vaapi.

I got

No hwdec backend named 'vaapi' found! Error parsing option gpu-hwdec-interop (option parameter could not be parsed) Setting commandline option --gpu-hwdec-interop=vaapi failed.

as the response

Dudemanguy commented 1 year ago

It's --gpu-hwdec-interop=vaapi-egl in your version of mpv. The name changed later.

Schweiger-Jacob commented 1 year ago

It's --gpu-hwdec-interop=vaapi-egl in your version of mpv. The name changed later.

Thank you that worked. Videos now open very fast.

Dudemanguy commented 1 year ago

FYI, the slow probing is fixed in 0.35 so you won't need that option on the next version.