camera

Recording video in specified time intervals and then saving them into file OpenCv Python

自作多情 提交于 2021-02-07 10:51:57
问题 Here are my goals. Capture video continuously until 'q; is pressed Every ten seconds save the video in created directory file Continue step two until 'q' is pressed I am executing the following code. But when creating files it's creating 6kb files and saying cannot play. I am fairly new to opencv and python. Not sure what I am missing. Running this code on pycharm with Python 3.6. Also the cv2.imshow('frame',frame) stops after ten seconds but recording is happening in background and files are

AVFoundation take picture every second SWIFT

泄露秘密 提交于 2021-02-07 10:38:19
问题 I'm trying to use AVFoundation framework to take a picture and analyze it in my app. I want it to take a picture every second automatically, how do I do that? Here is my current code, right now it takes a picture only when call capturePhoto(). func setupSession() { session = AVCaptureSession() session.sessionPreset = AVCaptureSessionPresetPhoto let camera = AVCaptureDevice .defaultDeviceWithMediaType(AVMediaTypeVideo) do { input = try AVCaptureDeviceInput(device: camera) } catch { return }

OpenCV Python: cv2.VideoCapture can only find 2 of 3 cameras, Windows Camera app finds all

社会主义新天地 提交于 2021-02-07 04:54:09
问题 I'm trying to create 3 real-time capture frames with webcams into a USB hub into my laptop. Using the "camera" app on Windows, I can change the camera source one at a time and confirm that all 3 webcams are working. However, my OpenCV Python code can only ever find two. (Quick notes on the USB - it's a USB 3.0 hub, laptop port is USB 3, and I even have an active USB female-to-male cable going into the laptop, so given this and the Windows app working, I generally trust the hardware.) Below I

Moving Camera in SpriteKit Swift

蹲街弑〆低调 提交于 2021-02-07 03:06:12
问题 I am creating a game in sprite kit using swift, and I am trying to be able to move the SKScene around with a finger because not all of the nodes fit within the scene. I have already created world, overlay, and camera nodes with this code. override func didMoveToView(view: SKView) { world = self.childNodeWithName("world")! if !isCreated { isCreated = true // Camera setup self.anchorPoint = CGPoint(x: 0.5, y: 0.5) self.world = SKNode() self.world.name = "world" addChild(self.world) self.cam =

Moving Camera in SpriteKit Swift

你。 提交于 2021-02-07 03:03:16
问题 I am creating a game in sprite kit using swift, and I am trying to be able to move the SKScene around with a finger because not all of the nodes fit within the scene. I have already created world, overlay, and camera nodes with this code. override func didMoveToView(view: SKView) { world = self.childNodeWithName("world")! if !isCreated { isCreated = true // Camera setup self.anchorPoint = CGPoint(x: 0.5, y: 0.5) self.world = SKNode() self.world.name = "world" addChild(self.world) self.cam =

How to put an object in front of camera in THREE.JS?

自作多情 提交于 2021-02-06 11:09:35
问题 I'm trying to put an object in front of the camera, but have not been able to. I'm using the FlyControls what moves the camera, and I now want to put an object in front of it. How can I do this? I've tried many different ways, but I did not succeed. Thanks 回答1: Have you tried making your object a child of your camera and then translating it forward? camera.add(nanobot); nanobot.position.set(0,0,-100); The above places the nanobot permanently 100 units in front of the camera... and that's

MediaRecorder setVideoSize shows different behaviour in different devices

落爺英雄遲暮 提交于 2021-02-06 09:15:33
问题 I am using media recorder to record video in an android app. mMediaRecorder.setCamera(mServiceCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); //mMediaRecorder.setVideoSize(mPreviewSize.width, mPreviewSize.height); mMediaRecorder.setVideoFrameRate(30); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); mMediaRecorder

MediaRecorder setVideoSize shows different behaviour in different devices

时光怂恿深爱的人放手 提交于 2021-02-06 09:12:21
问题 I am using media recorder to record video in an android app. mMediaRecorder.setCamera(mServiceCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); //mMediaRecorder.setVideoSize(mPreviewSize.width, mPreviewSize.height); mMediaRecorder.setVideoFrameRate(30); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); mMediaRecorder

How to Record the Video through Camera, And Record the SystemTimeStamp over the Video

我的梦境 提交于 2021-02-03 06:12:12
问题 I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this! 回答1: Follow the procedure below. 1. Capture video byte array (of each frame). 2. Now create bitmap from byte array. 3. Use link below to overlay text over bitmap. 4. Save those bitmaps to create video. Text Overlay bitmap. 回答2: You could follow a two-stage approach. First,

How to Record the Video through Camera, And Record the SystemTimeStamp over the Video

家住魔仙堡 提交于 2021-02-03 06:08:06
问题 I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this! 回答1: Follow the procedure below. 1. Capture video byte array (of each frame). 2. Now create bitmap from byte array. 3. Use link below to overlay text over bitmap. 4. Save those bitmaps to create video. Text Overlay bitmap. 回答2: You could follow a two-stage approach. First,