How do I set the waiting time to start rtsp streaming?

388 views
Skip to first unread message

Rich Rain

unread,
Mar 3, 2021, 8:29:04 PM3/3/21
to meetecho-janus
Hello.

It is being used well by setting rtsp stream. However, if specify the ip address, it works fine, but if you specify the domain name, the stream cannot be displayed.
Of course VLC all works well.

As a result of testing, if VLC is also set to ip address, it connects immediately and the video comes out, but if it is set to domain name, it takes about 15 seconds to wait.

So, when I connect to rtsp from janus, it seems to be solved by changing the rtsp streaming start waiting time longer.

Looking at janus' log, it seems that there will be only 5 seconds. 

What should I do?

Thanks.

# janus.plugin.streaming.jcfg
rtsp-cam: {
  type = "rtsp"
  id = 100
  description = "RTSP cam"
  audio = false
  video = true
  url = "rtsp://192.168.0.160:554/stream0"          # good
  #url = "rtsp://ip-cam.cam.com:554/stream0"   # not display
}

# janus log (  bin/janus -d 7 )
[rtsp-cam] Reconnected to the RTSP server, streaming again
^[[33m[WARN]^[[0m [rtsp-cam] 5s passed with no media, trying to reconnect the RTSP stream

Rich Rain

unread,
Mar 4, 2021, 4:07:06 AM3/4/21
to meetecho-janus
I changed plugins/janus_streaming.c to increase it to 30 seconds, but the same is the case. Where should I fix it?

// plugins/janus_streaming.c : 8562
if(!source->reconnecting && (now - source->reconnect_timer > 5*G_USEC_PER_SEC)) {   // 5 => 30
                                /* 5 seconds passed and no media? Assume the RTSP server has gone and schedule a reconnect */
                                JANUS_LOG(LOG_WARN, "[%s] %"SCNi64"s passed with no media, trying to reconnect the RTSP stream\n",
                                        name, (now - source->reconnect_timer)/G_USEC_PER_SEC);

2021년 3월 4일 목요일 오전 10시 29분 4초 UTC+9에 Rich Rain님이 작성:

Lorenzo Miniero

unread,
Mar 4, 2021, 4:19:48 AM3/4/21
to meetecho-janus
I don't understand why you people keep saying "it works with VLC". Yeah, I know, VLC can open a can of tuna as well, it can open EVERYTHING. Our RTSP stack is more barebone, and for codecs support you're stuck with what the browser supports, not everything, so they're NOT comparable. 99% it's a codec support issue, and something that's been addressed countless times in this group already: you need to override the profile via videofmtp.

L.

Lorenzo Miniero

unread,
Mar 4, 2021, 4:20:29 AM3/4/21
to meetecho-janus
But if the error you get is the 5s timeout, it means Janus is not getting RTP packets from the RTSP server/camera. Check what happens with wireshark.

L.

Reply all
Reply to author
Forward
0 new messages