video-capture

How to read video file in python with audio stream on Linux?

微笑、不失礼 提交于 2019-11-28 12:48:28
问题 I'm looking an approach how to extract video frames and corresponding audio segments from a video file using python. I know well about opencv. But it allows just to extract video frames. No audio provided. I need both - video frames and audio segments which exactly correspond to each other. Will be very thankful for any hints :) 回答1: Finally, I found moviepy https://pypi.python.org/pypi/moviepy which implements light wrapper for ffmpeg and provides interface to quickly obtain video and audio

OpenCV + Java = UnsatisfiedLinkError

。_饼干妹妹 提交于 2019-11-28 11:55:30
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(3, 3, CvType.CV_8UC1); System.out.println("m = " + m.dump()); } } i get m = [1, 0, 0; 0, 1, 0; 0, 0, 1]

DirectShow Record Problem - fps

北城余情 提交于 2019-11-28 11:45:56
I just create simple graph to record video from a source Filter: SourceFilter ---> Muxer ---> FileWriter I can able to save video which come from SourceFilter to my local disk. But when i try to play the recorded video, it play in "slow motion" :-). It is sure that there is fps (frame persecond) problem. How can i fix it? any ideas? PS: To check if my SourceFilter give righ fps i simply create another graph: SourceFilter ---> Video Decoder ---> Video Renderer and it plays at right speed (fps) More Details: SourceFilter(*.mp4 file format) ---> Avi Mux Filter ---> File writer Filter This record

Can not Read or Play a Video in OpenCV+Python using VideoCapture

泄露秘密 提交于 2019-11-28 11:16:30
import cv2 import numpy as np cap = cv2.VideoCapture('traffic.avi') retval, frame = cap.read() print retval ================ RESTART: J:\Python For DIP\traffic_video.py ================ False >>> The Value of retval is always False, which means the video is not read by the command. It must be True to read frames. I don't know what to do. However when I use my default webcam it turns to be True. I tried many videos and the same problem appears. Note: I have installed the ffmpeg correctly. Note: This is not the full code, in this step I am only validating cap.read() either True or False This

How to get the thumbnail of a recorded video - windows phone 8?

只愿长相守 提交于 2019-11-28 10:32:39
问题 I've used CaptureSource() to record a video like in this Topic How to record video in a camera app for Windows Phone, but I can't get the thumbnail of the recorded video. 回答1: Here is the solution: [...] // Add eventhandlers for captureSource. captureSource.CaptureFailed += new EventHandler<ExceptionRoutedEventArgs>(OnCaptureFailed); captureSource.CaptureImageCompleted += captureSource_CaptureImageCompleted; [...] captureSource.Start(); captureSource.CaptureImageAsync(); [...] void

In Matlab, writing images to AVI without displaying using VideoWriter

淺唱寂寞╮ 提交于 2019-11-28 09:52:35
问题 I'm trying to write images within a loop to an AVI file. Right now, I'm using VideoWriter and getframe to achieve that goal. The code generally goes something like this: FoodVideo = VideoWriter('tempp.avi'); FoodVideo.FrameRate = 25; open(FoodVideo); hh=figure('Visible','off'); for i=1:20 imshow(example_image{i}); hold on; text(100,100,sprintf('Frame Number: %d',i)); hold off; currFrame = getframe(hh); writeVideo(FoodVideo,currFrame); end close(FoodVideo); The problem is that getframe

VideoCapture is not working in OpenCV 2.4.2

跟風遠走 提交于 2019-11-28 07:41:04
I recently installed OpenCV 2.4.2 in Ubuntu 12.04. cap = VideoCapture(0) is working. but I can't grab frames from some video source. cap = VideoCapture("input.avi") img = cap.read() gives me a numpy with all zero elements. I have also installed ffmpeg 0.11, Latest snapshot of x264, v4l-0.8.8 (All are latest stable versions) cmake -D WITH_QT=ON -D WITH_FFMPEG=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D BUILD_EXAMPLES=OFF WITH_V4L=ON .. make sudo make install When I do cmake, I get this -- Detected version of GNU GCC: 46 (406) -- Found OpenEXR: /usr/lib/libIlmImf.so -- Looking for linux/videodev.h --

How to convert a kCVPixelFormatType_420YpCbCr8BiPlanarFullRange buffer to UIImage in iOS

余生颓废 提交于 2019-11-28 07:02:36
I tried to answer this in the original thread however SO would not let me. Hopefully someone with more authority can merge this into the original question. OK here is a more complete answer. First, setup the capture: // Create capture session self.captureSession = [[AVCaptureSession alloc] init]; [self.captureSession setSessionPreset:AVCaptureSessionPresetPhoto]; // Setup capture input self.inputDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice:self.inputDevice error:nil]; [self

MediaRecorder.stop() stop failed: -1007

跟風遠走 提交于 2019-11-28 06:48:14
I am recording video with MediaRecorder. My code works fine on 2.3.3 but fails on 4.0.3. The issue is following: the code mediaRecorder.stop() throws the RuntimeExeption java.lang.RuntimeException: stop failed. at android.media.MediaRecorder.stop(Native Method) with LogCat message 04-05 15:10:51.815: E/MediaRecorder(15709): stop failed: -1007 UPDATE I've found, that MediaPlayer reports an error (via MediaPlayer.OnErrorListener) almost immediately after the start. Error code is 100 (media server died), extra -1007. UPDATE 2 Code to prepare the MediaRecorder c = Camera.open(); ... // Step 1:

OpenCV 2.3 (C++,QtGui), Problem Initializing some specific USB Devices and Setups

流过昼夜 提交于 2019-11-28 05:32:58
问题 I'm playing around with OpenCV since a while and I found some strange behavior of some specific capturing devices (PS3 Eye, Logitech C940, iSight) even on different Platforms. Using OpenCV in Windows: All cams mentioned above work well. But when I want to use 2 cams and therefore create a second capture it will depend on the devices that I use in my Dual Cam Setup. PS3 Eye + C940: no problems 2x C940: no problems 2x PS3 Eye: No chance, only the specific device that was connected first will