I have executed AudioPlayer.java example posted by open source community link
Audio Player Tutorial
I got the following exception
Exception in thread "main" java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
at org.gstrea开发者_如何学Pythonmer.ElementFactory.makeRawElement(ElementFactory.java:180)
at org.gstreamer.Element.makeRawElement(Element.java:92)
at org.gstreamer.elements.PlayBin.<init>(PlayBin.java:119)
at org.gstreamer.example.AudioPlayer.main(AudioPlayer.java:56)
Can anyone give me the solution for this problem?
Thanks in advance.
You need change
PlayBin playbin = new PlayBin("AudioPlayer");
for
PlayBin2 playbin = new PlayBin2("AudioPlayer");
with the version 1.5
This is due to path variables being not set correctly.
If you are using NetBeans 6.9+ then follow these steps
Note: I am assuming that you are working in Windows XP/Vista/7, etc.
- Create a new project
- Download gstreamer-java-1.4.jar and jna-3.2.4.jar
- Add jna and jar files to library of the created NetBeans Project
- Download GStreamer-WinBuilds-GPL-x86.msi from the following OSS website http://code.google.com/p/ossbuild/ For commercial use their LGPL version. Make sure your environmental variable with prefix OSS_ is set in the environmental variables in Windows. You can access this by right clicking "My Computer" -> "Advanced"
In NetBeans Right click "project" -> "properties". Go to "VM Options" in "run" type
-Djna.library.path="[your gstream OSS build classpath1 to bin]:[your gstream OSS build classpath2 to lib]"
Similarly you may need to provide classpath to java here too
-Djava.library.path="[your gstream OSS build classpath1 to bin]:[your gstream OSS build classpath2 to lib]"
Note: You must know where your OSS gstreamer dlls are installed. Typically under "OSSbuild" directory in "Program Files".
- You may have to reboot
- Run and Enjoy Gstreamer!
精彩评论