Unable to execute wiki-example

54 views
Skip to first unread message

Bernhard

unread,
Feb 18, 2009, 9:39:51 AM2/18/09
to gstreamer-java
Hi there,

after trying to play avi-files in java with VLC (unstable) and ffmpeg
(via FMJ and ffmpeg-java; not working, and / or outdated), I stumbled
across gstreamer.
As far as I can tell from the last commited source-changes, this
project is at least more active than the others (vlc for example, is
practically dead).

Anyways... I tried the VideoPlayer Tutorial from the wiki (http://
code.google.com/p/gstreamer-java/wiki/VideoPlayerTutorial) and
failed :/
First fail was, that the program couldn't locate the gstreamer-0.10-
library. I had the gstreamer package as well as base, good, bad and
ugly downloaded and so I altered my PATH in eclipse, that it would
point to the right directories. No luck. It always said, it couldn't
find the library.

Then, I tried to start the sample from command line, setting the PATH
manually. That actually worked. Yay!
But then, it failed at another point:
Exception in thread "main" java.lang.IllegalArgumentException: No such
Gstreamer factory: playbin
at org.gstreamer.ElementFactory.makeRawElement
(ElementFactory.java:172)
at org.gstreamer.Element.makeRawElement(Element.java:94)
at org.gstreamer.elements.PlayBin.<init>(PlayBin.java:244)
at VideoPlayer.main(VideoPlayer.java:19)

I now have no clue what to do.
Appearently, there are two problems:
1. JNA can't locate the libraries when started from eclipse (though
PATH is set)
2. There is a problem with the PlayBin-Factory.

I guess, the first problem doesn't concern you guys, and neither
concerns me, as long, as I get this thing running, but problem number
two should be of interest for you :)
Maybe someone could help me out, thank you.

Just in case, I'm posting the source of the VideoPlayer.java-sample
here:

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.File;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

import org.gstreamer.Gst;
import org.gstreamer.State;
import org.gstreamer.elements.PlayBin;
import org.gstreamer.swing.VideoComponent;

public class VideoPlayer {
public static void main(String[] args) {
args = Gst.init("VideoPlayer", args);
final PlayBin playbin = new PlayBin("VideoPlayer");
playbin.setInputFile(new File(args[0]));

SwingUtilities.invokeLater(new Runnable() {

public void run() {
VideoComponent videoComponent = new VideoComponent();
playbin.setVideoSink(videoComponent.getElement());

JFrame frame = new JFrame("VideoPlayer");
frame.getContentPane().add(videoComponent,
BorderLayout.CENTER);
frame.setPreferredSize(new Dimension(640, 480));
frame.setDefaultCloseOperation
(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
playbin.setState(State.PLAYING);
}
});
Gst.main();
playbin.setState(State.NULL);
}
}

Damian Sobieralski

unread,
Feb 18, 2009, 10:18:55 AM2/18/09
to gstream...@googlegroups.com
Bernhard,

