11/6/2022 0 Comments How to change video codec![]() ![]() Thus, some companies choose not to pay and do not support them. #How to change video codec license#The reason for this is that those audio codecs have patents and a commercial license must be paid in order to decode them. Let codecs = RTCRtpReceiver.getCapabilities('video').codecs Ĭode adapted from this Pericror blog post to force audio/video codecs.Many devices do not support videos with AC3 or DTS audio, among other codecs. In other words, the video is played but with no sound. Or for video you can fix the codec to vp9: // note the following should be called before before calling either RTCPeerConnection.createOffer() or createAnswer() currently not all browsers support setCodecPreferences iterate over supported codecs and pull out the codecs we want Let codecs = RTCRtpReceiver.getCapabilities('audio').codecs For example if you want to prefer opus for audio you can check for the "audio/opus" mimetype and set your codec preferences to opus codecs: let tcvr = pc.getTransceivers() Not just chrome.Īs browsers start to support setCodecPreferences, you can check for the mimetype of the codec you want to use by default to set the codec preference. This will work with any appropriately coded WebRTC system, i.e.Just make sure to add the payload and the appropriate mappings and options( fmtp is needed for h264 as profiles are important and possibly sprop-parameter-sets). This type of idea will work for ADDING codecs that you know are supported by the underlaying systems(H264, SPEEX, etc.). ![]() ![]() ![]() The SDP I am talking about is the one generated and passed through the success callback of the createOffer and createAnswer functions of the peerconnection.If you set that modified sdp locally and send it to your peer(and if they SUPPORT PCMA.does not have to be default for them as the negotiation will force PCMA if you only offer it), then PCMA will be your audio codec and not OPUS. any a=rtpmap: where the next character is NOT an 8. Then you need to remove all the rtpmap lines that do not correspond with that payload, i.e. M=audio 49353 RTP/SAVPF 8 this way only the PCMA payload is considered. If you wanted to ONLY use PCMA, you would change the m=audio line to the following: I have tested successfully forcing Chrome to send PCMA instead of OPUS by default. To use any of these codecs as default, you must modify your SDP before setting it locally in your peerconnection and sending your offer/answer. For Video you have VP8(also H264 on some systems with FireFox). Right now, audio wise, the only supported codecs are PCMA, PCMU, ISAC, and OPUS(the default). Yes, you can change the codec to be anything you want.as long as Chrome supports it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |