AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
6.97k stars 498 forks source link

Option to keep connection #1344

Open Gagi2k opened 2 months ago

Gagi2k commented 2 months ago

Hi,

i'm using the project to transcode my doorbird camera rtsp stream to mjpeg to embed it into App which only supports mjpeg. That works fine so far with the following config:

streams:
  doorbird:
    - ffmpeg:rtsp://<ip>/mpeg/media.amp?videoframeskipmode=empty#media=video#backchannel=0#hardware
    - ffmpeg:doorbird#video=mjpeg#hardware

The problem is that the first connection takes very long and because of that the App doesn't connect correctly. Once i open the stream on my Browser first and then use the App it works without problems. Is there an option to keep the connection to doorbird to make the first connection request faster ?

PauloCardosoC commented 1 month ago

Hi,

i'm using the project to transcode my doorbird camera rtsp stream to mjpeg to embed it into App which only supports mjpeg. That works fine so far with the following config:

streams:
  doorbird:
    - ffmpeg:rtsp://<ip>/mpeg/media.amp?videoframeskipmode=empty#media=video#backchannel=0#hardware
    - ffmpeg:doorbird#video=mjpeg#hardware

The problem is that the first connection takes very long and because of that the App doesn't connect correctly. Once i open the stream on my Browser first and then use the App it works without problems. Is there an option to keep the connection to doorbird to make the first connection request faster ?

This is because of some rtsp streans have a high delay key frame (10 or 15 seconds), if the don't arrive the transcode don't start.

For this is better use thr ffserver

https://trac.ffmpeg.org/wiki/ffserver

In my tests it keep the connection open, but have a high cpu usage.