How To: Setup gstreamer-java on Windows

5,428 views
Skip to first unread message

LKaestner

unread,
Nov 16, 2010, 5:24:47 AM11/16/10
to gstreamer-java
Hello together,

I'm very happy with gstreamer-java running on Ubuntu (32/64-Bit), but
I just can't (but need to) get it working on Windows 32/64-Bit.
Could you help to establish a step-by-step guide on how to get gst-
java to work on windows?

What I've done so far:
* install Java JDK and JRE 1.6.22 (64-Bit) on Windows 7 (64-Bit)
* install GStreamerWinBuild-0.10.6 (http://www.gstreamer-
winbuild.ylatuya.es) and check environment variables
* create a new project in Eclipse 3.6 (Windows 64-Bit)
* add "jna-3.2.7.jar" and "gstreamer-java-1.4.jar" to classpath
* create new class "GstTest" with a main method that contains:
"Gst.init();"

When executing GstTest.main() an exception is thrown:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not
load library gstreamer-0.10
at org.gstreamer.lowlevel.GNative.loadWin32Library(GNative.java:83)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:43)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
at org.gstreamer.Gst.<clinit>(Gst.java:59)

How to get it work? Thanks in advance!

又鋼

unread,
Nov 16, 2010, 5:34:05 AM11/16/10
to gstream...@googlegroups.com

Your Eclipse need gstreamer-java library
in your project's Properties page -> Java Build Path
add gstreamer-java-1.4.jar jna.jar gstreamer-java-1.4.jar
and Gstreamer Path in windows

there are many different in windows
etc: tcpserversink / tcpclientsrc / encdoe decode Element / muxer 
see gst-inpect @@

2010/11/16 LKaestner <con...@lkaestner.de>

--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To post to this group, send email to gstream...@googlegroups.com.
To unsubscribe from this group, send email to gstreamer-jav...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gstreamer-java?hl=en.


LKaestner

unread,
Nov 16, 2010, 7:22:21 AM11/16/10
to gstreamer-java
Thanks for the quick reply. I had already added "gstreamer-
java-1.4.jar" and "jna.jar" to my build path.
You said, I should add the GStreamer-windows path to the java build
path.
I now added the path "C:\Program Files (x86)\OSSBuild\GStreamer
\v0.10.6\lib\gstreamer-0.10" as "External Class Folder" in Project
Properties but that didn't work either.
Any other suggestions?

又鋼

unread,
Nov 16, 2010, 7:41:06 AM11/16/10
to gstream...@googlegroups.com


my Path:
C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib

or Native javac command with classpath & library

2010/11/16 LKaestner <con...@lkaestner.de>

--

LKaestner

unread,
Nov 16, 2010, 8:38:01 AM11/16/10
to gstreamer-java
I just went to "Project Properties" -> "Java Build Path" ->
"Libraries" -> "Add External Class Folder"
and tried adding everything from "C:\Program Files (x86)\OSSBuild
\GStreamer\" to "C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\lib
\gstreamer-0.10" - without success.
Are you sure that adding the gstreamer-windows path is even necessary?
Shouldn't the path be automatically resolved by the Windows
environment variable (GST_PLUGIN_PATH) which is properly set? Is there
anything else to consider? Thanks!

Tal Shalif

unread,
Nov 16, 2010, 8:47:18 AM11/16/10
to gstream...@googlegroups.com

Add the location of the GStreamer. DLLs *and all dependencies* to your system PATH.

2010/11/16 22:38 "LKaestner" <con...@lkaestner.de>:

Dave Liu

unread,
Nov 16, 2010, 8:49:10 AM11/16/10
to gstreamer-java
> When executing GstTest.main() an exception is thrown:
>   Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not
> load library gstreamer-0.10
>         at org.gstreamer.lowlevel.GNative.loadWin32Library(GNative.java:83)
>         at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:43)
>         at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
>         at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
>         at org.gstreamer.Gst.<clinit>(Gst.java:59)

The UnsatisfiedLinkError means that the JRE cannot find the GStreamer
binary DLL files (unrelated to the Java class files). The simplest
options are:

(1) Add the -Djna.library.path=... VM option to your run profile in
Eclipse.

(2) Add "C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\lib
\gstreamer-0.10" and any other folders for dependent DLLs to the
system PATH (in Control Panel -> System -> Environment Variables) and
restart Eclipse.

NB: The "External Class Folder" option in Eclipse specifies additional
locations for Java class files (not DLLs).

LKaestner

unread,
Nov 16, 2010, 10:26:44 AM11/16/10
to gstreamer-java
I've adjusted various settings but JNA still persistently refuses to
find the library "gstreamer-0.10".

My PATH variable looks like this: (executed "PATH" in cmd.exe):
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows
\System32\WindowsPowerShell\v1.0\;C:\Environ
ment\Java\jdk6\bin;C:\Program Files (x86)\OSSBuild\GStreamer
\v0.10.6\lib\gstreamer-0.10;C:\Program Files (x86)\OSSBuild\GStreamer
\v0.10.6\lib;C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin

The method "org.gstreamer.lowlevel.GNative.loadNativeLibrary()" calls
"com.sun.jna.Native.loadLibrary()" which doesn't find the DLL.
I guess that it is trying to load "C:/Program Files (x86)/OSSBuild/
GStreamer/v0.10.6/bin/libgstreamer-0.10.dll".

Setting the JVM parameter -Djna.library.path= didn't solve the
problem, too.
Even messing around with something like:
com.sun.jna.NativeLibrary.addSearchPath("libgstreamer-0.10", "C:/
Program Files (x86)/OSSBuild/GStreamer/v0.10.6/");
didn't get me further.
Any other ideas? Thanks!

Dave Liu

unread,
Nov 16, 2010, 10:33:38 AM11/16/10
to gstreamer-java
> Setting the JVM parameter -Djna.library.path= didn't solve the
> problem, too.
> Even messing around with something like:
> com.sun.jna.NativeLibrary.addSearchPath("libgstreamer-0.10", "C:/
> Program Files (x86)/OSSBuild/GStreamer/v0.10.6/");
> didn't get me further.
> Any other ideas? Thanks!

I may be mistaken, but it looks like the GStreamer DLLs you are using
are 32-bit... are you trying to call GStreamer from a 64-bit JRE by
any chance?

One way to check is to call System.load() with the full path to
libgstreamer-0.10.dll and confirm that it can be loaded correctly. If
I recall correctly, 32-bit DLLs can't be loaded into a 64-bit process.

LKaestner

unread,
Nov 17, 2010, 4:00:33 AM11/17/10
to gstreamer-java
That's right, I'm running 64-Bit versions of Windows, Eclipse, JDK and
JRE
and: calling "System.load("C:/Program Files (x86)/OSSBuild/GStreamer/
v0.10.6/bin/libgstreamer-0.10.dll");" returns an exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:
\Environment\GStreamer\bin\libgstreamer-0.10.dll: Can't load IA 32-
bit .dll on a AMD 64-bit platform.

I guess I could solve this by using 64-Bit libraries, but the
OSSBuilds project doesn't provide any. (http://code.google.com/p/
ossbuild/downloads)
My Java application has to run on Windows 64-Bit systems with 64-Bit
JRE, so any suggestions how to proceed? Thanks!
BTW: If the 64-Bit issue really is the reason for the problem, maybe
someone could modify gstreamer-java to return more tangible error
messages for that case. :)

LKaestner

unread,
Nov 17, 2010, 3:44:34 PM11/17/10
to gstreamer-java
===== SOLUTION =====
I just received an email from gksam who sugested me to try the latest
GStreamer-OSSBuilds beta (0.10.7 Beta 2).
And hurray - as far as I can tell from the first tests, it actually
works. I can play various audio files with playbins and custom
pipelines.
Important thing is to use a 32-Bit JRE (specified in run
configuration). No additional commands, parameters or settings are
required.
Thanks everyone!

My current, working configuration is:
* Windows 7 (64-Bit)
* JDK 1.6.22 (64-Bit)
* JRE 1.6.22 (32-Bit)
* JNA 3.2.7
* GStreamer-Java 1.4
* GStreamer-WinBuilds 0.10.7 Beta 2 (32-Bit)

KbcSkype

unread,
Dec 20, 2010, 11:47:04 AM12/20/10
to gstreamer-java
I have same problem like yours, but its not 64-Bit. This is what i did
and could not yet ever worked it out.

Success part 1:
1. In linux Fedora 12, i took Gstreamer java wrapper and wrote my code
for pipe line its simple audio test and listen (loopback).

2. When i run the application in my linux box it just work like a
beast.

3. Then i convert it as JAVA Applet (As java applet is web browser
compatible and cross platform)

4. Still in Fedora 12 (java -jar mygst.jar works and applet works)

Fail part 1:

1. Now that avobe was working, i put my windows VMware with Windows XP
( which is 32 bit)

2. I now downloaded the jar files to that pc and also the web applet

3. Surprise --> It never works


Any suggestion ?

Thanks & Regards

Lucan1d

unread,
Sep 2, 2011, 5:46:14 AM9/2/11
to gstream...@googlegroups.com
I have a similar problem to this (i.e. exact same error) but this was
working until I upgraded to Java 7. I now have JDK 1.7.0 64-bit installed
and a 32-bit JDK and JRE but it doesn't work. I am running 32-bit Eclipse
Indigo and definitely running a SwingMultiPlayer with a 32-bit JDK/JRE. I
have also tried with GStreamer 0.10.7 and that also didn't help.

I am on Windows 7 64-bit (which I have been even when it was working with
Java 6). My system path is set correctly.

Is this a Java 7 issue?

Thanks,

-Luc

--

Andres Colubri

unread,
Sep 7, 2011, 10:17:12 AM9/7/11
to gstream...@googlegroups.com
I'd recommend uninstalling the 64 bits JDK, just in case gstreamer-java
is using it instead for some reason (the gstreamer dlls are 32 bits, so
they won't work in a 64 bits JVM anyways). If you still have problems,
then is probably good idea to stick to Java 6 for the time being.

Lucan1d

unread,
Sep 14, 2011, 12:49:13 AM9/14/11
to gstream...@googlegroups.com
Can anyone else confirm that this is indeed a Java 7 related issue? I just
can't get it to work :-(

Thanks,

-Luc

--

REX

unread,
Jun 17, 2016, 7:37:21 AM6/17/16
to gstreamer-java

help me with this thank you
 
Reply all
Reply to author
Forward
0 new messages