how to enable h264 in peerconnection?

情到浓时终转凉″ 提交于 2020-05-27 03:58:49

问题


many media says firefox support h264 in webrtc, but I can't find any information.

How to enable h264 in webrtc?

This is my mediaConstraints

var mediaConstraints = {
    video: {
        mandatory: {
           maxWidth: 640,
           maxHeight: 480
        }
    },
    audio: true
};

回答1:


It would seem that H264 is not supported by default yet. You will have to add the codec line manually into the SDP before setting it as local and sending the offer. It does look like they are hard at work to get it out soon. You can see this with the work that jesup is doing within their meetings April 22 and April 29

So, it is not added by default but you can add a line to your created SDP to add it as a supported codec.

Just make sure you are using the nightly version and not just the release version of Firefox to make sure you are getting the latest h264 patches and work.




回答2:


As of right now I tested on Firefox 36.0.4 and I can see h264 lines in the SDP. An Example of what I see that indicates the support for H264:

....
m=video 9 RTP/SAVPF 120 126 97
....
a=rtpmap:97 H264/90000
....

97 is the dynamic payload type, used here for H264. I hope it helps.



来源:https://stackoverflow.com/questions/23625461/how-to-enable-h264-in-peerconnection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!