Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I want to have a method at the end that can set VP9 or H.264 as preferred video codec in a SDP.
So I am looking for the m line in my SDP:
m=video 9 UDP/TLS/RTP/SAVPF 96 98 100 102 127 97 99 101 125
Console log of my SDP:
In this case I would get and use VP8 (96) as video codec instead of VP9 (98). So I want to check if 98/VP9 is possible/available and want to set it at the beginning/first position to actually use it.
What I got so far:
if(sdpOrigin == 'local') { let lines = sdp.split('\n').map(l => l.trim()); lines.forEach(function(line) { if (line.indexOf('m=video') === 0) { let parts = line.substr(28); // Should be avoided! let vp9_order = parts.indexOf("98"); let array = parts.split(/\s+/); console.log("array", array); // 96 98 100 102 127 97 99 101 125 if (vp9_order > 0) { array.splice(vp9_order, 1); array.unshift("98"); } console.log("array-new", array); // 98 96 100 102 127 97 99 101 125 // How do I update my SDP now with the new codec order? } }) }
This approach is bad in my opinion, because I get my desired m line but I do a fix substring at the position '28', so it will break if something before changes.
At the end I should have the following "m line" in my SDP:
m=video 9 UDP/TLS/RTP/SAVPF 98 96 100 102 127 97 99 101 125
Can somebody help me with that?
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.