webcam

Webcam js Error in Chrome: Could not access webcam

落花浮王杯 提交于 2020-07-21 03:16:09
问题 I am using Webcam JS in one of my projects. https://github.com/jhuckaby/webcamjs version I was using: 1.0.0 Latest version available: 1.0.5 It was working fine in both Chrome and Firefox. But lately webcam error started showing only in CHROME. Firefox still works fine. Error that I received in 1.0.0: Webcam.JS Error: cannot access webcam. I upgraded the version and now the error I'm getting in chrome is Webcam.js Error: Could not access webcam. Permission Error: Only secure origins are

How to get webcam feed with react hooks?

偶尔善良 提交于 2020-07-19 04:50:48
问题 I am trying to get a webcam feed to display on my app using react hooks. I also need to be able to capture the latest image from the feed I believe I have the foundations but am missing something. import React,{useState,useEffect} from "react" export function VideoFeed(){ const[constraints] = useState({width:300,height:300}) useEffect(()=>{ navigator.mediaDevices.getUserMedia({video:true}) .then(stream=>{ let video = document.querySelector('video') video.source = stream; video.play(); })

How to get webcam feed with react hooks?

不想你离开。 提交于 2020-07-19 04:50:29
问题 I am trying to get a webcam feed to display on my app using react hooks. I also need to be able to capture the latest image from the feed I believe I have the foundations but am missing something. import React,{useState,useEffect} from "react" export function VideoFeed(){ const[constraints] = useState({width:300,height:300}) useEffect(()=>{ navigator.mediaDevices.getUserMedia({video:true}) .then(stream=>{ let video = document.querySelector('video') video.source = stream; video.play(); })

How to get webcam feed with react hooks?

主宰稳场 提交于 2020-07-19 04:50:12
问题 I am trying to get a webcam feed to display on my app using react hooks. I also need to be able to capture the latest image from the feed I believe I have the foundations but am missing something. import React,{useState,useEffect} from "react" export function VideoFeed(){ const[constraints] = useState({width:300,height:300}) useEffect(()=>{ navigator.mediaDevices.getUserMedia({video:true}) .then(stream=>{ let video = document.querySelector('video') video.source = stream; video.play(); })

Unable to access the WebCam

二次信任 提交于 2020-06-29 05:29:06
问题 (function ($) { var webcam = { "extern": null, // external select token to support jQuery dialogs "append": true, // append object instead of overwriting "width": 320, "height": 240, "mode": "callback", // callback | save | stream "swffile": "../Webcam_Plugin/jscam_canvas_only.swf", "quality": 85, "debug": function () {}, "onCapture": function () {}, "onTick": function () {}, "onSave": function () {}, "onLoad": function () {} }; window["webcam"] = webcam; $["fn"]["webcam"] = function(options)

How to capture frames from a webcam with SharpDX

拟墨画扇 提交于 2020-06-17 13:25:27
问题 I'm trying to implement a webcam capture app which should take still frames, display them on the screen and save to the disk. Since I'm using SharpDX already to capture the screen, I thought it would be nice to use that library. I was not sure if SharpDX had any video capture capabilities, so I started searching and found parts of what it looks like a webcam capture prototype: var attributes = new MediaAttributes(1); attributes.Set<Guid>(CaptureDeviceAttributeKeys.SourceType,

jQuery webcam/flash: How to detect if webcam is active?

限于喜欢 提交于 2020-05-14 19:55:07
问题 I'm using this jQuery webcam plugin in a website I'm working on. If you go to the website, you'll notice it uses flash, and you have to click 'accept' in order to get it to work. I want to determine if the webcam is active (on) or not. How can I do this with javascript/jquery? In other words, what do I substitute in the if statement here? function capture_image(){ if(webcam.muted == true) {alert("hey");} I'm far from a pro in javascript and jquery, so real code would be much appreciated. Also

Python OpenCV access webcam maximum resolution

大兔子大兔子 提交于 2020-04-29 10:49:33
问题 I am trying to acquire images from my webcam using a python code that imports OpenCV. The code is the following: import sys sys.path.append("C:\\opencv\\build\\python\\2.7") import cv2 import cv2.cv as cv import time # Set resolution cap = cv2.VideoCapture(0) print "Frame default resolution: (" + str(cap.get(cv.CV_CAP_PROP_FRAME_WIDTH)) + "; " + str(cap.get(cv.CV_CAP_PROP_FRAME_HEIGHT)) + ")" cap.set(cv.CV_CAP_PROP_FRAME_WIDTH, 800) cap.set(cv.CV_CAP_PROP_FRAME_HEIGHT, 600) print "Frame

如何使用C#创建Windows Webcam应用

本秂侑毒 提交于 2020-04-12 16:31:28
最近想用C#写一个camera的应用。搜索了Google和StackOverflow,发现大部分的sample用了WIA或者DirectShow。WIA和DirectShow都没有直接提供C#接口,所以实现起来也比较复杂。试着运行了几个WIA的工程,在Windows10上还不起作用。发现微软提供了一个MediaCapture类,包含了丰富的C#接口,可用于音频,视频。要用这个类,就需要创建一个UWP工程。这里分享下如何使用MediaCapture的C#接口来获取camera的每一帧数据。 微软示例 微软在GitHub上放了大量的 UWP示例 ,里面包含了各种camera的接口使用方法。 在Android中要获取camera的每一帧数据,可以通过onPreviewCallback的回调函数实现。参考 CameraFrames 这个示例,也可以实现类似的功能。 如何创建Windows Webcam应用 1. 在 package.appxmanifest 中获取webcam权限: 2. 创建image element用于绘制webcam的预览界面: 3. 通过Image Element初始化 FrameRenderer : _frameRenderer = new FrameRenderer(PreviewImage); 4. 初始化MediaCapture对象: // Create a

HTML Media Capture API vs. getUserMedia()

倾然丶 夕夏残阳落幕 提交于 2020-04-07 11:39:04
问题 currently, I'm trying to do some really simple thing (well, actually I thought it is simple...): I want to take a photo from the web-cam in a web-application . I stumbled over two possibilities: 1. The HTML Media Capture API which looks really easy: <input type="file" accept="image/*" capture="camera"> 2. JavaScript media streams, which also look pretty easy: navigator.getUserMedia() And here comes my question: The HTML Media Capture API is not working in desktop browsers and the JavaScript