mpv-player / mpv

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

mpv 0.30 is broken : video and sound out of sync #7085

Closed ebachard closed 4 years ago

ebachard commented 4 years ago

mpv version and platform

Testing master (1 hour ago), everything seems to be broken on the acceleration side on Linux. Fortunaly, I had a backup of 0.29 sources, and everything was fine after rebuilding it (ufff)

HTH. Thanks a lot for this nice sofwtare

mpv -version (using ffmpeg from master too) $ mpv -version

mpv 0.30.0-16-g7384b05433 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects
 built on Fri Oct 25 19:09:08 CEST 2019
ffmpeg library versions:
   libavutil       56.35.101
   libavcodec      58.59.102
   libavformat     58.33.100
   libswscale      5.6.100
   libavfilter     7.65.100
   libswresample   3.6.100
ffmpeg version: N-95554-g9d711a90fd

Reproduction steps

cd mpv

./waf configure  --enable-sdl2 \
                 --disable-debug \
                 --enable-openal

./waf -j4

sudo ./waf install && sudo ldconfig 

Nothing else  :-)

Expected behavior

Open any video should work as previously

 mpv ~/Titres/AaRON_Lili.webm 
[10015066] Playing: /home/eric/Titres/AaRON_Lili.webm
[10016808]  (+) Video --vid=1 (*) (vp9 426x240 25.000fps)
[10016828]  (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[10098056] [vo/sdl] Using opengl
[10153999] AO: [pulse] 48000Hz stereo 2ch float
[10160543] VO: [sdl] 426x240 yuv420p
[23200225] AV: 00:00:13 / 00:04:01 (5%) A-V:  0.000
[23720524] [input] No key binding found for key 'Alt+F4'.
[23723133] 
[23723159] 
[23723166] Exiting... (Quit)

Actual behavior

mpv  ~/Titres/AaRON_Lili.webm 
[10019186]  (+) Video --vid=1 (*) (vp9 426x240 25.000fps)
[10019204]  (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[10019634] Error opening/initializing the selected video_out (--vo) device.
[10019664] Video: no video
[10020664] 
[10020679] 
[10020686] Exiting... (Errors when loading file)
  1. 
    And when I'm lucky, got video and sound out of sync.

### Sample files

Any .mp4 or .webm file should do it ( tested 5 or 6 and the result was similar)

Using SDL2 2.0.9  (2.0.10 has some problems with images)

Last but not least: 

vainfo returns : 

$ vainfo libva info: VA-API version 1.6.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'i965' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_1_5 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.6 (libva 2.1.0) vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.4.0.pre1 (2.3.0-22-g9bc30a0) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointEncSliceLP VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointEncSlice VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSlice VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointEncSlice VAProfileVP9Profile2 : VAEntrypointVLD


vdpauinfo : 

$ vdpauinfo display: :0.0 screen: 0 libva info: VA-API version 1.6.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'i965' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_1_5 libva info: va_openDriver() returns 0 API version: 1 Information string: OpenGL/VAAPI backend for VDPAU

Video surface:

name width height types

420 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 422 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 444 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8

Decoder capabilities:

name level macbs width height

MPEG1 --- not supported --- MPEG2_SIMPLE --- not supported --- MPEG2_MAIN --- not supported --- H264_BASELINE 51 16384 2048 2048 H264_MAIN 51 16384 2048 2048 H264_HIGH 51 16384 2048 2048 VC1_SIMPLE --- not supported --- VC1_MAIN --- not supported --- VC1_ADVANCED --- not supported --- MPEG4_PART2_SP --- not supported --- MPEG4_PART2_ASP --- not supported --- DIVX4_QMOBILE --- not supported --- DIVX4_MOBILE --- not supported --- DIVX4_HOME_THEATER --- not supported --- DIVX4_HD_1080P --- not supported --- DIVX5_QMOBILE --- not supported --- DIVX5_MOBILE --- not supported --- DIVX5_HOME_THEATER --- not supported --- DIVX5_HD_1080P --- not supported --- H264_CONSTRAINED_BASELINE 51 16384 2048 2048 H264_EXTENDED --- not supported --- H264_PROGRESSIVE_HIGH --- not supported --- H264_CONSTRAINED_HIGH --- not supported --- H264_HIGH_444_PREDICTIVE --- not supported --- HEVC_MAIN --- not supported --- HEVC_MAIN_10 --- not supported --- HEVC_MAIN_STILL --- not supported --- HEVC_MAIN_12 --- not supported --- HEVC_MAIN_444 --- not supported ---

Output surface:

name width height nat types

B8G8R8A8 16384 16384 y
R8G8B8A8 16384 16384 y
R10G10B10A2 16384 16384 y
B10G10R10A2 16384 16384 y
A8 16384 16384 y

Bitmap surface:

name width height

B8G8R8A8 16384 16384 R8G8B8A8 16384 16384 R10G10B10A2 16384 16384 B10G10R10A2 16384 16384 A8 16384 16384

Video mixer:

feature name sup

DEINTERLACE_TEMPORAL - DEINTERLACE_TEMPORAL_SPATIAL - INVERSE_TELECINE - NOISE_REDUCTION - SHARPNESS - LUMA_KEY - HIGH QUALITY SCALING - L1 - HIGH QUALITY SCALING - L2 - HIGH QUALITY SCALING - L3 - HIGH QUALITY SCALING - L4 - HIGH QUALITY SCALING - L5 - HIGH QUALITY SCALING - L6 - HIGH QUALITY SCALING - L7 - HIGH QUALITY SCALING - L8 - HIGH QUALITY SCALING - L9 -

parameter name sup min max

VIDEO_SURFACE_WIDTH -
VIDEO_SURFACE_HEIGHT -
CHROMA_TYPE -
LAYERS -

attribute name sup min max

BACKGROUND_COLOR -
CSC_MATRIX -
NOISE_REDUCTION_LEVEL -
SHARPNESS_LEVEL -
LUMA_KEY_MIN_LUMA -
LUMA_KEY_MAX_LUMA -


glxinfo -B:

$ glxinfo -B name of display: :0.0 display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Intel Open Source Technology Center (0x8086) Device: Mesa DRI Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2) (0x3ea0) Version: 19.3.0 Accelerated: yes Video memory: 3072MB Unified memory: yes Preferred profile: core (0x1) Max core profile version: 4.5 Max compat profile version: 4.5 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.2 OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2) OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.3.0-devel (git-9a7a92c1ec) OpenGL core profile shading language version string: 4.50 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.5 (Compatibility Profile) Mesa 19.3.0-devel (git-9a7a92c1ec) OpenGL shading language version string: 4.50 OpenGL context flags: (none) OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 19.3.0-devel (git-9a7a92c1ec) OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Akemi commented 4 years ago

