GStreamer Issue: uridecodebin Failure in Release Build of Rust Application

This is a follow-up to the discussion at Uridecodebin fails in Tauri app release build, works in dev mode.

I’m developing a Rust application using Tauri, gstreamer-rs, CUDA, and ONNX Runtime. The application functions flawlessly in development mode (npm run tauri dev), and the release build created by npm tauri build also works correctly. However, an issue arises specifically with the release build. When I use npm tauri build, it produces a single ui.exe file that works fine on its own. The problem occurs when I place the GStreamer DLLs in the same directory as this ui.exe. In this scenario, the application fails with the error “Couldn’t create ‘uridecodebin’ element”. This step of adding GStreamer DLLs alongside the executable is necessary for deployment on client computers that don’t have GStreamer installed system-wide. I need to understand why this causes the application to fail and how to properly package GStreamer with my Tauri application for successful client deployment. This error occurs in a specific part of the app (when video analytics comes into play, meaning other parts of the app are working correctly)

win11
gst-launch-1.0 --gst-version
GStreamer Core Library version 1.24.6

Relevant environment variables are set:

  • C:\gstreamer\1.0\msvc_x86_64\bin
  • C:\gstreamer\1.0\msvc_x86_64\lib
  • C:\gstreamer\1.0\x86_64\include
  • GSTREAMER_1_0_ROOT_MSVC_X86_64 = C:\gstreamer\1.0\msvc_x86_64\
  • PKG_CONFIG_PATH includes: C:\gstreamer\1.0\msvc_x86_64\lib\pkgconfig

I’ve used the Dependencies tool to analyze my executable, and found no apparent issues
I’ve copied all the following DLLs to the same folder as my executable:
C:\gstreamer\1.0\msvc_x86_64\bin\ffi-7.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gio-2.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\glib-2.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gmodule-2.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gobject-2.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstapp-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstaudio-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstbase-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstpbutils-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstreamer-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gsttag-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\gstvideo-1.0-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\intl-8.dll
C:\gstreamer\1.0\msvc_x86_64\bin\orc-0.4-0.dll
C:\gstreamer\1.0\msvc_x86_64\bin\z-1.dll

In the process monitor, I see these files can’t be found (in debug mode, even though the app runs correctly):
target\debug\gstrtp-1.0-0.dll
target\debug\gstriff-1.0-0.dll
target\debug\gstcodecparsers-1.0-0.dll
target\debug\gstd3d11-1.0-0.dll
target\debug\gstdxva-1.0-0.dll
C:\Windows\System32\gstcodecs-1.0-0.dll

gst-inspect-1.0
I can see:

playback: decodebin: Decoder Bin
playback: decodebin3: Decoder Bin 3
playback: parsebin: Parse Bin
playback: playbin: Player Bin 2
playback: playbin3: Player Bin 3
playback: playsink: Player Sink
playback: streamsynchronizer: Stream Synchronizer
playback: subtitleoverlay: Subtitle Overlay
playback: uridecodebin: URI Decoder
playback: uridecodebin3: URI Decoder
playback: urisourcebin: URI reader

gst-launch-1.0 uridecodebin ! fakesink
I can see those are runs without any error.

  • What could be causing uridecodebin to fail in the release build but work in development mode, given that GStreamer is functioning correctly at the system level?
  • Could this be related to how the release build is linking or loading GStreamer libraries?
  • What should I check or modify in my build process to resolve this issue?
  • Are there any additional debugging steps or information I should gather to help diagnose this issue?
  • Is there an ideal way to detect which specific files are missing or causing the issue, considering that the error appears dynamically in certain areas of my application?

Regards.

I fixed the problem by using a process monitor to determine a dll file that was used on the interesting location in the GStreamer. I copied and pasted it and its fixed.

Which DLL was missing and had to be copied from where?

C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0

On here, I copied and pasted all the files because this problem was exhausting me (My reason for doing this is to evaluate the possibility that there is another file in the process monitor that I have overlooked because I have an ADHD problem :frowning: ).
I forgot exactly which DLL file it was, sorry. I just didn’t expect it would look for such a DLL file in this exact location :frowning:

But if you think this could be important, I can look at it again on the process monitor and tell you which exactly DLL files that used on the “C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0:slight_smile:

1 Like