Re: [Flashcoders] Auto Webcam Detection
I must apologize to all who have downloaded my class. I have forgotten a very simple yet important piece of code. I forgot to check if there were no cameras at all available. Please replace the begin function with this one: public function begin ():void { _numCameras = Camera.names.length; /* FAIL */if (_numCameras == 0) { dispatchEvent (new WebcamEvent (WebcamEvent.RESOLVE, null, noCameras) ); // No cameras available return; } if (Capabilities.os.substr (0, 6) == Mac OS) _isMac = true; _video = new Video(); getDefaultCamera (); } Thanks, and again I'm sorry. Ktu On Sat, Nov 14, 2009 at 2:01 AM, Ktu ktu_fl...@cataclysmicrewind.comwrote: Thanks Eric, I have not heard about the bluetooth cameras and any related issues. I wonder if the fps works there as well. It is hard enough for me to get access to Macs and that's half the reason I made the class. I initially chose 1.5 seconds for each camera and so far almost all cameras I have tested have come out of their initial init phase before 1.1 seconds. I don't have a lot of experience with a lot of cameras so if you say FW cameras tend to be really slow maybe I should change the default for a bit longer, but there are properties in the class so you can tell the object how long it should check for. I put those in for exactly the reason you are describing. Some cameras take longer, and if the developer using my class wants to test each camera for a longer period of time he has the ability to. Thanks for the feedback. Ktu On Fri, Nov 13, 2009 at 2:16 PM, eric socolofsky e...@transmote.comwrote: hey ktu et al, i also ran into this problem with FLARManager. my solution is not as reusable as yours, as it's wrapped inside a larger framework, but i used some of the same logic you did. you can find it here: http://transmote.com/codeshare/FLARManager/dev/src/com/transmote/flar/source/FLARCameraSource.as FLARCameraSource checks activity level, just like your WebcamDetection. however, some users have reported that newer sony vaios have a 'bluetooth camera' driver that is not attached to a camera (kind of like OSX's 'DV Video'), but that an activity check on the vaio cam returns activity even when there is none. FLARCameraSource gets around this by differencing frames to check for a change in the camera feed. it looks like you're also checking the reported camera fps; i don't have a vaio so can't check that technique against the 'bluetooth camera', but i wonder if it works there too... also, i notice you're checking across 1.5 seconds for each camera. i have double that time in FLARCameraSource, tho i'm not happy about it...can take a while to cycle through cameras. i've found that 2 seconds is borderline, and 3 is safer, but i'm not sure i trust 1.5 seconds to be enough for all cameras (some are very slow to init, particulary external FW cameras). any thoughts on that? nice work, wish i had found this a month ago, would have saved me some headaches... -eric Message: 1 Date: Thu, 12 Nov 2009 12:51:33 -0500 From: Ktu ktu_fl...@cataclysmicrewind.com Subject: Re: [Flashcoders] Auto Webcam Detection To: Flash Coders List flashcoders@chattyfig.figleaf.com Message-ID: e4b6bdf30911120951k2ea2ef73pa8045b585e61b...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 I've made an update to my class. I added better Mac detection so the process goes quicker on Macs. I've also updated the detection math in general. Please if you downloaded it, re-download and update with the new version. Feedback is nice, and I hope you like it. WebcamDetection http://blog.cataclysmicrewind.com/webcamdetection/ Ktu On Fri, Nov 6, 2009 at 4:31 PM, Ktu ktu_fl...@cataclysmicrewind.com wrote: Thanks Juan, I hope you find it beneficial and easy to use. I also plan on making another update to it this week to make its detection a little more robust. Since most of my reasoning for creating the class was because Macs suck and always have three cameras in the list, I am going to add some special Mac detection which should speed up the process for all Mac laptops. Ktu On Wed, Nov 4, 2009 at 11:08 AM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: The test code works fine for me (Win XP, FP 10). I'll be working on a project that includes webcam soon and this could be useful. I'll let you know how it goes if I use it. Thanks for sharing! Cheers Juan Pablo Califano 2009/11/4 Ktu ktu_fl...@cataclysmicrewind.com So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it here http
Re: [Flashcoders] Auto Webcam Detection
hey ktu et al, i also ran into this problem with FLARManager. my solution is not as reusable as yours, as it's wrapped inside a larger framework, but i used some of the same logic you did. you can find it here: http://transmote.com/codeshare/FLARManager/dev/src/com/transmote/flar/source/FLARCameraSource.as FLARCameraSource checks activity level, just like your WebcamDetection. however, some users have reported that newer sony vaios have a 'bluetooth camera' driver that is not attached to a camera (kind of like OSX's 'DV Video'), but that an activity check on the vaio cam returns activity even when there is none. FLARCameraSource gets around this by differencing frames to check for a change in the camera feed. it looks like you're also checking the reported camera fps; i don't have a vaio so can't check that technique against the 'bluetooth camera', but i wonder if it works there too... also, i notice you're checking across 1.5 seconds for each camera. i have double that time in FLARCameraSource, tho i'm not happy about it...can take a while to cycle through cameras. i've found that 2 seconds is borderline, and 3 is safer, but i'm not sure i trust 1.5 seconds to be enough for all cameras (some are very slow to init, particulary external FW cameras). any thoughts on that? nice work, wish i had found this a month ago, would have saved me some headaches... -eric Message: 1 Date: Thu, 12 Nov 2009 12:51:33 -0500 From: Ktu ktu_fl...@cataclysmicrewind.com Subject: Re: [Flashcoders] Auto Webcam Detection To: Flash Coders List flashcoders@chattyfig.figleaf.com Message-ID: e4b6bdf30911120951k2ea2ef73pa8045b585e61b...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 I've made an update to my class. I added better Mac detection so the process goes quicker on Macs. I've also updated the detection math in general. Please if you downloaded it, re-download and update with the new version. Feedback is nice, and I hope you like it. WebcamDetection http://blog.cataclysmicrewind.com/webcamdetection/ Ktu On Fri, Nov 6, 2009 at 4:31 PM, Ktu ktu_fl...@cataclysmicrewind.com wrote: Thanks Juan, I hope you find it beneficial and easy to use. I also plan on making another update to it this week to make its detection a little more robust. Since most of my reasoning for creating the class was because Macs suck and always have three cameras in the list, I am going to add some special Mac detection which should speed up the process for all Mac laptops. Ktu On Wed, Nov 4, 2009 at 11:08 AM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: The test code works fine for me (Win XP, FP 10). I'll be working on a project that includes webcam soon and this could be useful. I'll let you know how it goes if I use it. Thanks for sharing! Cheers Juan Pablo Califano 2009/11/4 Ktu ktu_fl...@cataclysmicrewind.com So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it here http://blog.cataclysmicrewind.com/webcamdetection/ It's pretty simple to use: import com.crp.utils.WebcamDetection; import com.crp.events.WebcamEvent; var wd:WebcamDetection = new WebcamDetection(); wd.addEventListener (WebcamEvent.RESOLVE, onResolve); wd.begin(); function onResolve (e:WebcamEvent):void { trace(e.code); switch (e.code) { case success: var myCamera:Camera = e.camera; break; case noPermission: // the user denied permission break; case noCameras: // no suitable camera's were found break; } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Auto Webcam Detection
Thanks Eric, I have not heard about the bluetooth cameras and any related issues. I wonder if the fps works there as well. It is hard enough for me to get access to Macs and that's half the reason I made the class. I initially chose 1.5 seconds for each camera and so far almost all cameras I have tested have come out of their initial init phase before 1.1 seconds. I don't have a lot of experience with a lot of cameras so if you say FW cameras tend to be really slow maybe I should change the default for a bit longer, but there are properties in the class so you can tell the object how long it should check for. I put those in for exactly the reason you are describing. Some cameras take longer, and if the developer using my class wants to test each camera for a longer period of time he has the ability to. Thanks for the feedback. Ktu On Fri, Nov 13, 2009 at 2:16 PM, eric socolofsky e...@transmote.com wrote: hey ktu et al, i also ran into this problem with FLARManager. my solution is not as reusable as yours, as it's wrapped inside a larger framework, but i used some of the same logic you did. you can find it here: http://transmote.com/codeshare/FLARManager/dev/src/com/transmote/flar/source/FLARCameraSource.as FLARCameraSource checks activity level, just like your WebcamDetection. however, some users have reported that newer sony vaios have a 'bluetooth camera' driver that is not attached to a camera (kind of like OSX's 'DV Video'), but that an activity check on the vaio cam returns activity even when there is none. FLARCameraSource gets around this by differencing frames to check for a change in the camera feed. it looks like you're also checking the reported camera fps; i don't have a vaio so can't check that technique against the 'bluetooth camera', but i wonder if it works there too... also, i notice you're checking across 1.5 seconds for each camera. i have double that time in FLARCameraSource, tho i'm not happy about it...can take a while to cycle through cameras. i've found that 2 seconds is borderline, and 3 is safer, but i'm not sure i trust 1.5 seconds to be enough for all cameras (some are very slow to init, particulary external FW cameras). any thoughts on that? nice work, wish i had found this a month ago, would have saved me some headaches... -eric Message: 1 Date: Thu, 12 Nov 2009 12:51:33 -0500 From: Ktu ktu_fl...@cataclysmicrewind.com Subject: Re: [Flashcoders] Auto Webcam Detection To: Flash Coders List flashcoders@chattyfig.figleaf.com Message-ID: e4b6bdf30911120951k2ea2ef73pa8045b585e61b...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 I've made an update to my class. I added better Mac detection so the process goes quicker on Macs. I've also updated the detection math in general. Please if you downloaded it, re-download and update with the new version. Feedback is nice, and I hope you like it. WebcamDetection http://blog.cataclysmicrewind.com/webcamdetection/ Ktu On Fri, Nov 6, 2009 at 4:31 PM, Ktu ktu_fl...@cataclysmicrewind.com wrote: Thanks Juan, I hope you find it beneficial and easy to use. I also plan on making another update to it this week to make its detection a little more robust. Since most of my reasoning for creating the class was because Macs suck and always have three cameras in the list, I am going to add some special Mac detection which should speed up the process for all Mac laptops. Ktu On Wed, Nov 4, 2009 at 11:08 AM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: The test code works fine for me (Win XP, FP 10). I'll be working on a project that includes webcam soon and this could be useful. I'll let you know how it goes if I use it. Thanks for sharing! Cheers Juan Pablo Califano 2009/11/4 Ktu ktu_fl...@cataclysmicrewind.com So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it here http://blog.cataclysmicrewind.com/webcamdetection/ It's pretty simple to use: import com.crp.utils.WebcamDetection; import com.crp.events.WebcamEvent; var wd:WebcamDetection = new WebcamDetection(); wd.addEventListener (WebcamEvent.RESOLVE, onResolve); wd.begin(); function onResolve (e:WebcamEvent):void { trace(e.code); switch (e.code) { case success: var myCamera:Camera = e.camera; break; case noPermission: // the user denied permission break; case noCameras: // no suitable camera's were found break; } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders
Re: [Flashcoders] Auto Webcam Detection
I've made an update to my class. I added better Mac detection so the process goes quicker on Macs. I've also updated the detection math in general. Please if you downloaded it, re-download and update with the new version. Feedback is nice, and I hope you like it. WebcamDetection http://blog.cataclysmicrewind.com/webcamdetection/ Ktu On Fri, Nov 6, 2009 at 4:31 PM, Ktu ktu_fl...@cataclysmicrewind.com wrote: Thanks Juan, I hope you find it beneficial and easy to use. I also plan on making another update to it this week to make its detection a little more robust. Since most of my reasoning for creating the class was because Macs suck and always have three cameras in the list, I am going to add some special Mac detection which should speed up the process for all Mac laptops. Ktu On Wed, Nov 4, 2009 at 11:08 AM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: The test code works fine for me (Win XP, FP 10). I'll be working on a project that includes webcam soon and this could be useful. I'll let you know how it goes if I use it. Thanks for sharing! Cheers Juan Pablo Califano 2009/11/4 Ktu ktu_fl...@cataclysmicrewind.com So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it here http://blog.cataclysmicrewind.com/webcamdetection/ It's pretty simple to use: import com.crp.utils.WebcamDetection; import com.crp.events.WebcamEvent; var wd:WebcamDetection = new WebcamDetection(); wd.addEventListener (WebcamEvent.RESOLVE, onResolve); wd.begin(); function onResolve (e:WebcamEvent):void { trace(e.code); switch (e.code) { case success: var myCamera:Camera = e.camera; break; case noPermission: // the user denied permission break; case noCameras: // no suitable camera's were found break; } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Auto Webcam Detection
Ktu wrote: So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it herehttp://blog.cataclysmicrewind.com/webcamdetection/ So, the idea is to try each camera until you find one that has a moving image? I still think that it is better to just tell the user to properly select the default camera in the options. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Auto Webcam Detection
So, the idea is to try each camera until you find one that has a moving image? I still think that it is better to just tell the user to properly select the default camera in the options. ___ When you are using a 1280 x 1024 touchscreen, that's a bit difficult because the buttons are too small. Also, if you have 2 cameras which are the same, then the user does not know which one to pick... On our system, we use another program to capture the webcam output and then applications all load the stream / still images. Flash, and other programs, don't share the webcam, so we have to do it this way to enable multiple applications to use the webcam at once. It's a bit different from the normal PC setup, where you have one webcam for personal desktop use, so bit of an edge-case, but... Glen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Auto Webcam Detection
Henrik, The detection is based off of the activity level, so yes the moving image, but its also based off of the fps of the Camera. That way, if my user is a stiff and doesn't move much, but the Camera is good, the fps should be going strong even though the activity is not. Also, I know a lot of users are just too stupid to figure out this whole webcam thing. Heck, I hadn't even used a webcam until I got one on my laptop in April. One thing I have learned is that in your applications, do as much for the user as possible while still making them feel like they have control (but they really don't who are you kidding). Ktu On Wed, Nov 4, 2009 at 6:11 AM, Glen Pike g...@engineeredarts.co.uk wrote: So, the idea is to try each camera until you find one that has a moving image? I still think that it is better to just tell the user to properly select the default camera in the options. ___ When you are using a 1280 x 1024 touchscreen, that's a bit difficult because the buttons are too small. Also, if you have 2 cameras which are the same, then the user does not know which one to pick... On our system, we use another program to capture the webcam output and then applications all load the stream / still images. Flash, and other programs, don't share the webcam, so we have to do it this way to enable multiple applications to use the webcam at once. It's a bit different from the normal PC setup, where you have one webcam for personal desktop use, so bit of an edge-case, but... Glen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Auto Webcam Detection
The test code works fine for me (Win XP, FP 10). I'll be working on a project that includes webcam soon and this could be useful. I'll let you know how it goes if I use it. Thanks for sharing! Cheers Juan Pablo Califano 2009/11/4 Ktu ktu_fl...@cataclysmicrewind.com So I've noticed that Facebook will automatically detect which Camera object to use on your computer. It seems on most if not all macs there are at least three (3) Camera objects always available. So, I've made a class that will automatically detect which webcam is active and running. Feedback anyone? Download it here http://blog.cataclysmicrewind.com/webcamdetection/ It's pretty simple to use: import com.crp.utils.WebcamDetection; import com.crp.events.WebcamEvent; var wd:WebcamDetection = new WebcamDetection(); wd.addEventListener (WebcamEvent.RESOLVE, onResolve); wd.begin(); function onResolve (e:WebcamEvent):void { trace(e.code); switch (e.code) { case success: var myCamera:Camera = e.camera; break; case noPermission: // the user denied permission break; case noCameras: // no suitable camera's were found break; } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders