WebRTC Streaming issues

Hi,

I have two issues with webRTC Streaming,

1) After sometime when a stream is published, the video goes black at streaming side but at viewer side, the stream can still be viewed.
Please check attached image below
1597059173355.png
2) Streaming gets disconnected automatically after 1-2 hours. I found below logs during this issue


{
"nodeId" : "Ku7RV12xDHQjht5WfWKHMrM1tZ5LE0hI@54.242.183.111",
"appKey" : "defaultApp",
"sessionId" : "/172.31.12.117:51458/172.31.25.70:8080-aaf3a8b5-7983-4ad5-a313-b599506e986a",
"mediaSessionId" : "afb5d660-db14-11ea-ab92-df0da482a3b5",
"name" : "38-1597069241-205838",
"published" : true,
"hasVideo" : true,
"hasAudio" : false,
"status" : "FAILED",
"videoCodec" : "H264",
"info" : "Failed by RTP activity",
"description" : "Video RTP activity",
"record" : false,
"width" : 480,
"height" : 720,
"bitrate" : 0,
"minBitrate" : 0,
"maxBitrate" : 0,
"quality" : 0,
"history" : false,
"gop" : 0,
"fps" : 0,
"audioBitrate" : 0,
"codecImpl" : "",
"transport" : "UDP",
"cvoExtension" : false,
"createDate" : 1597069248867,
"mediaType" : "publish",
"mediaProvider" : "WebRTC",
"origin" : "******",
"constraints" : {
"audio" : false,
"video" : {
"width" : 720,
"height" : 480,
"deviceId" : {
"exact" : "68346DF37A4777C266EFF677A9D18EF18662D300"
}
}
}
}
 
Last edited:

Max

Administrator
Staff member
Good day.
I have two issues with webRTC Streaming,

1) After sometime when a stream is published, the video goes black at streaming side but at viewer side, the stream can still be viewed.
Please check attached image below
Please clarify the following:
1. What browser, OS, device are used for test?
2. Is the issue reproduced in out-of-the-box examples (Two Way Streaming)? If not, please modify the Two Way Streaming example source code minimally to reproduce the issue, and send us the code using this link.
3. Please also reproduce the issue and collect a report as described here including publishing client debug logs and traffic dump. The traffic dump collection should be started before stream is published. Please send report using this link.
2) Streaming gets disconnected automatically after 1-2 hours. I found below logs during this issue
The message "Failed by RTP activilty" with info "Video RTP activity" means publisher stops sending video packets at least in 60 seconds (by default). This in turn usually means publisher channel issues.
You can implement channel quality indicator for publisher as described here, if quality drops, the publisher should choose lower resolution?bitrate, change network or republish stream.
If you have a many publishers with bad channels, you can also inscrease RTP activity timer, for example to 3 minutes
Code:
rtp_activity_timeout=180
or disable RTP activity detection (not recommended)
Code:
rtp_activity_video=false
rtp_activity_audio=false
 
1. What browser, OS, device are used for test?
2. Is the issue reproduced in out-of-the-box examples (Two Way Streaming)? If not, please modify the Two Way Streaming example source code minimally to reproduce the issue, and send us the code using
In Ipad on safari browser, the issue can be reproduced.
When audio is muted, the video goes black approximately at 8 minutes.
1597391234602.png


I have configured the below settings in my origin server:
Code:
rtp_activity_timeout=180
rtp_activity_video=false
rtp_activity_audio=false
Is there any other settings that need to be added?
 

Max

Administrator
Staff member
In Ipad on safari browser, the issue can be reproduced.
When audio is muted, the video goes black approximately at 8 minutes.
What example application do you use for testing (Two Way Streaming, Media Devices)?
How do you mute the audio: fully disable audio track by constraints {audio:false, video:true}, or mute using publishStream.muteAudio() function?
I have configured the below settings in my origin server:
To disable RTP activity checking, it is enough to set
Code:
rtp_activity_video=false
rtp_activity_audio=false
With this settings, timeout will not work.
 
Last edited:
What example application do you use for testing (Two Way Streaming, Media Devices)?
WebRTC streaming and HLS for viewing the stream.

How do you mute the audio: fully disable audio track by constraints {audio:false, video:true}, or mute using publishStream.muteAudio() function?
Is that required to add those constraints for muted and non-muted videos?
 

Max

Administrator
Staff member
WebRTC streaming and HLS for viewing the stream.
Seems like the publisher browser stops sending video packets. HLS continues playing until segments exhausted, then, it should stop.
There is a known issue (p. 7). Please try to publish VP8 instead of H264, this could help. Anyway, you need transcoding to play HLS smoothly.
Is that required to add those constraints for muted and non-muted videos?
Constraints make browser to publish stream without audio or video.
Muting just make browser to send silence for audio or black screen fro video.
 
But the actual issue is webrtc preview screen goes black after sometime, approximate 8 minutes
I want to know whether this issue related to browser constraints settings ({audio:false, video:true} or rtp_activity configs

Please check my initial post
1) After sometime when a stream is published, the video goes black at streaming side but at viewer side, the stream can still be viewed.
 

Max

Administrator
Staff member
Good day.
We reproduced the issue on iOS 12.4.7 with video only stream published with constraints {audio:false, video:true}. It seems like browser cleans local video element but still sending video packets after some time of user inactivity.
As workaround, you can publish the stream with audio enabled then mute it
Code:
    session.createStream({
        name: streamName,
        display: localVideo,
        cacheLocalResources: true,
        receiveVideo: false,
        receiveAudio: false
    }).on(STREAM_STATUS.PUBLISHING, function (stream) {
        stream.muteAudio();
        ...
    }).publish();
 

Max

Administrator
Staff member
Unfortunately, the trick supposed in this thread work only for playing streams, but not for publishing. RTCPeerConnection ontrack event handler fires when stream is added to RTCRtpReceiver, but not RTCRtpSender.
And, for playing streams, this is already done.
So using muted audio seems the only workaround for publishing.
 
Top