带AS3的网络摄像头

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了带AS3的网络摄像头相关的知识,希望对你有一定的参考价值。

Using the webcam in AS3 is super easy. You just need to attach the camera class to a video instance. This is a class that extends the video component for easily implementing a webcam display.
  1. package {
  2.  
  3. import flash.media.Camera;
  4. import flash.media.Video;
  5.  
  6.  
  7. public class CameraDemo extends Video {
  8.  
  9. private var camera:Camera;
  10. private var camQuality:int = 80;
  11. private var fps:int = 30;
  12.  
  13. public function CameraDemo(w:Number = 640, h:Number = 480) {
  14. /* Set the width and height of the camera's display */
  15. this.width = w;
  16. this.height = h;
  17. startCamera();
  18. }
  19.  
  20. public function startCamera():void
  21. {
  22. /* Get the default camera for the system */
  23. camera = Camera.getCamera();
  24. /* Set the bandwidth and camera image quality */
  25. camera.setQuality(0, camQuality);
  26. /* Set the size of the camera and frames per second */
  27. camera.setMode(this.width, this.height, fps);
  28. /* Attach the camera to the video object.. In this case the current class. */
  29. this.attachCamera(camera);
  30. }
  31. }
  32. }

以上是关于带AS3的网络摄像头的主要内容,如果未能解决你的问题,请参考以下文章

Avr atmega 16 带网络摄像头

Gstreamer 录制带音频的视频

网络摄像头因运动而像素化

片段中的 Android 相机预览

海康威视摄像头三条线怎么接

AS3:提取不带扩展名的文件名