go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

reuse stream in exec source

Open Suxsem opened this issue 1 year ago • 1 comments

Hi, not really an issue sorry, but I'm trying to have a mosaic of my security cameras using xstack.

To keep the network traffic low, i would like to resume an existing stream. Is it possible to reference an existing stream in an "exec" source?

Something like that

streams:
  sonoff_camera: rtsp://rtsp:[email protected]/av_stream/ch0
  dahua_camera:
    - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
    - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=1
  amcrest_doorbell:
    - rtsp://username:[email protected]:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
  mosaic: exec:ffmpeg -i sonoff_camera -i dahua_camera -vcodec libx264 -tune zerolatency -filter_complex "[0:v]scale=640:-1[v0];[v0][1:v]hstack=inputs=2" -f rtsp {output}

Suxsem avatar Sep 27 '24 14:09 Suxsem

Don't use sonoff_camera. Use rtsp://localhost:8554/sonoff_camera.

AlexxIT avatar Oct 06 '24 09:10 AlexxIT

@AlexxIT Sorry for bumping this issue, but could you elaborate on why you suggested that? Is it because this is being used as Incoming Source? I see in the docs that those don't get closed, but not sure if that's what/why you're suggesting.

ShantanuNair avatar Mar 25 '25 11:03 ShantanuNair

For ffmpeg, a setting of this kind means nothing: ffmpeg -i sonoff_camera -i dahua_camera ...

AlexxIT avatar Mar 26 '25 03:03 AlexxIT