Example pipeline for hlssink from a rtsp stream

I am a newbie to Gstreamer, I am building an application on Gstreamer Java bindings , Can someone suggest a pipeline where it receives a rtsp stream and sinks as a hls and then tee to a sencondary sink where it converts and saves as jpeg with caps?

Any help is highly appreciated, I am really struggling.

Best regards and Thank you :pray:t2:

Something like this perhaps (completely untested)?

 gst-launch-1.0 rtspsrc location=rtsp://...  ! rtph264depay ! name=t \
    t. ! queue ! h264parse ! hlssink2 max-files=5
    t. ! queue ! decodebin3 ! videoconvert ! videoscale ! videorate ! video/x-raw,width=192,height=108,framerate=1/1 ! jpegenc ! multifilesink location=frame-%05d.jpg

This assumes the camera produces H.264 and you want to just remux and not re-encode the video for HLS.

There’s also an hlssink3 these days I think, and if you’re on a recent enough GStreamer you can use videoconvertscale instead of videoconvert ! videoscale.