Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

WebcamPublisher : Camera

Nicolas_Siver
Level 2
Level 2

How to control basic Camera parameters like fps, screen size?

You propose use WebcamPublisher.resolutionFactor ?

I dont undestend how it works.

Specifies the resolution factor of captured data;

ResolutionFactor values range from 1 (lowest resolution) to 10 (highest resolution).

Resolution factor gets multiplied by the native width and height of captured camera.

We provide three native width and height values based on aspect ratios.

That width and height when multiplied with this factor, gives the resolution.

For higher resolution, use a value like 5.

You provide 3 native? values?

Let say i set 10, i have like 412 x 412. Ok. But where resolution ratio like 4:3...

About FPS. I can set fps only after event of publishing phase? Because after creating WebcamPublisher, camera getter is null.

Please advice how to control Camera with WebcamPublisher?

For now i have all streams in 1:1 ratio.

1 Accepted Solution
Nigel_Pegg
Correct answer by
Level 10
Level 10

Hi Nicolas,

I agree that this API could be easier and more useful... The good news is that you can pretty easily extend the WebcaPublisher to put whatever you'd like in. I'd override updateCameraSettings() and replace the switch statement with whatever custom width and height you'd like.

nigel

View solution in original post

0 Replies
Hinne
Level 3
Level 3

I also played arround with WebcamSubscriber options like size and I only got 1:1 ratio working too. I only changed the hights of WebcamSubscriber. the ratio should default to the publishing cam, but I dont thing this is the case. I think its publishing 1:1 and receiving 1:1.

aponnusa
Employee
Employee

Hi Nicolas,

Most of the quality settings that WebcamPublisher allows you to set are a wrapper to the flash.media.Camera api. So for more info on how to change and set quality settings, please refer - http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#setMode()

Also , you can set FPS before publishing. It gets set when your camera is instantiated, and the camera is instantiated only when you begin publishing.

Hope this is of little help to you, and I am sure the API reference link would do a better job than me

Thanks

Arun

Nicolas_Siver
Level 2
Level 2

Wrapper?

So why publisher changes resolution of stream to 1:1 aspect ratio?

With setMode I can easily reach any frame size, with resolutionFactor I always has 1:1 aspect ratio, why?

Could you share code of wrpapper? (where resolutionFactor takes his place on setMode)

aponnusa
Employee
Employee

Its the code of WebcamPublisher.as . You could find it in SDK source. YourSDKFolder/libs/player10 or player10.1/src/com/adobe/rtc/collaboration/WebcamPublisher.as

So this is code that sets camera settings












          /**


           * @private


           */


          protected function updateCameraSettings():void


          {


               if (_camera == null) {


                    return;


               }


               


               switch (_streamManager.aspectRatio) {


                    case StreamManager.AR_STANDARD:


                         //trace("#WebCamPublisher# _camera.setMode("+StreamManager.AR_STANDARD_W*_captureWidthHeightFactor+", "+StreamManager.AR_STANDARD_H*_captureWidthHeightFactor+", "+_fps+")");


                         _camera.setMode(StreamManager.AR_STANDARD_W*_captureWidthHeightFactor, StreamManager.AR_STANDARD_H*_captureWidthHeightFactor, _fps);


                         break;


                     case StreamManager.AR_PORTRAIT:


                         //trace("#WebCamPublisher# _camera.setMode("+StreamManager.AR_PORTRAIT_W*_captureWidthHeightFactor+", "+StreamManager.AR_PORTRAIT_H*_captureWidthHeightFactor+", "+_fps+")");


                         _camera.setMode(StreamManager.AR_PORTRAIT_W*_captureWidthHeightFactor, StreamManager.AR_PORTRAIT_H*_captureWidthHeightFactor, _fps);


                         break;


                    case StreamManager.AR_LANDSCAPE:


                         //trace("#WebCamPublisher# _camera.setMode("+StreamManager.AR_LANDSCAPE_W*_captureWidthHeightFactor+", "+StreamManager.AR_LANDSCAPE_H*_captureWidthHeightFactor+", "+_fps+")");


                         _camera.setMode(StreamManager.AR_LANDSCAPE_W*_captureWidthHeightFactor, StreamManager.AR_LANDSCAPE_H*_captureWidthHeightFactor, _fps);


                         break;


                }



               //trace("#WebCamPublisher# _camera.setKeyFrameInterval("+_keyFrameInterval+")");


               _camera.setKeyFrameInterval(_keyFrameInterval);


               setCameraQuality();     //will update the bw used               


          }




So when you set resolutionFactor, you set the _captureWidthHeightFactor variable in the code, and it updates the width & height of the Camera.setMode API.

Thanks

Arun

Nigel_Pegg
Correct answer by
Level 10
Level 10

Hi Nicolas,

I agree that this API could be easier and more useful... The good news is that you can pretty easily extend the WebcaPublisher to put whatever you'd like in. I'd override updateCameraSettings() and replace the switch statement with whatever custom width and height you'd like.

nigel

View solution in original post