 Which OS are you trying to run it with?  I've been running gstreamer-java with Ubuntu Hardy and now Intrepid with no problems. It "just works" :) I've also spawned it from Eclipse Ganymede and it works just fine. I don't doubt your problems i'm just letting you know what I have here.


From: Bernhard <bkas...@gmail.com>
To: gstreamer-java <gstream...@googlegroups.com>
Sent: Wednesday, February 18, 2009 9:39:51 AM
Subject: Unable to execute wiki-example

Bernhard

unread,
Feb 18, 2009, 10:33:51 AM2/18/09
to gstreamer-java
Thanks Damian, that indeed is a point I forgot to mention...

I'm using Windows Vista 32bit, Service Pack 1 on an Intel machine
JDK is either 1.6.0_03 or 1.5.0_12, I'm testing on both. Eclipse is
version 3.3.0
Gstreamer binaries are the latest windows-binaries from
http://gstreamer.freedesktop.org/pkg/windows/releases/ so they are all
0.10.7 except for bad, which is 0.10.6

Maybe there are any known issues with a combination like this?

On 18 Feb., 16:18, Damian Sobieralski <dsobi...@yahoo.com> wrote:
> Bernhard,
>
>  Which OS are you trying to run it with?  I've been running gstreamer-java with Ubuntu Hardy and now Intrepid with no problems. It "just works" :) I've also spawned it from Eclipse Ganymede and it works just fine. I don't doubt your problems i'm just letting you know what I have here.
>
> ________________________________
> From: Bernhard <bkast...@gmail.com>

Farkas Levente

unread,
Feb 18, 2009, 10:38:57 AM2/18/09
to gstream...@googlegroups.com

hi,
this's the req in the latest fedora packages:
Requires: java >= 1:1.6.0
Requires: jpackage-utils
Requires: jna
# versioned gstreamer required since earlier version don't have features
like:
# gst_caps_merge, gst_query_new_latency
Requires: gstreamer >= 0.10.19
Requires: gstreamer-plugins-base >= 0.10.19
Conflicts: gstreamer-plugins-good < 0.10.7
Conflicts: gstreamer-plugins-ugly < 0.10.7
Conflicts: gstreamer-plugins-bad < 0.10.6

BuildRequires: java-devel >= 1:1.6.0
BuildRequires: jpackage-utils
BuildRequires: jna
BuildRequires: libswt3-gtk2
BuildRequires: gstreamer-devel >= 0.10.19
BuildRequires: gstreamer-plugins-base-devel >= 0.10.19
BuildRequires: gstreamer-plugins-good-devel >= 0.10.7
#BuildRequires: gstreamer-plugins-ugly-devel >= 0.10.7
#BuildRequires: gstreamer-plugins-bad-devel >= 0.10.6
%if 0%{?fedora} >= 9
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: junit4
%endif
--
Levente "Si vis pacem para bellum!"

Damian Sobieralski

unread,
Feb 18, 2009, 10:43:48 AM2/18/09
to gstream...@googlegroups.com
From what I remember reading I know the Windows version of this is a bit tricky and then we add Vista on top of it.  Sorry that I cannot be much help. As I'm on Linux there's not much I can do to help troubleshoot with you :(


From: Bernhard <bkas...@gmail.com>
To: gstreamer-java <gstream...@googlegroups.com>
Sent: Wednesday, February 18, 2009 10:33:51 AM
Subject: Re: Unable to execute wiki-example

Bernhard

unread,
Feb 18, 2009, 10:47:53 AM2/18/09
to gstreamer-java
*grr* every good video-engine sucks under windows. it's a shame.
it's also a shame, that there is not "standard" solution for playing
media in java... :/

On 18 Feb., 16:43, Damian Sobieralski <dsobi...@yahoo.com> wrote:
> From what I remember reading I know the Windows version of this is a bit tricky and then we add Vista on top of it.  Sorry that I cannot be much help. As I'm on Linux there's not much I can do to help troubleshoot with you :(
>
> ________________________________
> From: Bernhard <bkast...@gmail.com>
> To: gstreamer-java <gstream...@googlegroups.com>
> Sent: Wednesday, February 18, 2009 10:33:51 AM
> Subject: Re: Unable to execute wiki-example
>
> Thanks Damian, that indeed is a point I forgot to mention...
>
> I'm using Windows Vista 32bit, Service Pack 1 on an Intel machine
> JDK is either 1.6.0_03 or 1.5.0_12, I'm testing on both. Eclipse is
> version 3.3.0
> Gstreamer binaries are the latest windows-binaries fromhttp://gstreamer.freedesktop.org/pkg/windows/releases/so they are all

Bernhard

unread,
Feb 18, 2009, 10:49:15 AM2/18/09
to gstreamer-java
Thanks Farkas,

it looks, as if I might require a newer version of the base-plugins.
Is there any way to get a precompiled package for windows? I
understand that there are hardly any up-to-date windows-builds, so
will I end up compiling it myself?
> >http://gstreamer.freedesktop.org/pkg/windows/releases/so they are all

Damian Sobieralski

unread,
Feb 18, 2009, 10:50:17 AM2/18/09
to gstream...@googlegroups.com
For what it is worth knowing, on Linux I'm successfully running it with gstreamer-good 10.10, bad 10.8 and ugly 10.9.


From: Damian Sobieralski <dsob...@yahoo.com>
To: gstream...@googlegroups.com
Sent: Wednesday, February 18, 2009 10:43:48 AM

Farkas Levente

unread,
Feb 18, 2009, 10:53:55 AM2/18/09
to gstream...@googlegroups.com
not now. may be in a few month when we finish the fedora cross compiler
support.

Bernhard

unread,
Feb 19, 2009, 9:12:06 AM2/19/09
to gstreamer-java
Oh my fuckin god... I wasted a whole day trying to compile gstreamer,
struggling with mingW, glib and all that dependency-crap for windows,
but it still fails and then, I stumble across the hint, that I should
set the GST_PLUGIN_PATH variable to solve the "No such GStreamer
factory"-exception and BAM! It worked. Well at least I don't fail with
the no-such-factory-exception.
Now it's a whole shitload of warning and errors, java.exe is throwing
at me:

set PATH=%PATH%;lib\gstreamer-0.10.17.win32\bin
set GST_PLUGIN_PATH=%PATH%
java -classpath .;lib\jna-3.0.4.jar;lib\gstreamer-java-bin-1.0.jar
VideoPlayer C:\test.avi

Error-Window pops up:
Runtime Error!
Program: C:\Windows\System32\java.exe

R6034
An application has made an attempt to load the C runtime library
incorrectly.
Please contact the application's support team for more information.

Then, on the console, it continues to load some dlls and fails.
Example-output:
** (java.exe:4840): WARNING **: Failed to load plugin 'C:\Windows
\system32/oobe/
winsetup.dll': Das angegebene Modul wurde nicht gefunden.
(translates to: The given modul was not found)

** (java.exe:4840): WARNING **: Failed to load plugin 'C:\Windows
\system32/pmspl
.dll': %1 ist keine zulässige Win32-Anwendung.
(translates to: %1 is not a valid Win32-application)

Last output: "DLL-initializing-routine has failed
Runtime error R6030
- CRT not initialized"

On google, you find various possible causes for those runtime errors
and nothing is really related with anything around gstreamer. Maybe
you guys have some insight on this and can help me out here?

Thanks

acolubri

unread,
Mar 5, 2009, 5:35:16 PM3/5/09
to gstreamer-java
Hey, you might want to give a try to these gstreamer installers for
windows that Andoni Morales and I are mantaining:

http://www.gstreamer-winbuild.ylatuya.es/doku.php?id=start

Development files are included, and the whole source of the project
(including the MSVC project files) are also available on svn.

I'm successfully using these binaries with gstreamer-java in my own
project.
Reply all
Reply to author
Forward
0 new messages