问题
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