gstreamer-java / gst1-java-core

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

hlssink is ignoring properties #185

Closed not404-found closed 4 years ago

not404-found commented 4 years ago

Hi there! I'm setting properties to hlssink but most of them are ingnored. Only location works but not correcty. Example below: Element hlssink = ElementFactory.make("hlssink", "my-hlssink"); hlssink.set("max-files", 10); hlssink.set("location", "segment%05d.ts"); hlssink.set("playlist-location", "playlist.m3u8"); hlssink.set("target-duration", 10);

output: image

All properties ignored: no playlist, no-new-chunks, chunk is bigger than 10 sec

But when use gst-launch-1.0 all works fine

Tech: Windows 10 open-jdk-12 gstreamer: gstreamer-1.0-mingw-x86_64-1.16.2 & gstreamer-1.0-devel-mingw-x86_64-1.16.2 java-gstreamer: gst1-java-core:1.1.0 java-jna: 5.2.0

neilcsmith-net commented 4 years ago

Not sure if this is a bug or not. Can you share more of the setup code around this? In particular working gst-launch-1.0 line vs replicating Java code. Does reading the properties back give the right or wrong values? Also remember you may be able to use Gst.parseLaunch() as a workaround.

not404-found commented 4 years ago

Ok, I have Incoming stream from webrtcbin, then I send it to Element queue = ElementFactory.make("queue", "my-videoqueue"); Element rtph264depay = ElementFactory.make("rtph264depay", "my-rtph264depay"); Element h264parse = ElementFactory.make("h264parse", "my-h264parse"); Element mpegtsmux = ElementFactory.make("mpegtsmux", "my-mpegtsmux"); Element hlssink = Gst.parseLaunch("hlssink max-files=10 playlist-location=playlist123.m3u8 location=chunk%d.ts target-duration=10");

Gst.parseLauch() - doesn't work too.

Does reading the properties back give the right or wrong values? It returns correct values

Here is gst-launch-1.0 working pipe: image

neilcsmith-net commented 4 years ago

So, the gst-launch-1.0 pipeline is different?! Try replicating that entirely first and see if the Java bindings work as expected. My guess is this is a difference in underlying GStreamer behaviour.

not404-found commented 4 years ago

My bad. With the same pipeline all works correctly. But I still don't understand why in my pipeline default props are ignored?

neilcsmith-net commented 4 years ago

Reading things like this align with what I assumed might be happening - target-duration is just that, a target, and relies on aspects of the incoming stream, such as where keyframes are. I'm going to close this. It's not an issue with the Java bindings. You might want to follow up on the GStreamer mailing list, and also our mailing list if you get stuck with implementing any recommendation.