I seem to have a somewhat similar issue where ffplay by itself works with no issues but under RetroArch it is not so pretty. I would be very thankful for any pointers.
For me in RetroArch 1.10 ffmpeg just freezes after playing a second of any .mkv file (.mp4 files for instance play with no issues) all those .mkv files play just fine with ffplay from the terminal. The log shows:
[libretro ERROR] [FFMPEG] Thread: Video deadlock detected.
[libretro ERROR] [FFMPEG] Can’t decode video packet: Unknown error occurred
not very telling (at least for me) and I haven’t found much about that error.
If it is of any use here is the full log:
[INFO] RetroArch 1.10.0 (Git a14dcfa)
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 5 3600 6-Core Processor
[INFO] Capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Jan 20 2022
[INFO] Version: 1.10.0
[INFO] Git: a14dcfa
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Set video size to: fullscreen.
[ERROR] [Wayland]: Failed to connect to Wayland server.
[INFO] [GLX]: GLX_EXT_swap_control_tear supported.
[INFO] [GL]: Found GL context: "x".
[INFO] [GL]: Detecting screen resolution: 2560x1440.
[INFO] [GLX]: Window manager is KWin.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [GLX]: Using Xinerama on screen #0.
[INFO] [GLX]: X = 0, Y = 0, W = 2560, H = 1440.
[INFO] [GLX]: Using windowed fullscreen.
[INFO] [GLX]: Found swap function: glXSwapIntervalEXT.
[INFO] [GL]: Vendor: NVIDIA Corporation, Renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2.
[INFO] [GL]: Version: 4.6.0 NVIDIA 510.47.03.
[INFO] [GL]: Using ARB_sync to reduce latency.
[INFO] [GL]: Using resolution 2560x1440.
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Checking GLSL shader support ...
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [GL]: Using GL_RGB565 for texture uploads.
[INFO] [Joypad]: Found joypad driver: "sdl2".
[INFO] [Font]: Using font rendering backend: "freetype".
[INFO] [DBus]: Suspended screensaver via DBus.
[INFO] [Video]: Found display server: "x11".
[INFO] [PulseAudio]: Requested 24576 bytes buffer, got 18432.
[INFO] [Display]: Found display driver: "gl".
[INFO] [SRAM]: SRAM will not be saved.
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_music_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_video_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_image_history.lpl".
[INFO] [Playlist]: Loading favorites file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_favorites.lpl".
[INFO] [PulseAudio]: Pausing.
[INFO] [GLX]: Resized fullscreen resolution to 2560x1440.
[INFO] [Core]: Using content: "/media/username/drive/Video's folder/Video's Title.mkv".
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [XINERAMA]: Saved monitor #0.
[INFO] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.
[INFO] --libretro argument "builtin" is a built-in core. Ignoring.
[INFO] RetroArch 1.10.0 (Git a14dcfa)
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 5 3600 6-Core Processor
[INFO] Capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Jan 20 2022
[INFO] Version: 1.10.0
[INFO] Git: a14dcfa
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Environ]: SET_VARIABLES.
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Overrides]: Redirecting save file to "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/saves/Video's Title.srm".
[INFO] [Overrides]: Redirecting save state to "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/states/Video's Title.state".
[INFO] [Content]: Content loading skipped. Implementation will load it on its own.
[INFO] [Environ]: GET_VARIABLE: ffmpeg_temporal_interp = "disabled"
[INFO] [Environ]: GET_VARIABLE: ffmpeg_fft_resolution = "1280x720"
[INFO] [Environ]: GET_VARIABLE: ffmpeg_fft_multisample = "1x"
[INFO] [Environ]: GET_VARIABLE: ffmpeg_color_space = "auto"
[INFO] [Environ]: GET_VARIABLE: ffmpeg_hw_decoder = "auto"
[INFO] [Environ]: GET_VARIABLE: ffmpeg_sw_decoder_threads = "auto"
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[INFO] RetroPad, Port 1, Button "D-Pad Up" => "Seek +60 seconds"
[INFO] RetroPad, Port 1, Button "D-Pad Down" => "Seek -60 seconds"
[INFO] RetroPad, Port 1, Button "D-Pad Left" => "Seek -10 seconds"
[INFO] RetroPad, Port 1, Button "D-Pad Right" => "Seek +10 seconds"
[INFO] RetroPad, Port 1, Button "L" => "Cycle Audio Track"
[INFO] RetroPad, Port 1, Button "R" => "Cycle Subtitle Track"
[INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888.
[libretro INFO] [FFMPEG] libavformat version: 58.45.100
[libretro INFO] [FFMPEG] libavcodec version: 58.91.100
[libretro INFO] [FFMPEG] libavutil version: 56.51.100
[libretro INFO] [FFMPEG] libswresample version: 3.7.100
[libretro INFO] [FFMPEG] libswscale version: 5.7.100
[libretro INFO] [FFMPEG] Media information:
[libretro ERROR] [FFMPEG] Codec libopenh264 is not supported by HW video decoder vdpau.
[libretro ERROR] [FFMPEG] Codec libopenh264 is not supported by HW video decoder vaapi.
[libretro ERROR] [FFMPEG] Codec libopenh264 is not supported by HW video decoder vulkan.
[libretro INFO] [FFMPEG] Using SW decoding.
[libretro INFO] [FFMPEG] Configured software decoding threads: 12
[INFO] [Environ]: SET_HW_RENDER, context type: gl.
[INFO] Requesting OpenGL context.
[INFO] Reached end of SET_HW_RENDER.
[INFO] [SRAM]: Skipping SRAM load.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 24000.00 Hz.
[INFO] [Video]: Set video size to: fullscreen.
[INFO] [Video]: Using HW render, OpenGL driver forced.
[INFO] [Video]: Using configured "gl" driver for GL HW render.
[ERROR] [Wayland]: Failed to connect to Wayland server.
[libretro INFO] [FFMPEG] Configured worker threads: 4
[INFO] [GLX]: GLX_EXT_swap_control_tear supported.
[INFO] [GL]: Found GL context: "x".
[INFO] [GL]: Detecting screen resolution: 2560x1440.
[INFO] [GLX]: Window manager is KWin.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [GLX]: Using Xinerama on screen #0.
[INFO] [GLX]: X = 0, Y = 0, W = 2560, H = 1440.
[INFO] [GLX]: Using windowed fullscreen.
[INFO] [GLX]: Found swap function: glXSwapIntervalEXT.
[INFO] [GL]: Vendor: NVIDIA Corporation, Renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2.
[INFO] [GL]: Version: 4.6.0 NVIDIA 510.47.03.
[INFO] [GL]: Using ARB_sync to reduce latency.
[INFO] [GL]: Using resolution 2560x1440.
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shaders]: Specific shader preset found at "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/config/global.glslp".
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Checking GLSL shader support ...
[INFO] Watching file for changes: /app/share/libretro/shaders/shaders_glsl/crt/crt-mattias.glslp
[INFO] Watching file for changes: /app/share/libretro/shaders/shaders_glsl/crt/shaders/crt-mattias.glsl
[DEBUG] [Shaders]: Finding Parameters in Shader Passes (#pragma parameter)
[DEBUG] [Shaders]: Found #pragma parameter Curvature (CURVATURE) 0.500000 0.000000 1.000000 0.050000 in pass 0
[DEBUG] [Shaders]: Found #pragma parameter Scanline Crawl Speed (SCANSPEED) 1.000000 0.000000 10.000000 0.500000 in pass 0
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 1 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [GL]: Initializing HW render (512x512).
[INFO] [GL]: Max texture size: 32768 px, renderbuffer size: 32768 px.
[INFO] [GL]: Supports FBO (render-to-texture).
[INFO] [Joypad]: Found joypad driver: "sdl2".
[INFO] [Font]: Using font rendering backend: "freetype".
[INFO] [DBus]: Suspended screensaver via DBus.
[INFO] [Video]: Found display server: "x11".
[INFO] [PulseAudio]: Requested 24576 bytes buffer, got 18432.
[INFO] [Display]: Found display driver: "gl".
[INFO] [SRAM]: SRAM will not be saved.
[INFO] Watching file for changes: /app/share/libretro/shaders/shaders_glsl/crt/crt-mattias.glslp
[INFO] Watching file for changes: /app/share/libretro/shaders/shaders_glsl/crt/shaders/crt-mattias.glsl
[DEBUG] [Shaders]: Finding Parameters in Shader Passes (#pragma parameter)
[DEBUG] [Shaders]: Found #pragma parameter Curvature (CURVATURE) 0.500000 0.000000 1.000000 0.050000 in pass 0
[DEBUG] [Shaders]: Found #pragma parameter Scanline Crawl Speed (SCANSPEED) 1.000000 0.000000 10.000000 0.500000 in pass 0
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_music_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_video_history.lpl".
[INFO] [Playlist]: Loading history file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_image_history.lpl".
[INFO] [Playlist]: Loading favorites file: "/home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_favorites.lpl".
[INFO] [Playlist]: Written to playlist file: /home/username/.var/app/org.libretro.RetroArch/config/retroarch/content_video_history.lpl
[INFO] [GLX]: Resized fullscreen resolution to 2560x1440.
[libretro ERROR] [FFMPEG] Thread: Video deadlock detected.
[libretro ERROR] [FFMPEG] Thread: Video deadlock detected.
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred
[libretro ERROR] [FFMPEG] Can't decode video packet: Unknown error occurred