gstreamer on windows

1,515 views
Skip to first unread message

BzOne

unread,
Apr 2, 2010, 12:49:49 PM4/2/10
to gstreamer-java

I need to build java application that contains audio and video player,
this application should run on windows, i tried java-gstreamer on
ubuntu and it works fine, but i spent the hole day trying to install
gstreamer on windows, finally it works but some plugin are missing for
example i cant run any real media, so i was wondering if there a way
to package gstreamer on my application jar to avoid the tricky
installation of gstreamer.

Tal Shalif

unread,
Apr 2, 2010, 5:23:06 PM4/2/10
to gstream...@googlegroups.com
Once you have gstreamer win32 binaries that work well from the command line with all the required plugins for your needs: you can pack all the gstreamer DLLs in a Jar/Zip file and download it with your application, than unpack it onto the local drive and set the jna.library.path System property to point to that location (important: you must set jna.library.path *before* any use whatsoever of JNA by your application). You will also need to pass the --gst-plugin-path to Gst.init() to point to the location where you have extracted the plugin DLLs.



--
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.


Farkas Levente

unread,
Apr 2, 2010, 5:23:36 PM4/2/10
to gstream...@googlegroups.com

download it from here:
http://code.google.com/p/ossbuild/downloads/list
and you don't have to do any trick.

--
Levente "Si vis pacem para bellum!"

Abdel Rahman Barakat

unread,
Apr 2, 2010, 7:36:33 PM4/2/10
to gstream...@googlegroups.com
thx Tal and Levente for the fast response

I've tried the both solutions, and i realized that GStreamer was successfully installed and my problem was to use it in the java code, first i was facing this exception

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)
        at player.Main.main(Main.java:31)

but after setting jna.library.path this exception replaced by another one after alot of warnings like this one:

** (java.exe:1572): WARNING **: Failed to load plugin 'C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\gstreamer-0.10\libgstwinks.dll': `C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\gstreamer-0.10\libgstwinks.dll': The specified module could not be found.

all the pulgins that my program cannot load do exist in the same path that appears in the warning and this happens weather i passed the  --gst-plugin-path to Gst.init() or not and at the end of the warnings there an exception:

Exception in thread "main" java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
        at org.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:174)
        at org.gstreamer.Element.makeRawElement(Element.java:93)
        at org.gstreamer.elements.PlayBin.<init>(PlayBin.java:248)
        at player.Main.main(Main.java:32)

do I miss something ??

Tal Shalif

unread,
Apr 2, 2010, 8:21:18 PM4/2/10
to gstream...@googlegroups.com

It coould be a dependency DLL problem. Try setting yopur global system/user path to location of GStreamer DLLs to see either problem disappears.

On Apr 3, 2010 2:36 AM, "Abdel Rahman Barakat" <abdelrahm...@gmail.com> wrote:

thx Tal and Levente for the fast response

I've tried the both solutions, and i realized that GStreamer was successfully installed and my problem was to use it in the java code, first i was facing this exception

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)
        at player.Main.main(Main.java:31)

but after setting jna.library.path this exception replaced by another one after alot of warnings like this one:

** (java.exe:1572): WARNING **: Failed to load plugin 'C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\gstreamer-0.10\libgstwinks.dll': `C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\gstreamer-0.10\libgstwinks.dll': The specified module could not be found.

all the pulgins that my program cannot load do exist in the same path that appears in the warning and this happens weather i passed the  --gst-plugin-path to Gst.init() or not and at the end of the warnings there an exception:

Exception in thread "main" java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
        at org.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:174)
        at org.gstreamer.Element.makeRawElement(Element.java:93)
        at org.gstreamer.elements.PlayBin.<init>(PlayBin.java:248)
        at player.Main.main(Main.java:32)

do I miss something ??


On Fri, Apr 2, 2010 at 11:23 PM, Farkas Levente <lfa...@lfarkas.org> wrote:
>

> On 04/02/2010 06:4...

--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group...

DHoyt

unread,
Apr 2, 2010, 10:39:10 PM4/2/10
to gstreamer-java
I'm the OSSBuild maintainer -- this is actually being worked on as we
speak. If you check out OSSBuild source, build it in Visual Studio,
and then build all the Netbeans projects in <OSSBuild Home>/Main/
OSSBuild/Java/NativeResources/, you'll get a series of jars that you
can use to do what you're describing. When the next release is due
out, I'll be including the jars as well. We don't have an exact ETA,
though.

On Apr 2, 5:21 pm, Tal Shalif <tsha...@gmail.com> wrote:
> It coould be a dependency DLL problem. Try setting yopur global system/user
> path to location of GStreamer DLLs to see either problem disappears.
>
> On Apr 3, 2010 2:36 AM, "Abdel Rahman Barakat" <
>

