• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Improve video quality when using NetConnection

Explorer ,
Apr 26, 2012 Apr 26, 2012

Copy link to clipboard

Copied

I have created a small video broadcast app using Flash PRofessional as it was getting tedious sending users FMLE and providing them with instructions on streaming their camera to my FMS.

The application works fine but I have no control over the size of the video or the quality.

When it streams, the video is blocky and pixelated.

Could anyone help and provide information on adding code to control the quality and video size?

code:

var nc:NetConnection = new NetConnection();

nc.client = this;

nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

nc.connect("rtmp://localhost/livecast/", "The Trainer");

function onMetaData(info:Object):void {}

function onCuePoint(info:Object):void {}

function asyncErrorHandler(event:AsyncErrorEvent):void {}

function onSecurityError(evt:SecurityErrorEvent):void{}

function onNetStatus(eventObj:NetStatusEvent):void {

    switch(eventObj.info.code){

        case "NetConnection.Connect.Success":

          

            out_ns = new NetStream(nc);

            out_ns.addEventListener(NetStatusEvent.NET_STATUS, onMetaData);

            out_ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

            out_ns.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

            statusText.appendText(String.fromCharCode(13)+

                                  eventObj.info.code+

                                  String.fromCharCode(13)+

                                  "You are Connected! "+String.fromCharCode(13)+

                                  "-----------------------------"+String.fromCharCode(13));

            setupBroadcast();

            break;       

        case "NetConnection.Connect.Failed" || "NetConnection.Connect.Rejected":

            statusText.appendText(String.fromCharCode(13)+

                                  eventObj.info.code+String.fromCharCode(13));

        break;

    }

}

function setupBroadcast():void {

  

    var local_cam:Camera = Camera.getCamera();

    out_ns.attachCamera(local_cam);

       

    var live_mic:Microphone = Microphone.getMicrophone();

  

    out_ns.attachAudio(live_mic);

   

    videoOut.myVid.attachCamera(local_cam);

    out_ns.publish("technical", "live");

}

TOPICS
ActionScript

Views

726

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 26, 2012 Apr 26, 2012

Copy link to clipboard

Copied

LATEST

You will get some information about streaming video quality by Camera class method setQuality(),

from below links:

https://bharatria.wordpress.com/2009/05/30/broadcasting-video-quality/

http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000880.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines