anubhav94 / gstreamer-java Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/gstreamer-java
Automatically exported from code.google.com/p/gstreamer-java
Hi All
I am new to gstreamer and i have written a pipeline that is supposed to
stream video from a v4l2src using RTP but it looks like no packets are not
actually leaving the pipeline.I have checked using wireshark but no packets
are captured. I can display the feed from the camera so i think it has
nothing to do with the source.Below is my code
public class RTPServer
{
private Pipeline pipeline;
private Pipeline pipe;
private Element videosrc;
private Element videosrc1;
private Element videofilter;
private Element videofilter1;
private Element videoencoder;
private Element videopayloader;
private Element videosink;
private Element rtpbin;
private Element rtpsink;
private Element rtcpsink;
private Element rtcpsrc;
private Pad srcpad;
private Pad sinkpad;
public RTPServer(String[] args)
{
Gst.init("RTPSendPipeline",args);
//Pipeline to hold everything
pipeline = new Pipeline("RTPSendPipeline");
//the video capture and format conversion
videosrc = ElementFactory.make("v4l2src","source");
//videofilter = ElementFactory.make("capsfilter","flt");
//encoding and payloading
videoencoder = ElementFactory.make("ffenc_h263", "h263encoder");
videopayloader = ElementFactory.make("rtph263ppay", "h263payloader");
//add capture and payloading to the pipeline
pipeline.addMany(videosrc,videoencoder,videopayloader,null);
Element.linkMany(videosrc,videoencoder,videopayloader, null);
//System.out.println("ghis");
//the rtpbin element
rtpbin = ElementFactory.make("gstrtpbin", "rtpbin");
pipeline.add(rtpbin);
//the udp sinks and source that we will use for RTP and RTCP
rtpsink = ElementFactory.make("udpsink","rtpsink");
rtpsink.set("host","127.0.0.1");
rtpsink.set("port","5002");
rtcpsink = ElementFactory.make("udpsink","rtcpsink");
rtcpsink.set("host","127.0.0.1");
rtcpsink.set("port","5003");
//no need for synchronisation or prerollon the RTCP sink
rtcpsink.set("async","FALSE");
rtcpsink.set("sync","FALSE");
rtcpsrc = ElementFactory.make("udpsrc","rtcpsrc");
rtcpsrc.set("port","5007");
pipeline.addMany(rtpsink,rtcpsink,rtcpsrc,null);
//now link all to the rtpbin, start by getting an RTP sinkpad for
session 0
sinkpad = rtpbin.getRequestPad("send_rtp_sink_0");
srcpad = videopayloader.getStaticPad("src");
srcpad.link(sinkpad);
System.out.println(sinkpad.toString());
System.out.println(srcpad.toString());
//System.out.println(srcpad.isLinked());
System.out.println();
//get the RTP srcpad that was created when we requested the sinkpad
above and link
//it to the rtpsink sinkpad
srcpad = rtpbin.getStaticPad("send_rtp_src_0");
sinkpad = rtpsink.getStaticPad("sink");
srcpad.link(sinkpad);
System.out.println(sinkpad.toString());
System.out.println(srcpad.toString());
System.out.println();
//get an RTCP srcpad for sending RTCP to the receiver
srcpad = rtpbin.getRequestPad("send_rtcp_src_0");
sinkpad = rtcpsink.getStaticPad("sink");
srcpad.link(sinkpad);
System.out.println(sinkpad.toString());
System.out.println(srcpad.toString());
System.out.println();
//we also want to receive RTCP, request and RTCP sinkpad for
session 0 and link
//it to the srcpad of the udpsrc for RTCP
srcpad = rtcpsrc.getStaticPad("src");
sinkpad = rtpbin.getRequestPad("recv_rtcp_sink_0");
srcpad.link(sinkpad);
System.out.println(sinkpad.toString());
System.out.println(srcpad.toString());
/*we want to see what we are sending across
pipe = new Pipeline("What we are sending");
videosrc1 = ElementFactory.make("v4l2src","source");
videofilter1 = ElementFactory.make("capsfilter","flt");
videofilter1.setCaps(Caps.fromString("video/x-raw-yuv, width=640,
height=480" + ", bpp=32, depth=32, framerate=25/1"));
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
// This gives a window with the stream from webcam
Element videosink = ElementFactory.make("xvimagesink", "sink");
pipe.addMany(videosrc1, videofilter1, videosink);
Element.linkMany(videosrc1, videofilter1, videosink);
// Start the pipeline processing
pipe.setState(State.PLAYING);
}
});*/
//set pipeline to playing state
pipeline.setState(State.PLAYING);
//pipeline.play();
Gst.main();
pipeline.setState(State.NULL);
//pipeline.stop();
//print stats every second
//System.out.println("finished");
}
public static void main(String[] args)
{
new RTPServer(args);
}
}
I am using ubuntu karmic koala, gstreamer-java-1.3.jar and jna-3.2.5.jar
Original issue reported on code.google.com by [email protected]
on 1 Jun 2010 at 1:35
I recently updated to revision 88 from the trunk. There a couple of types
from com.sun.jna that could not be found (ToNativeConverter,
FromNativeConverter, FromNativeContext, ...). I could get rid of some
errors with the newest release on jna.dev.java.net, but not all. It seems
that you switched to some local jna version: ../jnalib-v3/build/jna.jar as
defined in nbproject/project.properties. Shouldn't the jna.jar in the lib
folder be the right one?
Original issue reported on code.google.com by [email protected]
on 13 Jul 2007 at 8:46
Pls expose gstreamer-java in a Maven repo, public or private.
Original issue reported on code.google.com by [email protected]
on 20 Nov 2009 at 9:49
If you start a player with the player panel component not visible it shows
this error.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
org.gstreamer.swing.VideoComponent.renderVolatileImage(VideoComponent.java:355)
at org.gstreamer.swing.VideoComponent.access$1600(VideoComponent.java:58)
at org.gstreamer.swing.VideoComponent$7.run(VideoComponent.java:398)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273
)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Original issue reported on code.google.com by [email protected]
on 4 Apr 2008 at 12:55
Tuner.getNormList() is calling gst_tuner_list_channels instead of
gst_tuner_list_norms.
Patch attached.
Original issue reported on code.google.com by [email protected]
on 10 Mar 2010 at 3:32
Attachments:
To reproduce : simply read a file with a "%" in the name with the PlayBin class
The file is simply ignored.
I am using gstreamer-java 0.5, but I've tried with the head revision.
Original issue reported on code.google.com by [email protected]
on 21 Jan 2008 at 8:06
The method getPointer() was added to GObject, which allows to retrieve
arbitrary properties from a GObject. This works by calling the function
g_object_get through JNA:
PointerByReference refPtr = new PointerByReference();
gobj.g_object_get(this, property, refPtr, null);
However, the value pointer returned by refPtr.getValue() is always null.
Original issue reported on code.google.com by [email protected]
on 25 May 2009 at 9:59
** What steps will reproduce the problem?
Trying this code :
pipe2 = new Pipeline("Pipeline that must work");
String srcPath = "/home/rom1dep/Musique/01.flac";
System.out.println(new File(srcPath).exists());
→Prints TRUE
Element p2audiosource = ElementFactory.make("filesrc", "file in");
p2audiosource.set("location", srcPath);
@CASE 1 : Uncomment this ↓
//final Element p2decoder = new DecodeBin("decoder");
@CASE 2 : Uncomment this ↓
//final Element p2decoder = ElementFactory.make("decodebin",
"decoder");
@CASE 3 : Uncomment this ↓
//final Element p2decoder = ElementFactory.make("flacdec",
"decoder");
p2equalizer = ElementFactory.make("equalizer-10bands", "10b
equalizer");
Element p2audiosink = ElementFactory.make("pulsesink", "PA
output");
pipe2.addMany(p2audiosource, p2decoder, p2equalizer, p2audiosink);
pipe2.linkMany(p2audiosource, p2decoder, p2equalizer, p2audiosink);
new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(1000);
System.out.println(p2decoder.getState());
→Prints PAUSED in both cases 1 and 2, but PLAYING in case 3
} catch (InterruptedException e) {
}
}
}).start();
pipe2.play();
**What is the expected output? What do you see instead?
Expected output is sound + pipeline state=PLAYING in each case :
[rom1dep@NetSam ~]$ gst-launch-0.10 filesrc
location=/home/rom1dep/Musique/01.flac ! decodebin ! pulsesink
works well.
Instead, the flac file is played only when p2decoder is manually set as an
instance of flacdec (case 3), so, the decodebin implementation within gst-
java is inefficient.
**What version of the product are you using? On what operating system?
GStreamer version +OS :
[rom1dep@NetSam ~]$ gst-inspect-0.10 --version
gst-inspect-0.10 version 0.10.25
GStreamer 0.10.25
http://www.mandriva.com/
Binding version:
[rom1dep@NetSam gstreamer]$ ls
gstreamer-java-1.3.jar gstreamer-java-src-1.3.zip
gstreamer-java-doc-1.3.zip jna-3.2.4.jar
**Please provide any additional information below.
Just hope for the bug report to be understandable...
Original issue reported on code.google.com by rom1dep
on 25 Feb 2010 at 11:49
It would be nice to to have the various code analysers generate less
warnings (or no warnings at all) when building the code inside
eclipse/netbeans (I use eclipse, sometimes netbeans).
Original issue reported on code.google.com by [email protected]
on 28 Aug 2008 at 12:14
When using the GTK look and feel (jdk1.6 or 1.7) with SwingPlayer, I get a
Xlib: unexpected async reply (sequence 0xc1)!
(with varying sequence codes) dumped to the command line. The app freezes
immediately, the frame does not open. When I remove the GMainLoop.run()
invokation, it works but starts consuming more and more memory.
I use the proprietary ATI drivers, I don't know if that matters.
Original issue reported on code.google.com by [email protected]
on 23 May 2007 at 2:12
What steps will reproduce the problem?
1. Take the sample program from
http://code.google.com/p/gstreamer-java/wiki/VideoTestTutorial
2. Compile & run it
What is the expected output? What do you see instead?
- Expected: Video test image
- Get:
--------8<--------
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:48)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:45)
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 test.gstreamer.GStreamerTest.main(GStreamerTest.java:25)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError:
Can't load library: /usr/lib/jna/libjnidispatch.so
at com.sun.jna.Native.loadNativeLibrary(Native.java:644)
at com.sun.jna.Native.<clinit>(Native.java:108)
... 6 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library:
/usr/lib/jna/libjnidispatch.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1657)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.sun.jna.Native.loadNativeLibrary(Native.java:640)
... 7 more
--------8<--------
What version of the product are you using? On what operating system?
gstreamer-java Vers. 1.3
java -version says:
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
OS is an up-to-date Debian Sid
Please provide any additional information below.
When using gstreamer-java Vers. 1.1, the program works as expected.
Original issue reported on code.google.com by [email protected]
on 5 Jan 2010 at 7:45
What steps will reproduce the problem?
1.install GStreamerWinBuild-0.10.6.exe
2.open eclipse
3.add gstreamer-java-1.3.jar AND jna-3.2.4.jar to classpath
4.test the VideoPlayer example with movie path
this is the output i see :
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:38)
at org.gstreamer.lowlevel.GstAPI.<clinit>(GstAPI.java:33)
at org.gstreamer.Gst.init(Gst.java:213)
at gstreamer.VideoPlayer.main(VideoPlayer.java:27)
i tryed to play a video with gstreamer on my system and its working
(gst-launch.exe playbin
uri="file:///D:/blender/books/EnvMapMirroring-XviD.avi")
i am using gstreamer 0.10.6 and gstreamer-java 1.3
i am using windows 7 64bit
have jdk1.6.0_18 (32bit)
and eclipse 32bit
thank you
Original issue reported on code.google.com by [email protected]
on 20 May 2010 at 7:07
I've tried creating a sink by extending CustomSink, but the constructor
always throws an exception:
java.lang.IllegalArgumentException: Invalid native pointer
at org.gstreamer.lowlevel.NativeObject.initializer(NativeObject.java:70)
at org.gstreamer.GstObject.initializer(GstObject.java:65)
at org.gstreamer.elements.CustomSink.<init>(CustomSink.java:75)
GLib-GObject-WARNING **: specified instance size for type `SubtitleSink' is
smaller than the parent type's `GstBaseSink' instance size
GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT
(object_type)' failed
The size of GstBaseSinkStruct is not correct, the attached patch seems to
fix this.
I'm using 32 bit Windows XP and gstreamer 0.10.27.
Original issue reported on code.google.com by [email protected]
on 2 May 2010 at 6:56
Attachments:
Hi.
First of all, thanks for that excellent work !
I have faced and resolved an issue, using swing VideoComponent. That
component uses a sync'ed fakesrc, with a max latency of 20ms.
In fact, gstreamer C source code states that gst_base_sink_set_max_lateness
uses a max_lateness in nanoseconds. But BaseSink java class converts time
into milliseconds.
Setting 20ms of latency in gstreamer-java results in setting 20 nanoseconds
of latency in gstreamer library - and that latency is drammatically too short !
In class org.gstreamer.elements.BaseSink, please, replace the following
methods:
public void setMaximumLateness(long lateness, TimeUnit units) {
gst().gst_base_sink_set_max_lateness(this, units.toMillis(lateness));
}
public long getMaximumLateness(TimeUnit units) {
return units.convert(gst().gst_base_sink_get_max_lateness(this),
TimeUnit.MILLISECONDS);
}
with these methods:
public void setMaximumLateness(long lateness, TimeUnit units) {
gst().gst_base_sink_set_max_lateness(this, units.toNanos(lateness));
}
public long getMaximumLateness(TimeUnit units) {
return units.convert(gst().gst_base_sink_get_max_lateness(this),
TimeUnit.NANOSECONDS);
}
Thanks again for this work.
Regards, Sylvain RIBEYRON.
Original issue reported on code.google.com by [email protected]
on 30 Apr 2010 at 4:37
I'm writing an application that uses the Tuner interface.
I would like to let the user configure Norm and Channel.
There is currently methods to get Norm and Channel by name, but there is no
way to get a list of available Norms and Channels to display in a combobox.
I'm posting attached a small patch to implement this.
Original issue reported on code.google.com by [email protected]
on 10 Mar 2010 at 3:52
Attachments:
The "colorbalance" interface needs to be wrapped in gstreamer-java
Use src/org/gstreamer/interfaces/Mixer.java as a template on how to do it.
Original issue reported on code.google.com by [email protected]
on 27 Apr 2008 at 5:17
GStreamer source elements can have the following functions:
static void gst_ks_video_src_probe_interface_init (GstPropertyProbeInterface *
iface);
static const GList *gst_ks_video_src_probe_get_properties (GstPropertyProbe *
probe);
static GValueArray *gst_ks_video_src_probe_get_values (GstPropertyProbe *
probe, guint prop_id, const GParamSpec * pspec);
static GValueArray *gst_ks_video_src_get_device_name_values (GstDshowVideoSrc *
src);
static gboolean gst_ks_video_src_probe_needs_probe (GstPropertyProbe * probe,
guint prop_id, const GParamSpec * pspec);
static void gst_ks_video_src_probe_probe_property (GstPropertyProbe * probe,
guint prop_id, const GParamSpec * pspec);
to return a list of available source devices available on the system.
It would be very useful to add support for these functions inside
gstreamer-java.
Original issue reported on code.google.com by [email protected]
on 13 Dec 2008 at 11:45
What steps will reproduce the problem?
1. Build a gstreamer-java based applet
2. The applet calls Gst.init(), if Gst is not yet initialized, from inside
applet's init()
3. Destroy applet (e.g. by setting applet element style to display: none or
reloading/closing page)
What is the expected output? What do you see instead?
----------------------------------------------------
After any Gst based applet is destroyed, other Gst based applets stop
functioning. IllegalMonitorStateException is thrown from a generic Java
class without the stack trace pointing to any gstreamer-java specific code.
What version of the product are you using? On what operating system?
-------------------------------------------------------------------
gstreamer-java 0.7, native gstreamer core 0.10.17.
Please provide any additional information below.
------------------------------------------------
I think the problem is a side effect of the Java applet life-cycle
mechanism: When an applet is destroyed, any threads belonging the it's
AppletThreadGroup are interrupted then killed (remember this Thread.stop()
method we were told to never, never use?). This is how executor threads
never meant to die inside Gst.java are also thusly terminated rendering Gst
unusable.
Fix/Work arround:
----------------
Changing code in Gst.java to attach executor threads to main thread group
instead of applet's thread group seems to solve the problem (see patch)
Original issue reported on code.google.com by [email protected]
on 24 Jun 2008 at 12:01
Attachments:
What steps will reproduce the problem?
With the sample code below:
PlayBin playBin = new PlayBin("Test");
playBin.setVideoSink(ElementFactory.make("fakesink", "videosink"));
playBin.setInputFile(new File("D:\\01-¿ Exorde Baratté _.ogg"));
playBin.play();
What is the expected output? What do you see instead?
Bus.ERROR() reports "Could not open file "D:\01-¿ Exorde Baratté _.ogg" for
reading.". No audio playback.
Have you tried to verify this is a gstreamer-java specific issue, and not a
problem with the gstreamer framework itself?
Others applications using GStreamer are able to read the file.
What version of the product are you using? On what operating system?
GStreamer 0.10.28 on Windows XP SP2. Under Linux, the same file plays fine
with the above sample code.
Please provide any additional information below.
I was able to play this file with the following code :
String encodedFileName = URLEncoder.encode("D:\\01-¿ Exorde Baratté _.ogg",
"UTF-8");
encodedFileName = encodedFileName.replaceAll("\\+", "%20");
playBin.set("uri", "file:///" + encodedFileName);
URLEncoder.encode() encodes specials chars and changes spaces to "+". At
this point, Bus.ERROR() would report "Resource not found.". Changing the
"+" to "%20" does the trick and allow playback.
Original issue reported on code.google.com by [email protected]
on 18 May 2010 at 11:35
In the GstIterator.java file in line 63 It gives me the following
compilation error:
The method objectFor(Pointer, Class, boolean) is ambiguous for the type
GstObject gstreamer-java/src/org/gstreamer GstIterator.java line 63
If I comment the call as I show below everything seems to work.
private T getNext() {
PointerByReference nextRef = new PointerByReference();
if (gst.gst_iterator_next(handle(), nextRef) == 1) {
// if (GstObject.class.isAssignableFrom(objectType)) {
// return (T) GstObject.objectFor(nextRef.getValue(),
objectType, false);
// } else {
return (T) NativeObject.objectFor(nextRef.getValue(),
objectType, false);
// }
}
return null;
}
Original issue reported on code.google.com by [email protected]
on 20 Aug 2007 at 11:57
ValueList needs support for getting float values. This is useful for gstreamer
plugins such as 'spectrum' where magnitude values are returned as floats.
Attached is patch enabling support for float values.
Original issue reported on code.google.com by [email protected]
on 18 Jul 2010 at 10:28
Attachments:
What steps will reproduce the problem?
1. go to
> http://gstreamer-java.googlecode.com/svn/trunk/javadoc/1.0/index.html
2. see the 404
3. fiddle with the URL and try
> http://gstreamer-java.googlecode.com/svn/trunk/javadoc/1.3/index.html
4. see the content-type not correctly set so the browser shows the html source
instead of rendering a nice JavaDoc
What is the expected output? What do you see instead?
Have a working JavaDoc link.
Thanks,
-Matthias
Original issue reported on code.google.com by [email protected]
on 6 Jul 2010 at 1:17
gstreamer has support for saving and loading elements, bins, and pipelines.
Would like to see this supported in gstreamer-java!
Original issue reported on code.google.com by [email protected]
on 15 Apr 2008 at 11:45
There doesn't seem to be any implementation for GstValueList, the attached
patch adds some.
Original issue reported on code.google.com by [email protected]
on 15 May 2010 at 8:12
Attachments:
What steps will reproduce the problem?
1. When plaing process are finished no events are sent to host application
to notify about it
What is the expected output? What do you see instead?
Add support of EndOfMediaEvent or StopEvent or something like this
What version of the product are you using? On what operating system?
Latest one from svn(22/10/2007), OS Linux
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2007 at 8:02
Finally I'm running the SwingPlayer example in the Windows platform, but
with some changes. I also get random crashes but it seems to be a problem
in the gstreamer libraries because I have the same crashes with
gst-launch-0.10.exe.
I write here the problems and changes to make it run in Windows:
****************
Library loading
****************
I installed the windows binaries from the gstreamer site
(http://gstreamer.freedesktop.org/pkg/windows/releases/ , the setup ones),
and the gtk libraries from the gimp.org site. With this libraries the jna
native library loading fails because some libraries start with libXXX.dll
and others with libXXX-0.dll. To solve this problem I changed the
com.sun.jna.NativeLibrary constructor and added after the first "handle =
open(libraryPath);"
if (handle == 0) {
libraryPath = "lib"+findLibraryPath(libraryName, searchPath);
handle = open(libraryPath);
}
if (handle == 0) {
libraryPath = "lib"+findLibraryPath(libraryName+"-0", searchPath);
handle = open(libraryPath);
}
****************
File playing
****************
In windows the method org.gstreamer.PlayBin receives the URI with an path
that starts with a slash "/C:/myfiles/..." and changes it to
"///C:/myfile/..." which results in a URI "file:///C:/myfile/..." which is
an invalid URI for gstreamer. To solve this problem in Windows I changed
the method with this check:
public void setURI(URI uri) {
String uriString = uri.toString();
// Need to fixup file:/ to be file:/// for gstreamer
if ("file".equals(uri.getScheme())) {
if(uri.getPath().startsWith("/")) uriString = "file:/" +
uri.getPath();
else uriString = "file://" + uri.getPath();
}
set("uri", uriString);
}
Original issue reported on code.google.com by [email protected]
on 14 Aug 2007 at 4:55
What steps will reproduce the problem?
1.Try to build the gstreamer-java source
What is the expected output? What do you see instead?
The source should compile on all platforms, and should not directly
reference fields that are not part of the cross-platform portions SWT API.
What version of the product are you using? On what operating system?
Version 1.1. The issue also effects the current SVN.
Please provide any additional information below.
The issue can be fixed by using the Java reflection API. It is evident from
the code that the user intends that the code only execute on Linux
platforms, and the invalid field access references a field only available
in the SWT API for X server based platforms. A corrected version of
XOverlay.java is attached.
Original issue reported on code.google.com by [email protected]
on 15 Sep 2009 at 1:37
Attachments:
GStreamer now includes the AppSrc/AppSink elements as the recommended way
to feed buffers to a pipeline and to access raw buffers, instead of using
the FakeSrc/FakeSink elements:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dat
a-spoof.html
Here there is a C sample code that uses AppSrc:
http://webcvs.freedesktop.org/gstreamer/gst-plugins-bad/examples/app/appsrc_ex.c
?view=markup
It would be very useful to have such elements as part of gstreamer-java.
However, it seems that the AppSrc/AppSink elements are not entirely finished:
http://bugzilla.gnome.org/show_bug.cgi?id=413418
Original issue reported on code.google.com by [email protected]
on 18 Jul 2008 at 3:56
I think the bindings for the gstvideo library should be added, since
includes many utility functions:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/h
tml/gst-plugins-base-libs-gstvideo.html#gst-video-frame-rate
But where should this go? In org.gstreamer.lowlevel as GstVideoAPI.java maybe?
Original issue reported on code.google.com by [email protected]
on 1 May 2010 at 11:31
This will be very useful for the folks who don't use NB. If I'll have some
time I will create the simplest ant builds.
Original issue reported on code.google.com by [email protected]
on 4 Mar 2009 at 5:37
Have you considered moving to the latest JNA (3.2.3) and using direct call
mapping (https://jna.dev.java.net/#direct) where possible?
Original issue reported on code.google.com by david.g.hoyt
on 22 Oct 2009 at 4:59
Starting and stopping a pipeline multiple times seems to result in a memory
leak. I was able to reproduce the leak on Windows XP 32-bit, Windows 7
64-bit, and Ubuntu 8.04 using the latest gstreamer releases (core/base
0.10.29, good 0.10.22, etc.). You have to set a pipeline to NULL and then
PLAYING and do it several times before it becomes noticeable. Garbage
collecting any number of times does not prevent the steady rise in memory
usage. I've let it run and seen it get up to 1 GB before I killed it even
though it starts out using ~50 MB.
Please let me know if I'm doing something wrong or using the library in the
wrong way. It could very well be an issue with gstreamer itself -- but I'm
not well setup to test it out at that level. Any help would be appreciated.
I've attached a sample movie that I grabbed from the mplayer samples that's
short enough for you to see the leak in an adequate amount of time.
And here's a very simple example taken from OverlayPlayer to reproduce the
problem - it creates 4 windows and shows the same video in each in order to
show the leak more quickly:
package org.gstreamer.example;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Dimension;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import org.gstreamer.Bus;
import org.gstreamer.BusSyncReply;
import org.gstreamer.Element;
import org.gstreamer.ElementFactory;
import org.gstreamer.Gst;
import org.gstreamer.GstObject;
import org.gstreamer.Message;
import org.gstreamer.Structure;
import org.gstreamer.elements.PlayBin;
import org.gstreamer.event.BusSyncHandler;
import org.gstreamer.interfaces.XOverlay;
import com.sun.jna.Platform;
import org.gstreamer.State;
public class StartStopOverlayPlayer {
/** Creates a new instance of SwingPlayer */
public StartStopOverlayPlayer() {
}
private static Bus bus;
public static void main(String[] args) {
//System.setProperty("sun.java2d.opengl", "True");
args = Gst.init("Swing Player", args);
if (args.length < 1) {
System.err.println("Usage: SwingPlayer <filename>");
System.exit(1);
}
final String file = args[0];
final String overlayFactory = Platform.isWindows() ?
"directdrawsink" : "xvimagesink";
for(int i = 0; i < 4; ++i) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("Overlay Test");
final Canvas canvas = new Canvas();
canvas.setPreferredSize(new Dimension(640, 480));
frame.add(canvas, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
final PlayBin player = new PlayBin("Overlay Player");
player.setInputFile(new File(file));
bus = player.getBus();
final Element videoSink =
ElementFactory.make(overlayFactory, "overlay video sink");
player.setVideoSink(videoSink);
//
// Setting the overlay window ID is supposed to be done
from a sync handler
// but that doesn't work on windows
//
bus.connect(new Bus.EOS() {
public void endOfStream(GstObject source) {
do {
player.setState(State.NULL);
} while(player.getState(0L) != State.NULL);
player.setState(State.PLAYING);
}
});
bus.setSyncHandler(new BusSyncHandler() {
public BusSyncReply syncMessage(Message msg) {
Structure s = msg.getStructure();
if (s == null || !s.hasName("prepare-xwindow-id"))
return BusSyncReply.PASS;
XOverlay.wrap(videoSink).setWindowID(canvas);
return BusSyncReply.DROP;
}
});
if (Platform.isWindows()) {
XOverlay.wrap(videoSink).setWindowID(canvas);
}
player.play();
}
});
}
}
}
Original issue reported on code.google.com by david.g.hoyt
on 14 May 2010 at 12:37
Attachments:
Add a layer that is API/ABI compatible with Apple's quicktime for java layer.
Original issue reported on code.google.com by [email protected]
on 22 May 2007 at 10:40
With some mp3 the slider freeze
it looks like that this only happens with mp3 files
Original issue reported on code.google.com by [email protected]
on 21 Jan 2009 at 8:37
Attachments:
There are currently bindings for VLC (http://www.videolan.org/) available
under the GPL. It might be worthwhile to provide the same API over the
gstreamer bindings so people can switch to gstreamer without huge rewrites.
Original issue reported on code.google.com by [email protected]
on 22 May 2007 at 10:39
The "videoorientation" interface needs to be wrapped in gstreamer-java
Use src/org/gstreamer/interfaces/Mixer.java as a template on how to do it.
Original issue reported on code.google.com by [email protected]
on 27 Apr 2008 at 5:16
support for the GStreamer interfaces library is missing and high-level
implementations of
'gst_implements_interface_cast',
'gst_implements_interface_check'
and
'gst_element_implements_interface'
see here:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/h
tml/gstreamer-interfaces.html
Original issue reported on code.google.com by [email protected]
on 24 Apr 2008 at 7:38
What steps will reproduce the problem?
1.Switch out the SWT libraries for 64 bit SWT on linux.
2.Run SWTVideoTest.java
What is the expected output? What do you see instead?
There should be one shell open with a video test pattern. Instead, two
shells open, one empty and one with a test pattern. A stack trace is
printed in the console, saying that there is an illegal cast from long to
int. The problem is that the 32 and 64 bit SWT implementations use
different types for their fields.
What version of the product are you using? On what operating system?
SVN revision 328 of Xoverlay.java
Please provide any additional information below.
A patch is provided for the issue.
Original issue reported on code.google.com by [email protected]
on 29 Jan 2010 at 1:44
Attachments:
Can you add a Widget for java-gnome library ?
Original issue reported on code.google.com by [email protected]
on 22 Jun 2009 at 2:32
The SwingPlayer demo playing a video file does not stop consuming more and
more memory. It reached 1GB in under a minute. -Xmx had no effect.
I run Ubuntu Edgy with gstreamer-0.10, tried it with jdk6 and 7 and several
video files of different formats.
Original issue reported on code.google.com by [email protected]
on 21 May 2007 at 3:46
What steps will reproduce the problem?
1. Do not include SWT JAR in your classpath, since you aren't using SWT
directly or indirectly anywhere in your project
2. Use org.gstreamer.interfaces.XOverlay in your project, calling
setWindowID(java.awt.Component window) but NOT calling
setWindowID(org.eclipse.swt.widgets.Composite comp)
What is the expected output? What do you see instead?
Without SWT JAR in the classpath, use of
XOverlay.setWindowID(java.awt.Component window) should not result in a
compile error. However, it does:
The type org.eclipse.swt.widgets.Composite cannot be resolved. It is
indirectly referenced from required .class files
What version of the product are you using? On what operating system?
gstreamer-java 1.3
Ubuntu GNU/Linux 9.10
Please provide any additional information below.
Perhaps the functionality provided by
XOverlay.setWindowID(org.eclipse.swt.widgets.Composite comp) should be
refactored into a separate class intended specifically for using XOverlay
with SWT.
The primary reason this is irritating is that our project is deployed to
both Linux and Windows platforms, so we'll have to handle including the
correct SWT JAR even though we don't directly or indirectly use SWT in the
project.
Original issue reported on code.google.com by [email protected]
on 12 Apr 2010 at 7:53
Gstreamer provides a generic interface GstXOverlay (
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/h
tml/gst-plugins-base-libs-gstxoverlay.html
) to set the native window where Gstreamer should show the videos. It'd
great to have a heavyweight GstVideoComponent version to compare
performance. I'm sure that most of the times the lightweight solution is
better, but this may have a better performance (less JNI calls). If you
don't think that this solution can have better performance just delete this
Issue.
I changed the Player example to use this interface and it works (at least
in Windows). It's a pity that the jna library doesn't provide a method to
get the window handle of a Canvas (I submitted an Issue asking for this
feature https://jna.dev.java.net/issues/show_bug.cgi?id=25).
I show you below the changed/included code (It's only a quick & dirty
example). It works but it has a lot of problems. I couldn't get the
VideoSink of the PlayBin, so I had to set the videsink by hand, and in the
documentation of the gstoverlay it says that the window_id should be set
inside a SyncHandler, but I couldn't change the SyncHandler of the PlayBin.
Player.java
...
player.setInputFile(new File(args[0]));
final Element videoSink = ElementFactory.make("directdrawsink",
"VideoSinkProba");
player.setVideoSink(videoSink);
{
Pointer overlay =
GstAPI.gst.gst_implements_interface_cast(videoSink.handle(),GstInterfaces.gst.gs
t_x_overlay_get_type());
GstInterfaces.gst.gst_x_overlay_set_xwindow_id(overlay,
Native.getWindowID(frame));
}
...
GstInterfaces.java
...
public interface GstInterfaces extends Library{
GstInterfaces gst = (GstInterfaces)
GNative.loadLibrary("gstinterfaces-0.10", GstInterfaces.class, new
HashMap<String, Object>() {{
put(Library.OPTION_TYPE_MAPPER, new GTypeMapper());
}});
void gst_x_overlay_set_xwindow_id(Pointer overlay, long xwindow_id);
NativeLong gst_x_overlay_get_type();
}
...
GstAPI.java
...
Pointer gst_implements_interface_cast(Pointer obj, NativeLong gtype);
...
Original issue reported on code.google.com by [email protected]
on 17 Aug 2007 at 7:31
What steps will reproduce the problem?
1. setup playbin and connect Bus.Tag listener to bus
2. set input file (mp3 or ogg)
3. output tagsFound in listener
What is the expected output? What do you see instead?
The files contain a Date (tested with mp3 and ogg) but I see only that a
tagName "date" is found but tagData is an empty String. Other tags (title,
artist, album, track-count, track-number etc. work fine)
What version of the product are you using? On what operating system?
OS:
Linux 2.6.31.12-174.2.22.fc12.x86_64 #1 SMP Fri Feb 19 18:55:03 UTC 2010
x86_64 x86_64 x86_64 GNU/Linux
gstreamer-0.10.25.1-3.fc12.x86_64
gstreamer-java-1.3-2.fc12.x86_64
jna-3.2.4-3.fc12.x86_64
Please provide any additional information below.
I tried it with java 1.6 and java 1.7
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b76)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b05, mixed mode)
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 10:23
gstreamer-java needs a simple swing component similar to playbin.
e.g.
GstVideoPlayer player = new GstVideoPlayer("file:///...");
getContentPane.add(player);
player.start();
Original issue reported on code.google.com by [email protected]
on 15 May 2007 at 8:55
1) Bin:
gst_debug_bin_to_dot_file: Comes in quite handy for debugging dynamic
pipelines.
2) Element:
1) gst_element_sync_state_with_parent: helps with ensuring state
consistency in dynamic pipelines.
2) gst_element_query: perform queries on particular elements.
3) GstObject:
gst_object_get_parent: useful in figuring out which event came from which
bin and so on.
4) Pad:
1) dataProbe: to inspect and control data flowing through the pads.
2) gst_pad_set_blocked_async: required to block without deadlocks in
certain situations.
Original issue reported on code.google.com by [email protected]
on 27 Jul 2009 at 4:26
According to Swing's single-thread rule, SwingPlayer's main should become
something like:
public static void main(String[] args) {
final GMainLoop loop = new GMainLoop();
args = Gst.init("Swing Player", args);
if (args.length < 1) {
System.err.println("Usage: SwingPlayer <filename>");
System.exit(1);
}
final PlayBin playbin = new PlayBin("play");
playbin.setInputFile(new File(args[0]));
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// System.setProperty("sun.java2d.opengl", "True");
JFrame frame = new JFrame("Swing Test");
GstVideoComponent panel = new GstVideoComponent();
panel.setPreferredSize(new Dimension(640, 480));
frame.add(panel, BorderLayout.CENTER);
// Element xsink = ElementFactory.make("ximagesink", "xsink");
// Element xvsink = ElementFactory.make("xvimagesink",
// "xvsink");
// Element sdlsink = ElementFactory.make("sdlvideosink",
// "sdlsink");
// Element audio = ElementFactory.make("gconfaudiosink",
// "audio");
// playbin.setAudioSink(audio);
playbin.setVideoSink(panel.getElement());
// playbin.setVideoSink(xsink);
// playbin.setVideoSink(getGLSink());
playbin.setState(State.PLAYING);
loop.startInBackground();
frame.setSize(640, 480);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
Original issue reported on code.google.com by [email protected]
on 23 May 2007 at 9:34
Current signature of event probe (Pad.EVENT_PROBE) is:
public static interface EVENT_PROBE {
public void eventReceived(Pad pad, Event event);
}
Having boolean as the return type would enable us to choose whether to
forward or drop events at the pad. At the moment, they seem to be dropped
silently. Returning a boolean value would help match the "have-data" signal
signature of:
gboolean user_function (GstPad *, GstMiniObject *mini_obj, gpointer data);
Reference:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.h
tml#GstPad-have-data
Original issue reported on code.google.com by [email protected]
on 10 May 2009 at 10:11
When the method Pipeline.seek is called with a rate value different from
1.0, the framerate should change:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstEleme
nt.html#gst-element-seek
but this doesn't seem to occur. The playback continues at the original rate.
Original issue reported on code.google.com by [email protected]
on 25 May 2009 at 10:04
Hi brothers,
I am writing out a little application using the gstreamer-java
framework. I would like to know how to initialize gstreamer to enable
capture from my webcam (v4l2 device).
The code below enables me to read from disk and other but I want to
capture from webcam. Thks !
args[0]="~/films/12.Rounds.avi";
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);
Original issue reported on code.google.com by [email protected]
on 14 Nov 2009 at 7:27
It would be nice to have this function, as not all events are trappable by
using Element.connect() nor Bus.connect(). Included is a (tested) patch
against the latest hg repository. Thanks.
Original issue reported on code.google.com by [email protected]
on 25 Jul 2008 at 8:58
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.