Sending encoded H264 streams via WebRTC

225 views
Skip to first unread message

Suman Karmakar

unread,
Apr 30, 2018, 3:37:58 AM4/30/18
to discuss-webrtc
Hello,
I am using Texas Instrument's IVA-HD hardware encoder to encode a video stream comes from a camera source. I want to send this stream to a connected client(Chrome 66.0.3359.139) via WebRTC. 

On the source side, from the log, it look like every thing is running fine. TI encoder is giving IDR frame on ForceKey frame request and every key frame comes with SPS/SSP information. Apparently I dont see any error message on the source side. But the issue is that on the client side, in the chrome browser none of the frames getting rendered! On the encoding side, I am using H264 baseline profile, level 4.1. I can see logs like this:

(rtp_sender_video.cc:429): Sent first RTP packet of the first video frame (pre-pacer)
(rtp_sender_video.cc:433): Sent last RTP packet of the first video frame (pre-pacer)
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 0] [send: 25944 bytes / 29 ms = 894.621 kb/s] [receive: 25944 bytes / 29 ms = 894.621 kb/s]
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 0] [send: 34592 bytes / 38 ms = 910.316 kb/s] [receive: 34592 bytes / 38 ms = 910.316 kb/s]
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 1] [send: 25944 bytes / 14 ms = 1853.14 kb/s] [receive: 25944 bytes / 14 ms = 1853.14 kb/s]
(probe_controller.cc:162): Measured bitrate: 1853142 Minimum to probe further: 1260000
(bitrate_prober.cc:111): Probe cluster (bitrate:min bytes:min packets): (3706284:6949:5)
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 1] [send: 34592 bytes / 19 ms = 1820.63 kb/s] [receive: 34592 bytes / 19 ms = 1820.63 kb/s]
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 2] [send: 43320 bytes / 12 ms = 3610 kb/s] [receive: 43320 bytes / 12 ms = 3610 kb/s]
(probe_bitrate_estimator.cc:146): Probing successful [cluster id: 2] [send: 51984 bytes / 14 ms = 3713.14 kb/s] [receive: 51984 bytes / 14 ms = 3713.14 kb/s]
(probe_controller.cc:162): Measured bitrate: 3713142 Minimum to probe further: 2594398
(bitrate_prober.cc:111): Probe cluster (bitrate:min bytes:min packets): (5000000:9375:5)

I also noticed that instead of TI IVA-HD, if I use OpenH264 that comes with WebRTC code, it works properly which also uses baseline profile, level 4.1

I am kind of in a dead end without any clue what is happening wrong in my implementation. Any help on this is greatly appreciated.

Thanks 
 

Suman Karmakar

unread,
Apr 30, 2018, 3:07:34 PM4/30/18
to discuss-webrtc
IDR frame attached
frame.h264

Niels Moller

unread,
May 2, 2018, 7:57:45 AM5/2/18
to discuss...@googlegroups.com
On Sat, Apr 28, 2018 at 9:11 PM, Suman Karmakar <suman...@gmail.com> wrote:
> But the issue is that on the client side, in the chrome
> browser none of the frames getting rendered! On the encoding side, I am
> using H264 baseline profile, level 4.1. I can see logs like this:
>
> (rtp_sender_video.cc:429): Sent first RTP packet of the first video frame
> (pre-pacer)
> (rtp_sender_video.cc:433): Sent last RTP packet of the first video frame
> (pre-pacer)
> (probe_bitrate_estimator.cc:146): Probing successful [cluster id: 0] [send:
> 25944 bytes / 29 ms = 894.621 kb/s] [receive: 25944 bytes / 29 ms = 894.621
> kb/s]

Since you're sending to Chrome, you can enable logging also on the
receive side, see https://www.chromium.org/for-testers/enable-logging.
That might provide more clues as to what's going wrong.

Regards,
/Niels

Suman Karmakar

unread,
May 3, 2018, 12:48:20 AM5/3/18
to discuss-webrtc
I found the root cause. From the native application side the SPS and PPS were not sent correctly. As a result chrome was not able to decode the IDR frame and kept on asking for next IDR frame. 

@Niels enabling chrome log really helped. Thanks


Regards,
Suman
Reply all
Reply to author
Forward
0 new messages