video-capture

Unable to read frames from VideoCapture from secondary webcam with OpenCV

蓝咒 提交于 2019-11-27 14:49:34
Code: Simple example that works perfectly with primary webcam (device 0): VideoCapture cap(0); if (!cap.isOpened()) { std::cout << "Unable to read stream from specified device." << std::endl; return; } while (true) { // retrieve the frame: Mat frame; if (!cap.read(frame)) { std::cout << "Unable to retrieve frame from video stream." << std::endl; break; } // display it: imshow("MyVideo", frame); // check if Esc has been pressed: if (waitKey(1) == 27) { break; } // else continue: } cap.release(); Problem: I have a second webcam, which I'd like to use. However, when I replace VideoCapture cap(0);

openCV Error: Assertion failed (scn == 3 || scn == 4)

徘徊边缘 提交于 2019-11-27 14:03:40
I am having Assertion failed error at the last frame , while reading and writing a video frame by frame. The errors only shows at the last frame, don't know why. saw this answer here , whichs suggests to give waitkey, my code already have wait key on it. my simple code is as follows int main() { CvCapture *capture=cvCaptureFromFile("C:\\vid\\op.mp4"); if(capture==NULL) { printf("can't open video"); } Mat frame, first_frame,current_frame; char buffer[100]; int frame_count=1,p=1; while(1) { /*Getting the current frame from the video*/ frame=cvQueryFrame(capture); cv::cvtColor(frame,current_frame

How to save video in documents folder then upload to server [duplicate]

三世轮回 提交于 2019-11-27 13:22:27
问题 This question already has an answer here: How to record a video clip in ipad app and store it in documents folder 3 answers I am recording video from the iPad app and I want that video may be saved in documents folder or directly we may upload that to server. I have store audio file in documents but how to save a video file. I am using following code for recording video. UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if (

Android preview processing while video recording

半世苍凉 提交于 2019-11-27 13:17:43
问题 I am using Android development (SDK 2.2) and I would like to make a video recording with mediaRecorder and, at the same time, do some process on each preview frame. I record video with MediaRecorder in a project, in an other I use the onPreviewFrame(byte[] data , Camera camera ) (from PreviewCallback ) for processing preview pictures. I've tried to create a Camera and use it with mediaRecorder ( setCamera function) but it doesn't work. Is it possible to do both in the same time? Actually I

Create Video File using PHP

余生颓废 提交于 2019-11-27 11:48:49
问题 I have scenario for creating a video files using diff. assets like images, audio file. What I want to do is, Find audio files from the particular folder and set it as background music, and fetch images from particular folder and show those images one by one. So basically I have images and audio files and I want create a video file using those assets using PHP. Can any one please suggest the start up point for this? Have done image capture from video and converting the video using Ffmpeg so I

How to develop screen capture to video application

丶灬走出姿态 提交于 2019-11-27 10:58:33
I found similar questions in stackoverflow. But I want to be specific. I visited a web site screencast-o-matic . They have a web-application of java applet which capture screen to export as video. I want to develop similar application. What are the knowledge and steps required to do it? Thanks and regards. Edit another website screenr . Andrew Thompson To get a screenshot, use Robot.createScreenCapture(Rectangle) . To get many screenshots, call that in a loop invoked by a (Swing) Timer . Add them to an expandable collection such as an ArrayList . Convert the BufferedImage objects to JPEG

grab frame NTSCtoUSB dongle, opencv2, python wrapper

家住魔仙堡 提交于 2019-11-27 08:59:20
Context: I have been playing around with python's wrapper for opencv2. I wanted to play with a few ideas and use a wide angle camera similar to 'rear view' cameras in cars. I got one from a scrapped crash car (its got 4 wires) I took an educated guess from the wires color codding, connect it up so that I power the power and ground line from a usb type A and feed the NTSC composite+ composite- from an RCA connector. I bought a NTSC to usb converter like this one . It came with drivers and some off the shelf VHStoDVD software. the problem: I used the run of the mill examples online to trial test

Capture Video of Android's Screen

情到浓时终转凉″ 提交于 2019-11-27 08:56:17
问题 Forget screenshots, is it posible to capture a video of the running application in android? Rooted or non-rooted, I don't care, I want atleast 15fps. Update: I don't want any external hardware. The intent is to make it perfectly portable and every frame is captured within Android OS. If it crosses the boundaries of the app sdk, I'm willing to go to OS level modifications but I would need a starting point. 回答1: Android 4.4 (KitKat) and higher devices have a shell utility for recording the

How to display a cv::Mat in a Windows Form application?

ぐ巨炮叔叔 提交于 2019-11-27 07:17:37
问题 I tried to use imwrite to successfully to display an image on a Windows Form, but it damages the disk, so I need a better way to do this. Below, is my current code, which writes the image temporarily to the hard drive: private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { namedWindow("video",0); VideoCapture cap(0); flag = true; while(flag){ Mat frame; cap >> frame; // get a new frame from camera **imwrite("vdo.jpg",frame);** this->panel1->BackgroundImage =

OpenCV + Java = UnsatisfiedLinkError

≯℡__Kan透↙ 提交于 2019-11-27 06:36:38
问题 I need capture a video stream from my USB webcam, for this i use Opencv 2.4.6 for developing in Java. I follow the steps listed in here I add the "C:\opencv\build\java\x64" dir to my System PATH and include the "opencv-246.jar" file into my libraries on ECLIPSE. When y run the explame import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; public class Main { public static void main(String[] args) { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Mat m = Mat.eye