gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

rtspsrc plugin problem #172

Closed chenjeff622 closed 4 years ago

chenjeff622 commented 4 years ago

this is my code . #################################################################### Element src = ElementFactory.make("rtspsrc", "src"); src.set("location", "rtsp://XXXXXXXXXXXXXXXXXXXXXXXX"); src.set("latency", 100);

    Element decode = ElementFactory.make("decodebin", "decode");
    Element sink = ElementFactory.make("autovideosink", "sink");

    pipe.addMany(src, decode, sink);
    Pipeline.linkMany(src, decode, sink);
    pipe.play();

    Gst.getExecutor().schedule(Gst::quit, 60, TimeUnit.SECONDS);
    Gst.main();

#################################################################### it always show Exception: (java.exe:16476): GStreamer-CRITICAL **: 19:13:22.985: gst_event_set_seqnum: assertion 'seqnum != GST_SEQNUM_INVALID' failed.

when i use commandline below. it display correct. gst-launch-1.0.exe rtspsrc location="rtsp://XXXXXXXXXXXXXXXXXXXXXXXX" latency=100 ! decodebin ! autovideosink

neilcsmith-net commented 4 years ago

You can't link a decodebin to the sink in this way. You need to listen for the pads to be added. This is handled for you if you use the CLI, or using the Gst::parseLaunch methods. Otherwise check the code at https://github.com/gstreamer-java/gst1-java-examples/blob/master/src/main/java/org/freedesktop/gstreamer/examples/AppSrcToAppSinkExample.java#L174

Please use the mailing list if you have any further questions on this, thanks.