a full log (--log-file=) of both cases would most likely be helpful.

ghost commented 4 years ago

I hope you know that neither vaapi nor vdpau are used with vo_sdl, and while the SDL 2D API probably uses GL, it's not really of interest either. I suspect that you probably force vo=sdl, but didn't build with libsdl.

ebachard commented 4 years ago

I'll try to find the time to provide a log asap. Waiting, the configure output gives:

$ ./waf configure  --enable-sdl2 --disable-debug  --enable-openal
Setting top to                           :/aPath/Devel/mpv 
Setting out to                           : /aPath/Devel/mpv/build 
Checking for waf version in 1.8.4-2.1.0  : ok 
Checking for program 'cc'                : /usr/bin/cc 
Checking for program 'pkg-config'        : /usr/bin/pkg-config 
Checking for program 'ar'                : /usr/bin/ar 
Checking for program 'rst2html'          : not found 
Checking for program 'rst2man'           : not found 
Checking for program 'rst2pdf'           : not found 
Checking for program 'windres'           : not found 
Checking for program 'perl'              : /usr/bin/perl 
Checking for 'gcc' (C compiler)          : /usr/bin/cc 
Detected target OS:                      : os-linux 
Checking for compiler flags -std=c11     : yes 
Checking for compiler flags -Werror -Werror=implicit-function-declaration : yes 
Checking for compiler flags -Werror -Wno-error=deprecated-declarations    : yes 
Checking for compiler flags -Werror -Wno-error=unused-function            : yes 
Checking for compiler flags -Werror -Wempty-body                          : yes 
Checking for compiler flags -Werror -Wdisabled-optimization               : yes 
Checking for compiler flags -Werror -Wstrict-prototypes                   : yes 
Checking for compiler flags -Werror -Wno-format-zero-length               : yes 
Checking for compiler flags -Werror -Werror=format-security               : yes 
Checking for compiler flags -Werror -Wno-redundant-decls                  : yes 
Checking for compiler flags -Werror -Wvla                                 : yes 
Checking for compiler flags -Werror -Wno-format-truncation                : yes 
Checking for LGPL (version 2.1 or later) build                            : disabled 
Checking for GPL (version 2 or later) build                               : yes 
Checking for internal audio filter chain                                  : yes 
Checking for mpv CLI player                                               : yes 
Checking for shared library                                               : disabled 
Checking for static library                                               : disabled 
Checking for static build                                                 : disabled 
Checking for whether to include binary compile time                       : yes 
Checking for whether to optimize                                          : yes 
Checking for whether to compile-in debugging information                  : disabled 
Checking for manpage generation                                           : no (missing RST2MAN) 
Checking for html manual generation                                       : disabled 
Checking for pdf manual generation                                        : disabled 
Checking for dynamic loader                                               : yes 
Checking for C plugins                                                    : yes 
Checking for inline assembly (currently without effect)                   : yes 
Checking for test suite (using cmocka)                                    : disabled 
Checking for generate a clang compilation database                        : disabled 
Checking for static Swift linking                                         : disabled 
Checking for compiler support for noexecstack                             : yes 
Checking for linker support for --nxcompat --no-seh --dynamicbase         : no 
Checking for -lm                                                          : yes 
Checking for MinGW                                                        : os-win32 not found 
Checking for POSIX environment                                            : yes 
Checking for Android environment                                          : no 
Checking for tvOS environment                                             : no 
Checking for Android EGL support                                          : android not found 
Checking for development environment                                      : yes 
Checking for macOS Swift build tools                                      : os-darwin not found 
Checking for Universal Windows Platform                                   : disabled 
Checking for win32 desktop APIs                                           : os-win32 not found 
Checking for internal pthread wrapper for win32 (Vista+)                  : posix found 
Checking for POSIX threads                                                : yes 
Checking for GNU C extensions                                             : yes 
Checking for stdatomic.h                                                  : yes 
Checking for C11 aligned_alloc()                                          : yes 
Checking for stdatomic.h support or slow emulation                        : yes 
Checking for linking with -lrt                                            : yes 
Checking for iconv                                                        : yes 
Checking for w32/dos paths                                                : os-win32 not found 
Checking for spawnp()/kill() POSIX support                                : yes 
Checking for spawnp()/kill() Android replacement                          : posix-spawn-native found 
Checking for any spawnp()/kill() support                                  : yes 
Checking for Windows pipe support                                         : posix found 
Checking for glob() POSIX support                                         : yes 
Checking for glob() win32 replacement                                     : posix found 
Checking for any glob() support                                           : yes 
Checking for fchmod()                                                     : yes 
Checking for vt.h                                                         : yes 
Checking for gbm.h                                                        : yes 
Checking for GLIBC API for setting thread name                            : yes 
Checking for OSX API for setting thread name                              : glibc-thread-name found 
Checking for BSD API for setting thread name                              : glibc-thread-name found 
Checking for BSD's fstatfs()                                              : no 
Checking for Linux's fstatfs()                                            : yes 
Checking for Linux's memfd_create()                                       : yes 
Checking for Samba support (makes mpv GPLv3)                              : disabled 
Checking for Lua                                                          : yes (version found: 51obsd) 
Checking for Javascript (MuJS backend)                                    : no ('mujs >= 1.0.0' not found) 
Checking for SSA/ASS support                                              : yes 
Checking for libass OSD support                                           : yes 
Checking for dummy OSD support                                            : libass-osd found 
Checking for zlib                                                         : yes 
Checking for Bluray support                                               : no ('libbluray >= 0.3.0' not found) 
Checking for dvdnav support                                               : disabled 
Checking for cdda support (libcdio)                                       : disabled 
Checking for uchardet support                                             : no ('uchardet' not found) 
Checking for librubberband support                                        : no ('rubberband >= 1.8.0' not found) 
Checking for libzimg support (for vf_fingerprint)                         : yes 
Checking for LCMS2 support                                                : no ('lcms2 >= 2.6' not found) 
Checking for VapourSynth filter bridge                                    : no ('vapoursynth >= 24 vapoursynth-script >= 23' not found) 
Checking for libarchive wrapper for reading zip files and more            : no ('libarchive >= 3.0.0' not found) 
Checking for DVB input module                                             : disabled 
Checking for SDL2                                                         : yes 
Checking for SDL2 gamepad input                                           : yes 
Checking for FFmpeg/Libav present                                         : yes 
Checking for FFmpeg/Libav libavutil present                               : yes 
Checking for libav* is FFmpeg                                             : yes 
Checking for libav* is Libav                                              : no 
Checking for Libav/FFmpeg library versions                                : yes 
Checking for libavdevice                                                  : yes 
Checking for Disable all known FFmpeg ABI violations                      : disabled 
Checking for SDL2 audio output                                            : yes 
Checking for OSS                                                          : yes 
Checking for RSound audio output                                          : no 
Checking for sndio audio input/output                                     : disabled 
Checking for PulseAudio audio output                                      : yes 
Checking for JACK audio output                                            : yes 
Checking for OpenAL audio output                                          : yes 
Checking for OpenSL ES audio output                                       : no 
Checking for ALSA audio output                                            : yes 
Checking for CoreAudio audio output                                       : no 
Checking for AudioUnit output for iOS                                     : no 
Checking for WASAPI audio output                                          : os-win32 not found 
Checking for SDL2 video output                                            : yes 
Checking for Cocoa                                                        : no 
Checking for DRM                                                          : yes 
Checking for DRM Prime ffmpeg support                                     : yes 
Checking for GBM                                                          : yes 
Checking for wayland-scanner                                              : yes 
Checking for wayland-protocols                                            : yes 
Checking for Wayland                                                      : yes 
Checking for X11                                                          : no ('x11 >= 1.0.0 xscrnsaver >= 1.0.0 xext >= 1.0.0 xinerama >= 1.0.0 xrandr >= 1.2.0' not found) 
Checking for Xv video output                                              : x11 not found 
Checking for OpenGL Cocoa Backend                                         : cocoa not found 
Checking for OpenGL X11 Backend                                           : x11 not found 
Checking for OpenGL X11 EGL Backend                                       : x11 not found 
Checking for OpenGL DRM EGL Backend                                       : yes 
Checking for OpenGL Wayland Backend                                       : yes 
Checking for OpenGL Win32 Backend                                         : win32-desktop not found 
Checking for OpenGL/DirectX Interop Backend                               : gl-win32 not found 
Checking for OpenGL ANGLE headers                                         : os-win32 not found 
Checking for OpenGL Win32 ANGLE Library                                   : egl-angle not found 
Checking for OpenGL Win32 ANGLE Backend                                   : egl-angle not found 
Checking for VDPAU acceleration                                           : x11 not found 
Checking for VDPAU with OpenGL/X11                                        : vdpau not found 
Checking for VAAPI acceleration                                           : yes 
Checking for VAAPI (X11 support)                                          : x11 not found 
Checking for VAAPI (Wayland support)                                      : yes 
Checking for VAAPI (DRM/EGL support)                                      : yes 
Checking for VAAPI EGL on X11                                             : vaapi-x11 not found 
Checking for VAAPI EGL                                                    : yes 
Checking for CACA                                                         : no ('caca >= 0.99.beta18' not found) 
Checking for JPEG support                                                 : yes 
Checking for Direct3D support                                             : win32-desktop not found 
Checking for libshaderc SPIR-V compiler (shared library)                  : yes 
Checking for libshaderc SPIR-V compiler (static library)                  : shaderc-shared found 
Checking for libshaderc SPIR-V compiler                                   : yes 
Checking for SPIRV-Cross SPIR-V shader converter (shared library)         : no ('spirv-cross-c-shared' not found) 
Checking for SPIRV-Cross SPIR-V shader converter (static library)         : no ('spirv-cross' not found) 
Checking for SPIRV-Cross SPIR-V shader converter                          : spirv-cross-shared not found 
Checking for Direct3D 11 video output                                     : win32-desktop not found 
Checking for Raspberry Pi support                                         : no ('brcmegl' not found) 
Checking for iOS OpenGL ES hardware decoding interop support              : no 
Checking for OpenGL without platform-specific code (e.g. for libmpv)      : libmpv-shared not found 
Checking for OpenGL context support                                       : yes 
Checking for libplacebo support                                           : no ('libplacebo >= 1.18.0' not found) 
Checking for Vulkan context support                                       : libplacebo not found 
Checking for VAAPI Vulkan                                                 : vulkan not found 
Checking for EGL helper functions                                         : yes 
Checking for libavcodec videotoolbox hwaccel                              : gl-cocoa not found 
Checking for Videotoolbox with OpenGL                                     : gl-cocoa not found 
Checking for D3D11VA hwaccel                                              : os-win32 not found 
Checking for DXVA2 hwaccel                                                : d3d-hwaccel not found 
Checking for OpenGL/DirectX Interop Backend DXVA2 interop                 : gl-dxinterop not found 
Checking for CUDA Headers and dynamic loader                              : no ('ffnvcodec >= 8.2.15.7' not found) 
Checking for CUDA hwaccel                                                 : ffnvcodec not found 
Checking for Raspberry Pi MMAL hwaccel                                    : rpi not found 
Checking for w32 executable                                               : os-win32 not found 
Checking for Apple Remote support                                         : cocoa not found 
Checking for macOS Touch Bar support                                      : cocoa not found 
Checking for macOS 10.11 SDK Features                                     : cocoa not found 
Checking for macOS 10.14 SDK Features                                     : cocoa not found 
Checking for macOS libmpv backend                                         : cocoa not found 
Writing configuration header:                                             : config.h 
'configure' finished successfully (3.032s)

And I really use sdl at buildtime (II remember correctly, configure fails when --enable-something is used, and not found)

Runtime ( 0.30 from master) messages gives exactly :+1:

$ mpv --log-file=testing_mpv_0.30_test2.txt --no-config   ~/Titres/AaRON_Lili.webm 
 (+) Video --vid=1 (*) (vp9 426x240 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[vo/sdl] Using opengl
AO: [pulse] 48000Hz stereo 2ch float
VO: [sdl] 426x240 yuv420p
AV: 00:00:00 / 00:04:01 (0%) A-V:  0.000

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 00:04:01 (0%) A-V: 52.565 Dropped: 6

testing_mpv_0.30_test2.txt

FYI, I'm testing the master since a long while, and this is the first time I got such issue, but there is maybe another reason, caused by mesa 19.3.0 + Intel GPU

ghost commented 4 years ago

Can reproduce, --input-gamepad=no fixes it.

ebachard commented 4 years ago

I just saw the template you put. Well, next time I won't spend my time to report issues.

ghost commented 4 years ago

I just saw the template you put. Well, next time I won't spend my time to report issues.

Now what the FUCK is this? Sometimes I really think we should close the issue tracker.