Using AppSrc with PlayBin

151 views
Skip to first unread message

Brad Hards

unread,
Sep 14, 2021, 6:56:52 AM9/14/21
to gstreamer-java
I'm trying to build a viewer for MIE4NITF (essentially large format video split into spatial and temporal blocks). I've got the NITF parsing working, and have extracted the tiles for a single time window, where each tile is basically a H.264 elementary stream.

If I feed one of those tiles to a playbin, I can view it using autovideosink or a FXImageSink (which is where I want to go - multiple FXImageSinks in a matrix view).
The code that works looks like:
                PlayBin playbin = new PlayBin("playbin");
                FXImageSink imageSink = new FXImageSink();
                playbin.setVideoSink(imageSink.getSinkElement());
                ImageView view = new ImageView();
                // more setup of the view...
                playbin.stop();
                File f = new File("/home/bradh/coding/jim/jim/ui/wpr-h264.r3t0q0c1i15.NTF_10.h264");
                playbin.setInputFile(f);
                playbin.play();

If I feed it a pipeline like "filesrc location=wpr-h264.r3t0q0c1i15.NTF_10.h264 ! h264parse ! avdec_h264" it works with an autovideosink or xvimagesink, but not with an FXImageSink. There doesn't appear to be any error, just no output.

So playbin looks better. However I don't want to have to use a filesrc. I really want to build an AppSrc that pulls the right part of the right files out. However I have no idea how to set up the AppSrc.
I had hoped (based on the upstream example at https://gstreamer.freedesktop.org/documentation/tutorials/playback/short-cutting-the-pipeline.html?gi-language=c) that I could just pass a magic appsrc URI:
           playbin.setURI(new URI("appsrc://"));
However that just results in a URI exception:
java.net.URISyntaxException: Expected authority at index 9: appsrc://

There are some good examples of AppSrc as an element in an explicit pipeline, but that would require unblocking why it doesn't work with FXImageSink.

So is there a way that will allow me to use the PlayBin goodness to feed FXImageSink while sourcing the data out of part of a memory mapped file (which I assume will require a simple AppSrc) ?

Or are there suggestions on what else might be needed in the FXImageSink-based pipeline?

Thanks for your time.

Brad

Brad Hards

unread,
Sep 14, 2021, 7:12:00 AM9/14/21
to gstreamer-java
Based on another thread, where Neil suggested that the FXImageSink might want specific colour approach, I added a videoconvert step to my pipeline, and that is now working. So I can probably move forward using the pipeline building approach.

I'd still be interested in knowing if there is a way to do it with PlayBin though.

Brad

Neil C Smith

unread,
Sep 14, 2021, 8:20:08 AM9/14/21
to gstream...@googlegroups.com


On Tue, 14 Sep 2021, 12:12 Brad Hards, <brad....@sigmabravo.com> wrote:
I'd still be interested in knowing if there is a way to do it with PlayBin though.

Reply all
Reply to author
Forward
0 new messages