开发者

gstreamer video streaming

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.

  1. Create a new project
  2. Download gstreamer-java-1.4.jar and jna-3.2.4.jar
  3. Add jna and jar files to library of the created NetBeans Project
  4. 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"
  5. 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".

  6. You may have to reboot
  7. Run and Enjoy Gstreamer!
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