TwelvestoneFlash

recording webcam input


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
DontBogartMe
 
2008-05-14

is it possible to build a Flash app that can record webcam input and then send that back to the server to record it as an FLV or some other format?

Hmm as I type it out it sounds rather unlikely to me. Perhaps better to get the user to make their own video with their own software then just upload the complete video to the server, then convert it to FLV, then play it back on the website.

Any thoughts?

JLM
 
2008-05-14

There is an air app that allow editing of flv's it is free to use but not open source and it is based on bitmapdata so its all flash so might be possible.

Recently I have done blue screen videos in papervision so I expect as3 can do bitmapdata grabbing fast enough its transfer and encoding that might just be too slow.

It is not difficult to encode a movieclip as a jpeg and send to server but it would be too slow to send lots of jpegs.

import com.adobe.images.JPGEncoder;
import flash.net.FileReference;
import flash.net.URLRequest;

import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;

//...

private function sendjpgToServer():void
{

        _jpgSource                  = new BitmapData( WIDTH, HEIGHT );
        _jpgSource.draw( _imageSource );
        _jpgEncoder                 = new JPGEncoder( COMPRESSION );
        _jpgStream                  = _jpgEncoder.encode( _jpgSource ); 

        _header                     = new URLRequestHeader("Content-type", "application/octet-stream");
        _jpgUrlRequest              = new URLRequest(_sendImagePath+ '?PictureId='+_imageId+'&cacheKiller=' + (new Date()).getTime());
        _jpgUrlRequest.requestHeaders.push( _header );

        _jpgUrlRequest.method       = URLRequestMethod.POST;            
        _jpgUrlRequest.data         = _jpgStream;
        var myLoader:Loader         = new Loader();
        myLoader.contentLoaderInfo.addEventListener(Event.INIT, onCompleteJpg);
        myLoader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR,     ioErrorListener );
        myLoader.load(_jpgUrlRequest); 

}

It uses a hack to send the data (using Loader rather than URLLoader) as the ways I found online only works if you have sloopy php security setup, my approach requires the php echo's a jpg to get a finished call back!

Storm
 
2008-05-14
DontBogartMe
 
2008-05-14

these guys offer one you can buy:

http://www.flashsyndrome.com/recorder.php

But for my purposes now I don't need to save the webcam vid onto the server at all it turns out - I just need to be able to record it to memory and be able to play it back to the user, and that app does exactly that. I guess from the choppiness of the playback that it is showing a series of BMPs or JPGs like you described JLM. Maybe I'll look into how that's done.

persist
 
2008-05-14
lithium
 
2008-05-14

_Originally posted by: persist_http://osflash.org/red5

k

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

recording webcam input