1 Reply Latest reply: Dec 4, 2012 3:18 PM by Claudiu Ursica RSS

    How to change Camera settings(SetMode and setQuality) while NetStream is published with H264 codec

    Arvind Mehta Community Member

      Hi,

      when I'm using H264 codec I can't modify my cam.setMode(w,h, fps) because my stream hangs (second call to cam.setMode() uhangs video. When I'm using Sorenson codec that same code works fine.

      So my question is how can I change Camera settings when I'm publishing images from this camera with NetStream encoded with H264. I'm using Flash Player 11,3,300,270 Windows XP

       

      here is code to publish Stream:

      /**
          * Publish presenter streams
          */
         private function publishStream():void{

           if (nsPublish != null)
            nsPublish.publish(null);
           if(nsPublish != null){
            nsPublish.dispose();
            nsPublish.close();
            nsPublish = null;
           }
           h264Settings = null;
           nsPublish = new NetStream(nc);
           if(camera != null){
            camera.setKeyFrameInterval(15);
            nsPublish.attachCamera(camera);
           }
          if(mic != null){
            nsPublish.attachAudio(mic);
           }
           nsPublish.bufferTime = 0;
           h264Settings= new H264VideoStreamSettings();
           h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);
           nsPublish.videoStreamSettings = h264Settings;    
           nsPublish.publish("mp4:"+instanceName+".f4v", "record");
           //nsPublish.publish(instanceName,"record");
           nsPublish.addEventListener(NetStatusEvent.NET_STATUS, streamNetStatHandler);
           nsPublish.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorEventHandler);
         
         }

       

       

      If anybody have solution then please reply .


      Regards