Expand my Community achievements bar.

WebcamPublisher Capture Resolution

Avatar

Level 4

How do I set the capture resolution for the WebcamPublisher (or the camera if that's what I should be looking at).   I have my three way video conf. test code up and running but the capture resolution looks like it's very low.  I follwed the trail on the captureWidthHeightFactor setting but that didn't really lead anywhere.   I've read through the docs on compression quality and bandwidth, but I don't think that's my issue it just looks like there's a really low capture resolution.

If anyone has any advice I'd appreciate it.

Thank you,

Eric

7 Replies

Avatar

Former Community Member

Hi,

When you set captureWidthandHeightFactor, it calls invalidation and goes into updateCameraSettings() function. Isn't this the case with you ? In updateCameraSettings , based on the aspectRatio, it sets the camera mode accordingly. Please let us know if you are getting there and what's result then.

Thanks

Hironmay Basu

Avatar

Level 4

Hironmay,

            Thanks for the quick feedback.   I don't think I posed my quesiton very well.   I'm trying to set the camera capture width and height, so I get a better resolution video stream.   I don't know what captureWidthandHeightFactor actually does or what kind of values you could set it to.   In the LCCS docs it only explains it with this line: "Specifies the captureHeightWidthFactor settings for ON2 video for the webcamera."   Then for more information it asks you to look at the On2ParametersDescriptor, but that has no more information.

I see in the flash.media.camera library you can call a setMode function which sets the width and height in pixels for the camera capture area.  I tried doing that in my code before calling localWebCam.publish();   But the resolution stayed the same.   What's the correct way to change that setting when using LCCS?   Sorry if I'm missing what you're trying to tell me.

Thank you,

Eric

Avatar

Former Community Member

Hi,

I am working on something. I will get an answer in a few hours to best deal with it and set the width and the height. Btw, Are you using player 9 or player 10 swc ?

Thanks

Hironmay Basu

Avatar

Level 4

Thank you, and I'm using 10 swc in an air application (soon it will be both

a web and air application though). Let me know if there's anything I can

do or test on my end.

Thanks,

Eric

Avatar

Former Community Member

Hi Eric,

Thanks for bringing up this issue.

We agree that out description of captureWidthAndHeightFactor is not upto mark and it should have provided more insight.

I investigated through it and at this point, if you need to have a higher resolution, just set the captureWidthAndHeightFactor to a higher value, let's say 5. It can take values from 1-10 and you will see significant difference in with higher values. Though we don't allow setting of native width and height, but setting the captureWidthAndHeightFactor( you can call it as resolution factor) will do the trick for you.

We provide three types of aspect ratios (values in StreamManager class width base native width and height values) and then we multiply the values (width and height) with this factor while setting the mode of camera. In near future, we will have a better API like setResolutionFactor and make it more self-explanatory and might deprecate this API.

Here is an example of test code to set the captureWidthandheightFactor.

<rtc:AdobeHSAuthenticator id="auth" userName="hironmay_b@yahoo.com" password="hiruana80" />

<rtc:ConnectSessionContainer id="cSession" authenticator="" width="100%" height="100%" roomURL="http://connectnow.acrobat.com/cocomobasu/myfifthroom" >

<mx:HBox width="100%" height="100%">

<mx:VBox width="100%" height="100%" >

<rtc:WebcamPublisher id="webcamPub" captureWidthHeightFactor="5"/>

<rtc:WebcamSubscriber width="100%" height="100%" webcamPublisher="" />

<mx:Button label="Start" click="webcamPub.publish()"/>

</mx:VBox>

</mx:HBox>

</rtc:ConnectSessionContainer>

Hope this helps. Let us know if it works ok with you.

Thanks

Hironmay Basu

Avatar

Level 4

Yep that did the trick thank you.  The captured resolution is much better now.  I'm still having a problem with my video quality coming from windows though.   I'm not sure what I'm doing wrong, maybe the defaults are different across OSX and XP?   Or perhaps the XP machine is under powered with a bad webcam.  I did try it on a new HP laptop with similar results. 

I've attached two screen shots of my test app, one from the mac, the other from the XP machine to show what I'm talking about.  On the mac in badresmac you can see large encoding blocks, and inside those the image is heavily pixelated.   On the PC you can see the original image is much more pixelated than the OSX image.  Any idea what's causing this?

Thank you,

Eric

Here's the relevant mxml code snippet if it helps.

    <rtc:ConnectSessionContainer x="473" id="session" width="853.3334" height="570.90906" authenticator="{auth}" roomURL="{roomURL}" autoLogin="false" y="29">
    <mx:VBox width="844.1667" height="405.07574" x="0" y="141">
        <rtc:WebcamPublisher id="webCamPub" captureWidthHeightFactor="5"/>
        <rtc:WebcamSubscriber  width="800" height="600" webcamPublisher="{webCamPub}"/>   
        <rtc:AudioPublisher id="audioPub" codec="{SoundCodec.SPEEX}"/>
        <rtc:AudioSubscriber/>
    </mx:VBox>
    <rtc:Roster width="292.95456" height="133.40909" x="292.95" y="0"/>
    <mx:Button label="Audio" toggle="true" id="audioButt" click="(audioButt.selected) ? audioPub.publish() : audioPub.stop()" x="130.3" y="52.05"/>
   
</rtc:ConnectSessionContainer>

Avatar

Level 4

Never mind figured that one out, I didn't change the resolution setting on the XP client...  Sorry about that.  I do still see that large checkerboard blocking looking at the XP video on the mac but I guess I can live with that.

Thanks for the help!

Eric