Farkas Levente

unread,
Apr 3, 2010, 8:11:34 AM4/3/10
to gstream...@googlegroups.com
what kind of jar?
do you also build gstreamer-java along gstreamer for windows? and you
include it in the OSSBuild installer?

On 04/03/2010 04:39 AM, DHoyt wrote:
> I'm the OSSBuild maintainer -- this is actually being worked on as we
> speak. If you check out OSSBuild source, build it in Visual Studio,
> and then build all the Netbeans projects in<OSSBuild Home>/Main/
> OSSBuild/Java/NativeResources/, you'll get a series of jars that you
> can use to do what you're describing. When the next release is due
> out, I'll be including the jars as well. We don't have an exact ETA,
> though.
>
> On Apr 2, 5:21 pm, Tal Shalif<tsha...@gmail.com> wrote:

>> It coould be a dependency DLL problem. Try setting yopur ghe olobal system/user

Farkas Levente

unread,
Apr 3, 2010, 8:24:38 AM4/3/10
to gstream...@googlegroups.com
are you sure you delete all previous install? we also has this problems.
try to search for all ".gstreamer" directory and delete all of them.

> <mailto:gstream...@googlegroups.com>.


> To unsubscribe from this group, send email to
> gstreamer-jav...@googlegroups.com

> <mailto:gstreamer-java%2Bunsu...@googlegroups.com>.


> For more options, visit this group at
> http://groups.google.com/group/gstreamer-java?hl=en.
>
>
> --
> 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.

Abdel Rahman Barakat

unread,
Apr 3, 2010, 2:47:43 PM4/3/10
to gstream...@googlegroups.com
thank you all for the helpful information,

after re-installation and setting the Path and GST_PLUGIN_PATH it works, but i still cannot run real media i got this message every time i try to run rm video
** Message: don't know how to handle application/vnd.rn-realmedia

I've attached the output of gst-inspect

Abdelrahman Barakat
Software Engineer
Egypt Development Center (EDC)
gst-inspect-0.10-output

DHoyt

unread,
Apr 3, 2010, 5:15:41 PM4/3/10
to gstreamer-java
There are 2 sets. One set is a series of jars that contain native
resources such as dlls, configuration files, etc. and an embedded xml
file that describes how to extract and setup an environment to run an
uninstalled version of gstreamer or any of the available resources.
The jars can be used individually or together depending on your need.
There jars are (I call them native resource packages) for extracting
and loading libraries for opengl (e.g., it loads glew), xml (libxml2,
expat), glib, ffmpeg, etc. along with tracking and loading their
dependencies.

The other set is just a single merged jar of all the other jars.

Loading the native resources can be done in one line of code:

Sys.initialize();

You can also load individual packages by doing:

Sys.initializeRegistry();
Sys.loadNativeResource(NativeResource.Base);
Sys.loadNativeResource(NativeResource.GLib);
Sys.loadNativeResource(NativeResource.XML);
Sys.loadNativeResource(NativeResource.Fonts);
Sys.loadNativeResource(NativeResource.Images);
Sys.loadNativeResource(NativeResource.Graphics);
Sys.loadNativeResource(NativeResource.Crypto);
Sys.loadNativeResource(NativeResource.GStreamer);
Sys.initializeSystem();

Sys.initialize() is basically just a wrapper for all the above, but it
loads whatever native resource packages it finds in the classpath.

GStreamer-java is not included inside the jar or in the installer, but
it'd be easy enough to add it (and if you didn't mind it, it'd be nice
to have it included). The v1.3 binary jar is in the trunk and is
needed to properly compile and load the gstreamer resource package.
The gstreamer resource package is split into core, base, good, bad,
ugly, and ffmpeg jars. What's loaded depends on what's in your
classpath. The files are extracted to <Temp>/native_java_resources/.
But that can be customized if needed. If the files are already
extracted, they're skipped to speed up load time. If the jar file's
resource is newer than the existing extracted file, it's replaced.

There are GPL and LGPL versions of each set for both Windows and Linux
(other OSes will come as we have time to do them). Currently the Linux
version requires glibc v2.7 or greater. But that's its only
dependency.

I hope it's useful for the community.

Tal Shalif

unread,
Apr 3, 2010, 5:36:52 PM4/3/10
to gstream...@googlegroups.com
Is it possible to simplify what your application is trying to achieve into a command-line gstreamer pipeline (e.g 'gst-launch playbin uri=c:/path/to/my/file')? Once you have managed to run it successfully without using Java, try running exactly the same pipeline using Pipeline.launch(). If the first succeeds but the Pipeline.launch() doesn't, then there is probably still a DLL that can not be loaded for some reason.
Reply all
Reply to author
Forward
0 new messages