Gstreamer Library not Loading

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
darvin
Posts: 23
Joined: Mon Jan 02, 2023 8:41 pm

Gstreamer Library not Loading

Post by darvin »

Hello and a Happy New Year to you all!

I wanted to setup a new Delphi project for Windows 10 and show a gstreamer udp video with a TRVCamera and TRVCamView component. The gstreamer libs are installed and I could successfully start two cmd shells with a video source (usbcam) and a video sink (shows on Direct3D).

But in the Delphi project I was not able to load the libs. I tried:

Code: Select all

MRVGstreamer.LoadGStreamerLibraries('E:\gstreamer\1.0\msvc_x86\bin');
And then I checked:

Code: Select all

RVCamera1.GStreamerProperty.UseGStreamer := True;
if MRVGstreamer.IsSupportedGStreamer then Label2.Caption := 'yes' else Label2.Caption := 'no';
But the result is always FALSE no matter what path/subpath I try.

Could it be a wrong version. Currently I use gstreamer 1.0 for 32bit.

Any ideas? Your suggestions are highly appreciated.
Thank you very much!
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Gstreamer Library not Loading

Post by Sergey Tkachenko »

Is your project 32-bit too?
darvin
Posts: 23
Joined: Mon Jan 02, 2023 8:41 pm

Re: Gstreamer Library not Loading

Post by darvin »

Yes, of course.

I started a new application - the IDE header shows "Windows 32bit" (also target platform)
I installed Gstreamer 1.0 and development Tools (msvc-x86-1.20.5) with installation root path: E:\gstreamer\1.0\msvc_x86

I assume that the response to "MRVGstreamer.IsSupportedGStreamer" must be True..
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Gstreamer Library not Loading

Post by Sergey Tkachenko »

I downloaded the new version of GStreamer and tested it. Well, I can see several problems.

1) Make sure that you have installed "runtime installer"; "development installer" cannot be used by RVMedia.
"bin" folder must contain *.dll files.
(of course, it's ok to install them both)

2) By default, RVMedia searches for GStreamer libraries from environment variables.
But names of these variables were changed. RVMedia assumes 'GSTREAMER_1_0_ROOT_X86', but new installers create 'GSTREAMER_1_0_ROOT_MSVC_X86' or 'GSTREAMER_1_0_ROOT_MINGW_X86'.
But even without processing these variables, RVMedia can load GStreamer libraries if their path is specified in 'PATH' variable, or, as in your example, the path is specified directly.
But...

3) RVMedia assumes that all DLL files have 'lib' prefix, such as 'libgstreamer-1.0-0.dll'. This is still correct for MinGW version, but not for MSVC version: it does not have prefixes, so file names are like 'gstreamer-1.0-0.dll'. RVMedia cannot find such files.

Workarounds:

Option 1: use MinGW version instead of MSVC version

Option 2: if you use a full source code version of RVMedia, you can modify the following constants in MRVGStreamer.pas (or fmxMRVGStreamer.pas for FireMonkey version):

Code: Select all

  libGSTTest_name = 'libgstreamer-';
  libGTest_name   = 'libglib-';

  libGObject_name = 'libgobject-';
  libGLib_name    = 'libglib-';
Remove 'lib' from the beginnings of these strings.

Option 3: If you use the full source code version of RVMedia, you can request an updated MRVGStreamer.pas / fmxMRVGStreamer.pas from me. I've modified it to support new environment variables and both MSVC and MinGW versions.
darvin
Posts: 23
Joined: Mon Jan 02, 2023 8:41 pm

Re: Gstreamer Library not Loading

Post by darvin »

Thank you very much for your advice!

1. Completely removed the gstreamer stuff
2. Downloaded the current version of Gstreamer: MinGW 32-bit 1.20.5 runtime installer
3. Reinstalled the gstreamer stuff
4. Check the bin subdirectory: all DLL files have the "lib"-prefix
5. Start a new Delphi project
6. Drop TRVCamera and TButton
7. Set the LoadGStreamerLibraries to the bin-directory 'E:\gstreamer\1.0\mingw_x86\bin'
8. Test the lib loading..

And it works!! Perfect!
Post Reply