go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

Purpose and how to use Produce-stream API

Open lucasmaj opened this issue 1 year ago • 1 comments

https://alexxit.github.io/go2rtc/api/#tag/Produce-stream

Please provide an example for the purpose/use case of this API.

Thanks

lucasmaj avatar Jul 02 '24 05:07 lucasmaj

https://github.com/AlexxIT/go2rtc#incoming-sources

AlexxIT avatar Jul 02 '24 15:07 AlexxIT

Section "Incoming sources" has zero go2rtc config examples :(

xaionaro avatar Jul 17 '24 23:07 xaionaro

Example:

streams:
  camera1:

From docs:

You can push data only to existing stream (create stream with empty source in config)

AlexxIT avatar Jul 18 '24 08:07 AlexxIT

Yes. This is basically what I tried before commenting about the absence of the config. If one writes config:

streams:
  camera1:

publish:
  camera1:
    - rtmp://127.0.0.1:1937/live

And then executes go2rtc, they get an error:

xaionaro@void:~/go/src/github.com/AlexxIT/go2rtc$ go run ./
10:57:22.776 INF go2rtc platform=linux/amd64 revision= version=1.9.4
10:57:22.776 INF config path=/home/xaionaro/go/src/github.com/AlexxIT/go2rtc/go2rtc.yaml
10:57:22.776 INF [rtsp] listen addr=:8554
10:57:22.776 INF [api] listen addr=:1984
10:57:22.776 INF [webrtc] listen addr=:8555/tcp
10:57:23.776 ERR internal/streams/publish.go:31 > error="streams: unknown error"

xaionaro avatar Jul 18 '24 09:07 xaionaro

You can't publish empty stream

AlexxIT avatar Jul 18 '24 14:07 AlexxIT

Yes. But I intent to start streaming to this endpoint (e.g. using OBS) soon after running go2rtc (and hoping to get this stream re-published). I thought this was the use case intended by the support of "empty" sources.

xaionaro avatar Jul 18 '24 16:07 xaionaro