H264 WebRTC video streamed from ffmpeg through Janus is very choppy on playback

后端 未结 2 1862
滥情空心
滥情空心 2021-02-09 22:18

Trying to stream video through following chain: h264/mp4 file on local instance storage (AWS)->ffmpeg->rtp->Janus on same instance->WebRTC playback (Chrome/mac). Resulting video

2条回答
  •  梦如初夏
    2021-02-09 23:21

    The solution proved to be beautiful in it's obviousness. ffmpeg sent stream to Janus as RTP, Janus sent it further to viewers, obviously, as SRTP, because this is WebRTC and it is always encrypted. Which added a bunch of bytes to each packet as encryption overhead. In some cases, it meant packets going over the MTU and discarded - each time it happened, there was a visible jerk in video.

    Simple addition of ?pkt_size=1300 to output RTP URL of ffmpeg removed the problem.

    Thanks to Lorenzo Miniero of Meetecho for figuring this out.

提交回复
热议问题