Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Webcam image quality

Avatar

Former Community Member

Hi,

I am currently developing a video chat component for android using lccs, however, due to slow internet connectivity in my area, the webcam published is usually very laggy.

<rtc:WebCamera top="10" left="10" bottom="10" right="10" imageQuality=""/>

By just setting the imageQuality property of the WebCamera, will I be able to overcome the problem?And more importantly, what string value i can put to control the imageQuality property, is it high/low?I couldnt find the proper string value to key in, thx in advance for any advice.

Regards

2 Replies

Avatar

Former Community Member

Hi,

If you look inside the CameraModel.as class, there are various values

that you can pass through for imageQuality such as SLOW_IMAGES,

FAST_IMAGES, HIGH_BW and HIGH_QUALITY.. Default is HIGH_BW , but you can

pass through HIGH_QUALITY or others according to your need.

Another thing that may help you in getting better quality is setting the

resolutionFactor property. It's by default 1, but you can set to 5 or

something. You can't set it directly but would have to use

webcam.publisher.resolutionFactor = 5 to set it..

Try out the things and let us know if it makes a difference for you.

Thanks

Hironmay Basu

Avatar

Former Community Member

Hi,

Thx for the advice, I've actually tried setting the imageQuality in the WebCamera component,but everytime i try to run the AIR application, it will crash, if i take out the imageQuality property,everything works normally, I am building an AIR application, imageQuality is just a property of the WebCamera right? I am not sure what went wrong, please advice. Thank you.

Below is the full coding:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

   xmlns:s="library://ns.adobe.com/flex/spark"

   xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:rtc="http://ns.adobe.com/rtc" currentState="logon" fontSize="28">

<fx:Script>

[Bindable] private var roomURL:String = "https://collaboration.adobelivecycle.com/yytan1987/myfirstroom";

protected function connect():void {

auth.userName = userName.text;

currentState = "default";

session.login();

}

</fx:Script>

<s:states>

<s:State name="default"/>

<s:State name="logon"/>

</s:states>

<fx:Declarations>

<rtc:AdobeHSAuthenticator id="auth" protocol="rtmfp"/>

</fx:Declarations>

<s:TextInput id="userName" includeIn="logon" top="200" horizontalCenter="0"/>

<s:Button label="Connect" click="connect()" includeIn="logon" top="250" horizontalCenter="0" height="50" width="150"/>

<rtc:ConnectSessionContainer id="session" roomURL="{roomURL}" authenticator="{auth}" autoLogin="false" width="100%" height="100%" includeIn="default">

<rtc:WebCamera top="10" left="10" bottom="10" right="10" imageQuality="high_q" />

<rtc:AudioPublisher id="audioPub"  codec="{SoundCodec.SPEEX}" useEchoSuppression="true"/>

<rtc:AudioSubscriber/>

<mx:Button label="Audio" toggle="true" id="audioButt"

   click="(audioButt.selected) ? audioPub.publish(): audioPub.stop()"/>

<mx:Button x="103" y="0" label="Quality" toggle="true" id="audioButt1"

   click="(audioButt.selected) ? audioPub.microphoneManager.encodeQuality = 4 : audioPub.microphoneManager.encodeQuality = 6"/>

</rtc:ConnectSessionContainer>

</s:Application>

Regards,

Tan