Expand my Community achievements bar.

SOLVED

WebCamera.mxml

Avatar

Level 2

I am testing the WebCam sample that comes with the SDK.  How do you make the captured  image/video smaller?  I have tried a couple of things but nothing happens.  Is it the resolutionfactor that needs changing?

Here is part of the code:

<rtc:ConnectSessionContainer id="cSession" authenticator="{auth}" width="100%"

height="70%" roomURL="https://collaboration.adobelivecycle.com/genius123/myfirstroom" >

<mx:Panel title="Webcam" width="100%" height="100%"

       paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10" creationComplete="onCreationComplete()">

  <rtc:WebcamPublisher id="webCamPub"  width="10" height="5" resolutionFactor="5" />

<mx:VBox width="100%" height="100%" id="clickedContainer"/>

        <mx:HBox horizontalGap="10" verticalGap="15" paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10" width="100%" height="25%">

            <mx:Repeater id="rp" dataProvider="{cSession.userManager.userCollection}" width="100%" height="100%" >

           <mx:VBox width="100%" height="15%" horizontalAlign="center" horizontalGap="5">

          <rtc:WebcamSubscriber webcamPublisher="{webCamPub}" width="100%" height="100%" publisherIDs="{[(rp.currentItem as UserDescriptor).userID]}" click="onClick(event)" userBooted="onBooted(event)" streamChange="onCameraPause(event)" />

           <mx:Button  label="Start"  click="onBtnClick(event)"  visible="{(rp.currentItem as UserDescriptor).userID==cSession.userManager.myUserID}" />

           </mx:VBox>

            </mx:Repeater> 

        </mx:HBox>

    </mx:Panel>

</rtc:ConnectSessionContainer>

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi ,

Normally, If you want to make the captured image/video bigger, you need to increase the resolutionFactor. The resolutionFactor gets multiplied with the default width and height ( the width and height is dependant on the aspect ratio value , the default is standard i.e. 128 X 128 ). The default value of resolutionFactor is 1. So, the captured image by default is 128 X 128. Now, since resolutionFactor is an integer and its already 1, you won't be able to lower it but you can only increase it.

So, to lower you can link your project to the source provided and change the updateCameraSettings function in WebcamPublisher to set the desired width and height you want. A look at this function will make things more clear too as this function sets the captured width and height values.

Or you can also lower the Standard aspect ratio values in StreamManager( currently it's 128). If you do not want to link project to the source, you would have to subclass WebcamPublisher and override the updateCameraSettings function in it.

We have never faced an use case before whereby user had to lower the captured image even from 128 , so we kept the factor as an int. However, in future, we might think of doing it as number to give users greater flexibility.

And as far as the display on the subscriber side is concerned, you need to change the width/height of WebcamSubscriber or WebCamera component depending on whatever you are using.

Hope this helps

Thanks

Hironmay Basu

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Hi ,

Normally, If you want to make the captured image/video bigger, you need to increase the resolutionFactor. The resolutionFactor gets multiplied with the default width and height ( the width and height is dependant on the aspect ratio value , the default is standard i.e. 128 X 128 ). The default value of resolutionFactor is 1. So, the captured image by default is 128 X 128. Now, since resolutionFactor is an integer and its already 1, you won't be able to lower it but you can only increase it.

So, to lower you can link your project to the source provided and change the updateCameraSettings function in WebcamPublisher to set the desired width and height you want. A look at this function will make things more clear too as this function sets the captured width and height values.

Or you can also lower the Standard aspect ratio values in StreamManager( currently it's 128). If you do not want to link project to the source, you would have to subclass WebcamPublisher and override the updateCameraSettings function in it.

We have never faced an use case before whereby user had to lower the captured image even from 128 , so we kept the factor as an int. However, in future, we might think of doing it as number to give users greater flexibility.

And as far as the display on the subscriber side is concerned, you need to change the width/height of WebcamSubscriber or WebCamera component depending on whatever you are using.

Hope this helps

Thanks

Hironmay Basu

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] ----