On Mon, 5 Sept 2022 at 09:29, Jason Thomas <
katsoft...@gmail.com> wrote:
> Bin bin = Gst.parseBinFromDescription("rtspsrc location=rtsp://
jason:mypas...@192.168.1.212:554/stream0 ! rtph264depay ! h264parse ! avdec_h264 ! videoscale ! videoconvert ! capsfilter caps=video/x-raw,width=640,height=480",
> true);
...
> SwingPlayer does work when using the default webcam. Also, this works using gst-launch-1.0. Any ideas on why it would behave differently between gst-launch and Java? Thanks for any advice or tips!
Actually, it wouldn't work in gst-launch either if you were actually
trying the same thing. One day we need to update that example to use
Gst.parseLaunch(), which is what gst-launch is using - it causes too
much confusion. You're putting the elements inside a Bin (container)
there, and passing `true` to ghost the pads. This only works properly
when the elements inside don't have sometimes / request pads that only
appear after the pipeline starts rolling.
To make this work with parseLaunch you'll have to add "! appsink
name=sink" on the end, and extract the AppSink element by name to pass
to the Swing component constructor.
The shorter answer is to base this on the video player example
instead. Use PlayBin to play the rtsp URI unless you have a real need
to configure the pipeline yourself. And even then, you can use
listeners on the PlayBin to configure individual elements in most
cases.
Best wishes,
Neil
--
Neil C Smith
Codelerity Ltd.
www.codelerity.com
Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD