infusion / jQuery-webcam

A webcam wrapper plugin for jQuery
http://www.xarg.org/project/jquery-webcam-plugin/
517 stars 272 forks source link

Need to edit src/jscam.as as well if changing size #5

Open cviebrock opened 12 years ago

cviebrock commented 12 years ago

The docs on the home page don't make it clear. I thought you only needed to edit the src/jscam.xml file if you wanted to recompile the Flash for a new size of cam.

Turns out the height/width are hard-coded into src/jscam.as as well (in two places for each), so be sure to edit that file.

infusion commented 12 years ago

Hi,

yes, the dimensions are hardcoded at two places. I tried to control both via the JS-params but it didn't actually work. If you've any suggestions on this, let me hear.

Robert

matthewjohnston4 commented 12 years ago

Is there a max size limit with this? I've tried setting it to 1280 height and 720 width in jscam.xml, jscam.as and within the HTML source too, but I don't get any image put into the canvas?

sshilko commented 12 years ago

need to edit 1) xml 2) as 3) js

all 3 places contain 320x240

matthewjohnston4 commented 12 years ago

Yeah, I've edited all of those files (it'd be great if they were documented) and no luck.

I'm using the 'callback' option, writing to the canvas and then in the onCapture callback I'm making a POST to a php file with a canvas.toDataURL call in it. Once the resolution of the image captured goes above 854x480 or thereabouts, the image is still successfully output to the canvas, but only a blank image is ever saved by the php file. I presume there is something to do with file size limit or character limit with the base64 string causing this but I can't figure it out, I've even edited the php.ini file to change max file upload size etc.

sshilko commented 12 years ago

there is a limit for POST data, and callback method does NOT return base64 image , it returns pixel colors.. you have to deal with them separate or might give a try because i already dealt with them here https://github.com/sshilko/jQuery-AS3-Webcam

iam not using canvas, all output is pure thru javascript and only call is save() wich does return base64(jpeg) image which i send thru POST with ajax

matthewjohnston4 commented 12 years ago

Actually, when you use the callback method, you can then use the standard HTML5 canvas methods to grab the image from the canvas and convert it to base64, this is what canvas.toDataURL does. You can see the code I'm using here: http://pastebin.com/ZyMZQCQ0

Note that I'm very confident in the functionality in that code - it works 100% for images that are at resolution 854 x 480 or lower but as soon as you hit a particular resolution it craps out.

sshilko commented 12 years ago

canvas is html5 i cant go with html5 yet.. and i have no reasons to use it because everything can be done in html4

sorry for personal letters here in comments :)

matthewjohnston4 commented 12 years ago

Never mind me, I found the reason, there was a php.ini setting for something called Suhosin that was setting a max length for POST values. Changed that and solved the problem :)

Foovanadil commented 12 years ago

I made all the changes mentioned but get an error on make:

src/jscam.as:22: characters 16-26 : type error class not found : flash.display.BitmapData

Any ideas?

sshilko commented 12 years ago

your not using AS3, your using AS2, or you dont have full Adobe Flex SDK installed

sshilko commented 12 years ago

ehm.. why iam receiving notifications of issues here :| donnow.. (away)

Foovanadil commented 12 years ago

Ok so I am not totally sure I follow.

As far as the ActionScript version goes, I am using the ActionScript files from this repo (don't know what version that is). Is there some way for me to know what version of ActionScript I have on my machine that is trying to compile?

I installed the flx sdk onto my machine following these instructions: http://www.linuxdict.com/2010-03-install-and-set-up-adobe-flex-sdk-on-linux/

and tested and can see the sdk from the command line. It shows

[root@localhost flex]# mxmlc -version
Version 4.6.0 build 23201

so I am clearly missing something I think

Foovanadil commented 12 years ago

Ahh, so I see that mtasc (which is specified as the way to compile this thing on linux) only supports ActionScript 2.... So how did others get this thing to compile? All I want to do is change the size of the video and this seems to be the only way to do this?

sshilko commented 12 years ago

i suggest you to use my AS3 implementation of this stuff, dont mess with AS2 its painfully SLOW https://github.com/sshilko/jQuery-AS3-Webcam