Video Chat on Android very slow !

Hi everyone,
I'm developing an audio/video chat Android application. On my Android device (Samsung Galaxy S), all works... but it is very very slow !!
I launch the application (release version) on my phone and then I launch this application from my computer (from Flash Builder)
Each applications are connected to the Cirrus server and streams are sent/received. On my computer, no problem. But on my phone, the CPU usage grows immediatly (>90 % !) and the app finish to crash.
Before I click on the "connect" button : RAM 26 mb / CPU 0.33% (great !)
When I publish my audio/video via NetStream : RAM 42 mb / CPU 64%
When I publish AND receive an audio/video NetStream : RAM 48 mb / CPU 94%
By the way, my phone is getting hot...
I know that this could be done without such performance problems on Android. The proof : http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/
Yes, LCCS is use here by C. Coenraets, but LCCS is nothing but a NetConnection/NetStream and a RTMFP solution... So what am i doing wrong ? Any help would be very appreciated.
I paste here the code (firstView of the ViewNavigatorApplication) :
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" xmlns:mx="library://ns.adobe.com/flex/mx" actionBarVisible="false">
          <fx:Script>
                    <![CDATA[
                               * Tezqa | [email protected] | www.tezqa.com
                              private var SERVER:String = "rtmfp://p2p.rtmfp.net/";
                              private var KEY:String = "CIRRUS DEVELOPER KEY";
                              private var netConnection:NetConnection;
                              private var netStreamPublisher:NetStream;
                              private var netStreamSubscriber:NetStream;
                              private var groupSpecifier:GroupSpecifier;
                              private var camera:Camera;
                              private var microphone:Microphone;
                              private var videoPublisher:Video;
                              private var videoSubscriber:Video;
                              private var username:String;
                              private var budyname:String;
                              [Bindable] private var connected:Boolean = false;
                              private function startStop():void {
                                        if (connected) {
                                                  disconnect();
                                        } else {
                                                  username = usernameInput.text;
                                                  budyname = budynameInput.text;
                                                  connect();
                              private function connect():void {
                                        netConnection = new NetConnection();
                                        netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
                                        netConnection.connect (SERVER, KEY);
                              private function onConnect():void {
                                        connected = true;
                                        groupSpecifier = new GroupSpecifier ("com.tezqa.mobilecam");
                                        groupSpecifier.multicastEnabled = true;
                                        groupSpecifier.postingEnabled = true;
                                        groupSpecifier.serverChannelEnabled = true;
                                        netStreamPublisher = new NetStream (netConnection, groupSpecifier.groupspecWithAuthorizations());
                                        netStreamPublisher.addEventListener (NetStatusEvent.NET_STATUS, netStatus);
                                        attachCamera();
                                        attachMicrophone();
                                        netStreamPublisher.publish ("stream_" + username, "live");
                                        videoPublisher = new Video(uic1.width, uic1.height);
                                        videoPublisher.attachCamera(camera);
                                        uic1.addChild(videoPublisher);
                                        netStreamSubscriber = new NetStream (netConnection, groupSpecifier.groupspecWithAuthorizations());
                                        netStreamSubscriber.addEventListener (NetStatusEvent.NET_STATUS, netStatus);
                                        netStreamSubscriber.play ("stream_" + budyname);
                                        videoSubscriber = new Video(uic2.width, uic2.height);
                                        videoSubscriber.attachNetStream(netStreamSubscriber);
                                        uic2.addChild(videoSubscriber);
                              public function attachMicrophone():void {
                                        microphone = null;
                                        netStreamPublisher.attachAudio (null);
                                        microphone = Microphone.getEnhancedMicrophone();
                                        if (!microphone) microphone = Microphone.getMicrophone();
                                        if (microphone) {
                                                  microphone.codec = SoundCodec.SPEEX;
                                                  microphone.framesPerPacket = 1;
                                                  microphone.setSilenceLevel(0, 3000);
                                                  microphone.gain = 100;
                                                  microphone.rate = 22;
                                                  netStreamPublisher.attachAudio (microphone);
                              public function detachMicrophone():void {
                                        netStreamPublisher.attachAudio (null);
                                        microphone = null;
                              public function attachCamera(cameraPosition:String = "auto"):Camera {
                                        camera = null;
                                        netStreamPublisher.attachCamera(null);
                                        if (cameraPosition == "auto") {
                                                  camera = Camera.getCamera();
                                        } else {
                                                  if (Camera.names.length == 1) {
                                                            camera = Camera.getCamera();
                                                  } else {
                                                            var tmpCamera:Camera = null;
                                                            for (var i:uint = 0; i < Camera.names.length; i++) {
                                                                      tmpCamera = Camera.getCamera(Camera.names[i]);
                                                                      if (tmpCamera.position == cameraPosition) {
                                                                                camera = tmpCamera;
                                                                                break;
                                        if (camera) {
                                                  camera.setMode (640, 480, 15, true);
                                                  camera.setQuality (15000, 0); // 30000, 0 (adobe settings)
                                                  netStreamPublisher.attachCamera (camera);
                                                  return camera;
                                        } else {
                                                  return null;
                              public function detachCamera():void {
                                        netStreamPublisher.attachCamera (null);
                                        camera = null;
                              private function disconnect():void {
                                        detachCamera();
                                        detachMicrophone();
                                        netStreamPublisher.close();
                                        netStreamSubscriber.close();
                                        netStreamPublisher.removeEventListener(NetStatusEvent.NET_STATUS, netStatus);
                                        netStreamSubscriber.removeEventListener(NetStatusEvent.NET_STATUS, netStatus);
                                        netConnection.removeEventListener(NetStatusEvent.NET_STATUS, netStatus);
                                        netStreamPublisher = null;
                                        netStreamSubscriber = null;
                                        netConnection = null;
                                        videoPublisher.clear();
                                        videoPublisher.attachCamera(null);
                                        videoSubscriber.clear();
                                        uic1.removeChild(videoPublisher);
                                        uic2.removeChild(videoSubscriber);
                                        videoPublisher = null;
                                        videoSubscriber = null;
                                        connected = false;
                              private function netStatus(e:NetStatusEvent):void {
                                        switch(e.info.code) {
                                                  case "NetConnection.Connect.Success":
                                                            onConnect();
                                                            break;
                                                  default:
                                                            break;
                    ]]>
          </fx:Script>
          <s:VGroup width="100%" height="100%">
                    <s:HGroup width="100%" height="100%">
                              <mx:UIComponent id="uic1" width="50%" height="100%"/>
                              <mx:UIComponent id="uic2" width="50%" height="100%"/>
                    </s:HGroup>
                    <s:Label text="Connected : {connected}" paddingLeft="10"/>
                    <s:HGroup width="100%" horizontalAlign="center" verticalAlign="middle" paddingBottom="10">
                              <s:TextInput id="usernameInput" prompt="Enter your name" text="lug" width="35%"/>
                              <s:TextInput id="budynameInput" prompt="Enter budy name" text="kat" width="35%"/>
                              <s:Button label="{connected?'Disconnect':'Connect'}" click="startStop()"/>
                    </s:HGroup>
          </s:VGroup>
</s:View>

Ok my microphone and camera settings were bad.
I comment out these lines :
                                                  microphone.codec = SoundCodec.SPEEX;
                                                  microphone.framesPerPacket = 1;
                                                  microphone.setSilenceLevel(0, 3000);
                                                  microphone.gain = 100;
                                                  microphone.rate = 22;
//camera.setMode (640, 480, 15, true);
                                                  //camera.setQuality (15000, 0); // 30000, 0 (adobe settings)
Then the application works better, but still use CPU at 80-90% after a while... And finish to crash. Any idea ?

Similar Messages

  • Playing video on eMac is very slow.

    Hi I have an eMac 700mhz with 640mb of SD Ram running Mac OS X 10.3.9 and video is very slow but weirdly videos on YouTube play fine and are not choppy or slow at all.
    I have the latest version of flash that will run on this OS : Adobe Flash Player 9.
    Any suggestions ?
    Thanks

    Follow Dale's advice first to run Repair Disk; if there are any disk directory issues, other fixes will just be wasting time until the underlying directory problems are fixed.
    Other things to consider: how much free space is there on the hard drive? Unix-based operating systems, which includes OS X, require disk space for scratch and swap files; burning optical discs requires enough space for creation of a temporary file as large as the physical disc being burned; and other programs may have their own cache requirements. If free space on the boot hard drive runs below 1 GB, the computer will begin to behave poorly can can potentially end up unable to boot. Deleting unused data and files (old .dmg images used to install old programs are a prime candidate for deleting) will help. If space is really tight, get an external Firewire hard drive and move user data there:
    iTunes: Moving your iTunes Music folder
    iPhoto: How to move the iPhoto Library Folder
    If you normally shut down an OS X Mac overnight or leave it in system sleep, the cron maintenance tasks cannot run in their nominal 3 am timeframe. (Display-only sleep allows the maintenance tasks to run). Tiger 10.4.2 and later will (nominally) force the maintenance tasks to run after sufficient time has elapsed, although the timing on that is subject to dispute. You can leave the Mac in display-only sleep a weekend or two a month; you can manually Force Background Maintenance; or you can use a third-party utility such as OnyX to run the maintenance. Note that any system utility you use must be compatible with the OS version (e.g., use the Tiger version of OnyX with 10.4.x).

  • Videos skip and are very slow when I play them in anything other than fulls

    When I try to play a video it is ok when it is in the small box in the corner but when i double click and get the video larger it skips alot and play very slow, but when I make the video full screen it play normally. How can I play the video in the mid size box in the right way.

    Crop...
    I'm having the same problem (iTunes 11.02!) .
    I think this one isn't resolved because it IS rare: I've had iTunes on about 7 different machines (Mac and PC) since it begain (2001). In fact I maintain the same library without issues for over 10 years. Anyway this is the first time it's occurred (in my case it's happened on a pretty recent Mac Laptop). But as you may have discovered, google/bing searches for similar problems yeild VERY few results.
    A guy at the Apple store was able to temporarily fix by doing some low level cache removal, that may give a glimpse to the reason, but is not a permanent fix.
    I'm going to try a few things will report back if I have any luck**.
    ***If anyone else want to give it a try: Before starting bookmark the following: http://support.apple.com/kb/HT1391 this describes the location and purpose of most of the iTunes library files. And, any apple support docs on creating a  new iTunes library... I'm unwilling to try the let iTunes "Keep iTunes Media folder organized " cause I have my own organization method.

  • Recording video of Skype video chat. Android. Rooted (newb)

    For CPS court I desperately need to record the video chats I have with my children. Any help is welcome.

    For CPS court I desperately need to record the video chats I have with my children. Any help is welcome.

  • Very Slow Video that Does Not Fully Load on Macbook Pro

    Hi,
    I have a macbook pro from 2007 (Mac OS X 10.4.11) and I have never had any issues with streaming video until yesterday. I have fast internet, and I can browse quickly, but my video is recently being very slow and won't fully load. It always says 14 out of 16 things loaded or some other number when I try to play a video. I have tried resetting Safari and emptying my cache to speed it up several times with no luck. I have Safari 4.1.2. I am wondering what I need to do to get this fixed as soon as possible because there are some important videos I need to watch for classes.
    Thanks so much for your help!

    !http://i46.tinypic.com/2nvn6f.gif!
    "I have tried resetting Safari and emptying my cache to speed it up several times with no luck. I have Safari 4.1.2."
    Do you have the same problem w/streaming videos using other browsers? Suggest that you re-post over in the Safari for Mac forums as your problem is not MBP related but rather software.
    !http://i50.tinypic.com/izvwo1.gif!

  • Youtube very slow...

    Since I went from normal dsl to a dry loop dsl a couple of weeks ago, youtube videos have been running very slow. It stops to buffer every 5 seconds... I did not change anything on my side. Any ideas what is going on? It is getting very annoying.

    I dont think its you, I'm pretty sure its youtube's servers, they seemed to have slowed down quite a bit these past few days, but I assure you that it is not your internet.

  • Video is running in vry slow motion in win 8

    hi  everyone
               I have got a very peculiar problem in my hp G60-531Ca laptop,initally its OS was win 7, I formatted this and  installed win 8 soon after I found   video is running
    in very slow motion  without  sound  I tried my best by updating  video and audio drivers
         thanks in anticipation

    I am sorry to hear you are having issues, but this is the System Centre Mobile Device Manager forum. Please post on the appropriate forum for further help.
    Kind Regards
    Wayne Phillips

  • Is video chat possible?

    I read an article that mentioned video chat would be possible through Google Talk using OS 2.3.3 which I just downloaded, however I can't find a way to do it.  Any suggestions would be great. 

    The Incredible hasnt been reported to be a supported device for Google Video Chat option but it has been known to still work but it seems to be unconsistant..  I use Tango on my Thunderbolt without issues...
    https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/voice/using-google-voice-on-a-mobile-device/BpJb-ubhcHA
    http://www.geek.com/articles/mobile/google-bringing-video-chat-to-android-smartphones-and-tablet-2011052/

  • HT204266 my facebook application downloads pictures and videos very slow.Pictures are blurred as well.what to do.

    My facebook app on Ipad downloads pictures and videos very slow. a few of the pics are also blurred.What to do?

    Hi Skye_Starkey,
    Im sorry to hear that you are having issues with your internet service. I know this can be very frustrating and I apologise for the inconvenience.
    You can check to see if there is an outage in your area by entering your postcode and suburb in our service status checker: http://servicestatus.telstra.com/servicestatus/goc.do?q=summary.html
    Please powercycle your modem and computer: Unplug from power > Leave off for 10 - 15 mins > then Plug back in and re start. This will often force a line update through to your modem advising the signal is restored.
    Please make sure you have not exceeded you monthly usage allowance and have been shaped (slowed). You can do this via My Account http://tel.st/cpyn 
    Here are some other DIY support tools you can try. 
    Is your ADSL service running as fast as it could be?
    http://crowdsupport.telstra.com.au/t5/Coverage-Network-KB/Is-your-ADSL-service-running-as-fast-as-it-could-be/ta-p/311953
    How to test your speed
    http://crowdsupport.telstra.com.au/t5/Home-Broadband-KB/Testing-your-broadband-speed/ta-p/278139
    Make sure your modem settings are correct
    http://crowdsupport.telstra.com.au/t5/Modems-Hardware-KB/BigPond-Modem-settings/ta-p/251263
    ADSL Self service tool:
    https://www.telstra.com.au/webforms/cares/
    Change your line profile:
    http://crowdsupport.telstra.com.au/t5/General-Internet-KB/Change-your-ADSL-Line-profile/ta-p/110182
    How to peform an Isolation test:
    http://crowdsupport.telstra.com.au/t5/General-Internet-KB/How-to-perform-an-Isolation-Test/ta-p/55014
    ADSL Troubleshooting tips
    https://go.telstra.com.au/helpandsupport/-/adsl-troubleshooting-tips
    If you try all the steps in these articles and have no luck with your connection, Please speak to our Technical support team. You can contact them 
    on 133933 or you can also contact them via our Live chat service here: http://tel.st/49kl
    Regards - Tom
     

  • Rotate the front camera in Android for video chat app

    Hi,
      I developing a video chat app on Android with Adobe AIR 3.6 beta.
    I currently using the Camera, Microsphone and Video classes. I panning to use StageVideo next
    I understand fully that Adobe has stated that when using the Camera do it in Landscape mode.
    Problem is my compnay wants it in Portrait mode only and is not interested in landscape video chatting app at all!
    I can do this in native Java code with 6 lines of code by rotateing the camera,
    but it seems impossible on Adobe Air mobile.
    What I tried
    a) Rotate the display object contain the video which has my camera attached
    Result: It works! It only solves half my problem as the video is still being transmitted  in landscape mode
    b) Using Matrix and transform
    Result. Does not work correctly and does not help as the video is still being transmitted in landscape mode
    What I am considering
    a) Build an ActionScript Extension that calls native java code that rotates the camera
    Boy is this really nessscary?
    b) Create another Netstream and copy the video stream contains the landscape vidoe feed into an bytearray and then
    transpose the array and feed it into a newly created Portrit video feed!
    Is this evan technically possible?
    I understand peope will say that just accept landscape but that not an option right now
    Any hep is greatly appreciated. I cannot be the first engineer that wants a Portriat locked video chatting appp on Android using Adobe AIR

    I ran into this very same problem building a video conf app that could rotate in any direction on the device.
    I ended up doing what you tried for A, but took it a little further. I injected information into the stream I was sending so I would know what to do on the other side.... information including not only the oriention of the video, but orientation of the device as well as the Microphone activity level. (because i needed to know everyones mic levels on all devices).
    Yes this is a workaround but at least it's a solution.
    something like this....
    netsream.send("onActivity", {micActivity:this._microphone.activityLevel});

  • Live Cam Voice on HP DV8305 -- Video image very slow

    I installed Live! Cam Voice on my HP DV8305 succussfully, it works, but the video image is very slow. it needs about 30sec to capture a frame, sometime just stucked. I changed the Display Adaptive Driver, used differrent USB IF, checked my CPU and Memery usage, my HD space, use differrent IM -- skype, MSN, .... Any one can help?

    As further information, the issue seems to be with the exposure setting. When I turn auto exposure off, then set exposure down as low as it will go, the picture darkens, but the frame rate goes up. I don't have this problem with my Logitech QuickCam Orbit -- I'm not sure if the problem is with the firmware, or if the CMOS sensor in the Live! Cam Voice is just smaller.

  • My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Help!

    My iphone 3g is getting really slow. I done full restore ,deleted most apps . Not many photos in my album. i have no videos on my iphone. When taking photo with my iphone it takes ages for camera to open up. Very slow to take photo. Any suggestions? Please help !!!!

    Thank you very much for your reply gdgmacguy :) I did all you suggested apart from restore as new device . Didn't know I could do that . After restore I did restore from back up only,  as I didn't want to end up without contacts details on my phone. If I restore as new device how do I get my all contacts? Still will have to use back up? Sorry if it sounds like I don't know what i am doing, i just have no one to ask who would know. Thank you

  • Oracle ADF Mobile application is very slow in Android

    Hi
    I am new to oracle ADF.
    When I tried to deploy an application in an android device it takes a lot of time to deploy as well as every button click in the application takes more time to load. Is there any way to speed up the deployment process ?

    And this one as well
    ADF Mobile: Android performance is very slow - when will this be fixed?

  • Error in Video Chat app in Android

    Hi all,
    I am trying to build Video Chat application for android in flex 4.5 using  LiveCycle Collaboration Services. I have created new flex mobile application and used following code in mxml file:
    <?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:cs="http://ns.adobe.com/rtc" currentState="logon" fontSize="28">
        <fx:Script>
            [Bindable] private var roomURL:String = "https://collaboration.adobelivecycle.com/newjignesh/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>
    <cs:AdobeHSAuthenticator id="auth"/>
    </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"/>
    <cs:ConnectSessionContainer id="session" roomURL="{roomURL}" authenticator="{auth}" autoLogin="false" width="100%" height="100%" includeIn="default">
    <cs:WebCamera top="10" left="10" bottom="10" right="10"/>
    </cs:ConnectSessionContainer>
    </s:Application>
    I have also added lccs.swf and source folder. I was not able to compile the code due to error:
    'ConnectSessionContainer' declaration must be contained within the <Declarations> tag, since it is not assignable to the default property's element type 'mx.core.IVisualElement'.
    Can anybody please suggest why I am getting this error.

    Hi,
    Actually that much of the log is akin to telling a motor mechanic "It goes Clunk"
    Can you copy the Log from Users/(your account)/Library/Logs and post most of it.
    stop at the line that says "Binary Images for iChat" as the bits below that are not useful at this stage.
    If it says Error 8 in the top paragraph it could be that ports or your LAN needs sorting out.
    Knowing what routing devices you are using (Makes and models) and what you have done to set them up would also be helpful.
    9:07 PM Tuesday; August 12, 2008

  • Everytime I get on a video chat i can here the person very well but they can't here me what can I do to fix this I have droped my iPod in water and also droped it and cracked it but it still works fine what should i do. Please respond ASAP!!!!!!!!

    Everytime I get on a video chat  I can here the person I'm chating with but they can't here me at all . Now I have droped it in water and my ceral and I have droped it in the street . But it's still working fine but running a little slow too. What can i do resond ASAP!!!!!!!!!

    Have you tried here:
    iOS: Not responding or does not turn on
    You can check your warranty coverage by entering the SN here:
    Apple - Support - Check Your Service and Support Coverage
    For how to get warranty work see:
    Apple - Support - iPod - Service FAQ
    The fastest is to make an appointment at the Genius Bar of an Apple store.

Maybe you are looking for