Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

WebcamPublisher : Camera

Avatar

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

Avatar

Correct answer by
Former Community Member

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

7 Replies

Avatar

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.

Avatar

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

Avatar

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)

Avatar

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

Avatar

Correct answer by
Former Community Member

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

Avatar

Level 1

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

 

yes learn this camera basic 

 

https://tecnowith.com/best-dslr-cameras-with-wifi/

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----