Skip navigation
Currently Being Moderated

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

Dec 3, 2012 12:45 AM

Tags: #and #with #camera #change #netstream #to #how #h264 #codec #is #published #while #settings(setmode #setquality)

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

 
Replies
  • Currently Being Moderated
    Dec 4, 2012 3:18 PM   in reply to Arvind Mehta

    Try to unpublish/pause publishing just before setting the things on camera and resume/publish again after the settings are applied.

     

    C

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points