WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

Change codec ?

Open Parilar opened this issue 8 years ago • 5 comments

Hello, is there any way to change the Audio codec to a smaller one for bad internet connections ?

Parilar avatar Nov 20 '17 14:11 Parilar

Hello. Take a look at this method for changing preffered video codec: https://chromium.googlesource.com/external/webrtc/+/branch-heads/61/webrtc/examples/objc/AppRTCMobile/ARDSDPUtils.m It shouldn't be hard to implement the same for audio. The point is that you need to change the codec priority in the m=audio line in your SDP.

AlexKMDev avatar Nov 21 '17 01:11 AlexKMDev

That's help Thanks. Could you also help me with the codec ? Or where can i get Infos about the codec ?

Got these lines but dont know how to interpret m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126

escriptionForDescription:(RTCSessionDescription *)description| preferredVideoCodec:(NSString *)codec {

how does the codec look ?

Thanks

Parilar avatar Nov 21 '17 17:11 Parilar

They should be below with those numbers after UDP/TLS/RTP/SAVPF that represent their id's in order of priority.

https://webrtchacks.com/sdp-anatomy/ Codec Parameters section below Audio Lines.

AlexKMDev avatar Nov 21 '17 18:11 AlexKMDev

Thanks for the help, i think now i understood how it works. I just have to change the m=audio line

m=audio 9 UDP/TLS/RTP/SAVPF 9 111 103 104 102 0 8 106 105 13 110 112 113 126

moving the 9 (a=rtpmap:9 G722/8000) to the front will improve my speed (When my thoughts are correct)

Parilar avatar Nov 21 '17 21:11 Parilar

Yeah, that's correct.

AlexKMDev avatar Nov 21 '17 21:11 AlexKMDev