Skip to main content
Participating Frequently
January 21, 2011
Question

Recording webcam: video quality/audio sync problems

  • January 21, 2011
  • 1 reply
  • 1269 views

I'm trying to record a stream from a webcam using FMS4 developer edition.  The streams are recording on a linux box in .flv files.  These files though have problems.

1 - The video quality is terrible.  Fuzzy/blocky.  Any kind of motion looks awful.  Is there any way to improve this?

2 - The sound jumps/skips and goes out of time with the video.

As it is now this is useless.  I am trying to make a system where a user records a short video from the camera and then I upload it to YouTube from my server.  If you use Youtube's webcam page the video quality is quite acceptable and the audio is obviously in sync too, so they must know something I don't.    (http://www.youtube.com/my_webcam)

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    January 22, 2011

    What are you using for publishing/recording your content ?

    jsd99Author
    Participating Frequently
    January 22, 2011

    I wrote a custom Flex application to publish the stream.  Most of the code I copied from Adobe examples.  To start the camera:

    var camera:Camera = Camera.getCamera();

        if (camera != null) {
            camera.setMode(320,240,30,true);
            camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);

            video = new Video(camera.width, camera.height);
            video.attachCamera(camera);

            var spriteWrapper:UIComponent = new UIComponent();
            addChild(spriteWrapper);
            spriteWrapper.addChild(video);
           
        } else {
            Alert.show("You need a camera.");
        }

    The actual publishing part is here:

        nc = new NetConnection();
            nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
            nc.connect("rtmp://myserver.compute.amazonaws.com/jsd");
            var client:Object = new Object();
            client.onBWDone = function ():void { trace('on bw done'); }
            nc.client = client;

    private function onNetStatus(event:NetStatusEvent):void {
        if(event.info.code == "NetConnection.Connect.Success"){
            cam = Camera.getCamera();
            mic = Microphone.getMicrophone();
            mic.rate = 22;
            ns = new NetStream(nc);
            ns.attachCamera(cam);
            ns.attachAudio(mic);
            ns.publish("camtest", "record");
        }
        if (event.info.code == 'NetConnection.Connect.Rejected' || event.info.code == 'NetStream.Record.NoAccess') {
            Alert.show("Rejected");
            nc.close();
        }
    }