Le jeudi 18 juin 2015 04:36:42 UTC+2, Andreas Pehrson a écrit :
> I'm guessing this happens because in the default case
> generateMediaConstraints() returns {video:true,audio:true} but when you're
> fiddling with resolution and frame rate you're omitting the audio property.
>
> *Andreas Pehrson *--- Software Engineer
>
> (+47) 959 60 374 | [email protected] |
> www.telenordigital.com
>
> On Tue, Jun 16, 2015 at 3:00 PM, <[email protected]> wrote:
>
> > Hi,
> >
> > I'm an intern of a well-known telecommunication french operator.
> > The subject of my intership is evaluating the WebRTC technology's
> > performances through google Chrome and Mozilla Firefox.
> > First I studied how work this technology with Firefox Hello, to understand
> > what is WebRTC, how it works, how media-stream are exchanged etc.
> >
> > Then I started to work with the website https://apprtc.appspot.com/ On
> > chrome and Firefox, to compare the behavior of every brower through the
> > same webRTC app. Till now everything was good except the fact that I didn't
> > master content injection (video resolution), the A/V bitrate and A/V
> > encoders. 'caus as you know it, the video bitrate is blocked around
> > 2Mb/sec. And we would like to see if it's possible to unleash the video
> > bitrate to have a better quality and by using another less greedy encoder
> > (VP8 ? H.264?)
> >
> > A formation was given to my colleagues to develop their own WebRTC app
> > using javascript language. It allows us to manage all parameters of a
> > WebRTC communication (media constraints etc.). So now I can inject 1080p
> > content into the communication, unleash the bitrate, manage the displayed
> > resolution. Just to specify, I used Chrome first.
> > Anytime I modify the content of the SDP packet to manage de max bitrate :
> >
> > localSDP.sdp = localSDP.sdp.replace( /a=mid:video\r\n/g ,
> > 'a=mid:video\r\nb=AS:4000\r\n');
> >
> > So I could therefore make my own tests without any problems on Chrome. But
> > I have to compare my results with another A/V encoder for subjectives tests.
> > On Mozilla Firefox, the H.264 encoder works, even if it's not selected by
> > default into a WebRTC communication (using Firefox Hello or apprtc). So I
> > modify the content of the SDP packet to force the choice of the A/V encoder
> > (replacing VP8 with H.264):
> >
> > localSDP.sdp = localSDP.sdp.replace( / 120 126 /g,' 126 ');
> >
> > I can do the same thing to replace the opus encoder with the G.722 encoder.
> > If forcing A/V encoders works without problems, the media-stream parts are
> > giving me headaches. In fact, if I inject 1080p content (with Firefox
> > obviously) during a WebRTC app, the resolution in return has been
> > downscaled to 640x480. And it doesn't depends on the resolution injected,
> > even if the source resolution is smaller than 640x480, what I see in output
> > is 640x480. But if I modify the displayed resolution, it's good in output
> > but I lose the audio stream. As a matter of fact, till i try to modify the
> > resolution, when the communication begin, the browser doesn't ask me to
> > share the microphone.
> >
> > To explain a bit more how work the app I use, i give you some sourcecode
> > (not all because i didn't develop it, so I can't share all the code) :
> >
> > var mediaConstraints = {video:true,audio:true};
> > [...]
> > mediaConstraints = generateMediaConstraints();
> > [...]
> > function generateMediaConstraints(){
> > if (replaceResolution == true && replaceFPS == true &&
> > replaceRatio == true){
> > return {
> > video: {
> > mandatory: {
> > maxWidth: userMaxWidht.value,
> > maxHeight: userMaxHeight.value,
> > minWidth: userMinWidht.value,
> > minHeight: userMinHeight.value,
> >
> > maxAspectRatio: userRatio.value,
> >
> > minAspectRatio: userRatio.value,
> >
> > minFrameRate: userFPS.value,
> >
> > maxFrameRate: userFPS.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == true && replaceFPS == true &&
> > replaceRatio == false){
> > return {
> > video: {
> > mandatory: {
> > maxWidth: userMaxWidht.value,
> > maxHeight: userMaxHeight.value,
> > minWidth: userMinWidht.value,
> > minHeight: userMinHeight.value,
> >
> > minFrameRate: userFPS.value,
> >
> > maxFrameRate: userFPS.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == true && replaceFPS == false &&
> > replaceRatio == true){
> > return {
> > video: {
> > mandatory: {
> > maxWidth: userMaxWidht.value,
> > maxHeight: userMaxHeight.value,
> > minWidth: userMinWidht.value,
> > minHeight: userMinHeight.value,
> >
> > maxAspectRatio: userRatio.value,
> >
> > minAspectRatio: userRatio.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == true && replaceFPS == false &&
> > replaceRatio == false){
> > return {
> > video: {
> > mandatory: {
> > maxWidth: userMaxWidht.value,
> > maxHeight: userMaxHeight.value,
> > minWidth: userMinWidht.value,
> > minHeight: userMinHeight.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == false && replaceFPS == true &&
> > replaceRatio == true){
> > return {
> > video: {
> > mandatory: {
> >
> > maxAspectRatio: userRatio.value,
> >
> > minAspectRatio: userRatio.value,
> >
> > minFrameRate: userFPS.value,
> >
> > maxFrameRate: userFPS.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == false && replaceFPS == true &&
> > replaceRatio == false){
> > return {
> > video: {
> > mandatory: {
> >
> > minFrameRate: userFPS.value,
> >
> > maxFrameRate: userFPS.value
> > }
> > }
> > };
> > }
> > else if(replaceResolution == false && replaceFPS == false &&
> > replaceRatio == true){
> > return {
> > video: {
> > mandatory: {
> >
> > maxAspectRatio: userRatio.value,
> >
> > minAspectRatio: userRatio.value
> > }
> > }
> > };
> > }
> > else{
> > return {video:true,audio:true}
> > }
> > }
> >
> > I tried to put the audio variable into one of the subconditions' function,
> > ie :
> > else if(replaceResolution == true && replaceFPS == false && replaceRatio
> > == false){...}
> >
> > It works because the audio stream work, but I can't manage the resolution
> > anymore. I don't underderstand why and how.
> > Colleagues who développed this app left the compagny. I'm a really ban
> > developper (well, I'm not a dev). I'm blocked on this f****** since one
> > week. I don't see what to do.
> > Could you please help me to fix that ? maybe give me the solution I dunno.
> >
> > Thanks in advance.
> > _______________________________________________
> > dev-media mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-media
> >
I erased the default returns value "{video:true,audio:true}" and put the audio
property in any sub-conditions of the function. Now it works. But like I said,
when the audio work, I can't fiddling with resolution. That's what I don't
understand.
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media