I’ve working on webrtc with H264 Codec for video and ALaw Codec for audio from my camera (as a peer). With H264 and ALaw Codec, my browser (google chrome) and my camera can handshake together and work well. But when I switch from H264 to H265 Codec (audio still ALaw), my browser (google chrome) can be handshake to my camera. It’s has occurs the error message:
Uncaught (in promise) DOMException: Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to set local answer sdp: Failed to apply the description for m= section with mid='audio': Failed to setup RTCP mux.
Does any example about stream video with H265 Codec on browser ??
Thank you so much for helping.
I’m using libdatachannel example streamer:
https://github.com/paullouisageneau/libdatachannel/tree/master/examples/streamer
Code I modify from H264 to H265 in function addVideo()
auto video = Description::Video(cname, Description::Direction::SendOnly);
video.addH265Codec(110);
video.addSSRC(ssrc, cname, msid, cname);
auto track = pc->addTrack(video);
// create RTP configuration
auto rtpConfig = make_shared<RtpPacketizationConfig>(ssrc, cname, payloadType, H265RtpPacketizer::defaultClockRate);
// create packetizer
auto packetizer = make_shared<H265RtpPacketizer>(NalUnit::Separator::LongStartSequence, rtpConfig);
// add RTCP SR handler
auto srReporter = make_shared<RtcpSrReporter>(rtpConfig);
packetizer->addToChain(srReporter);
// add RTCP NACK handler
auto nackResponder = make_shared<RtcpNackResponder>();
packetizer->addToChain(nackResponder);
// set handler
track->setMediaHandler(packetizer);
track->onOpen(onOpen);
auto trackData = make_shared<ClientTrackData>(track, srReporter);
return trackData;
HÙNG PHẠM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.