go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

gstreamer pipeline support

Open 4ib3r opened this issue 2 years ago • 5 comments

It's possible to add gstreamer pipeline support?

 - exec:gst-launch-1.0 -q rtspsrc is-live=true latency=500 location=rtsp://x.x.x.x:554/hevc_stream name=t ! rtph265depay ! h265parse ! queue leaky=2 ! mppvideodec ! tee name=dec ! mpph264enc header-mode=1 profile=66 width=1280 height=720 ! h264parse ! mux. t. ! queue ! rtppcmadepay ! alawdec ! opusenc ! queue leaky=2 ! rtspclientsink name=mux protocols=tcp timeout=1000 latency=500 location= {output} dec. ! videorate drop-only=true ! video/x-raw,framerate=1/1 ! jpegenc ! multifilesink async=1 max-files=1 location="/dev/shm/cam_frame.jpg"

In one process it decode h265 stream using hardware decoder (it work on RK3588S processor), encode it to h264 scaled to 1280x720 (using hardware encoder), encode jpeg frame using decoded data, and at end it send h264 to go2rtc using rtspclientsink and save image to file. It's will be great if it possible to add multiple outputs to go2rtc and use it more like with ffmpeg.

4ib3r avatar Jul 20 '23 09:07 4ib3r

I'm scared of these terrifying pipeline constructions. I don't understand anything about them :)

AlexxIT avatar Jul 20 '23 09:07 AlexxIT

I use a home automation platform Control4 which uses gstreamer to handle camera connections. I'm getting this error with the Frigate implementation of go2rtc

Testing H264 ...
Verifying address ...
Address not verified.
Verifying address:port ...
Address:port verified.
Verifying URL ...
URL not verified: No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.
Test failed.
[gst-launch-1.0 uridecodebin uri=rtsp://XXX:[email protected]:8554/CAM101
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://XXX:[email protected]:8554/CAM101
Progress: (open) Retrieving server options
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(6323): gst_rtsp_src_receive_response (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive message. (Parse error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...](url)

Is this related to the 'add pipeline' ask or should this be a separate issue?

k1n6b0b avatar Jul 28 '23 20:07 k1n6b0b

@k1n6b0b I don't understand what you doing in your logs. I think original issue about construction complicated gstreamer command line from simple instructions, like:

streams:
  camera1: gstreamer:rtsp://x.x.x.x:554/hevc_stream#video=h264

AlexxIT avatar Aug 23 '23 07:08 AlexxIT

@AlexxIT i don't have access to the gstreamer command/library directly, but I know it's used by my control system as that's the error it produces when trying to connect.

This is the controller, it runs Linux but has a custom program to configure provided by the vendor SnapAV CONTROL4 EA5

I believe this is the driver Axis Generic Fixed with H264

I cannot edit/view under the hood beyond this. So need to fix or understand the error better. Try to reproduce it from my OS with gstreamer, etc

I'm trying to use Control4 (view cameras via gstreamer) -> Frigate restream (go2rtc)

k1n6b0b avatar Aug 23 '23 11:08 k1n6b0b

gstreamer pipelines support would be actually nice.

ignis32 avatar Jun 22 '24 18:06 ignis32