Why can’t I open avi video in openCV?
A missing OpenCV’s ffmpeg.dll does not generate any warnings/errors in OpenCV 2.3.1, and code fails silently. Make sure that you have proper opencv_ffmpeg*.dll in your path.
A missing OpenCV’s ffmpeg.dll does not generate any warnings/errors in OpenCV 2.3.1, and code fails silently. Make sure that you have proper opencv_ffmpeg*.dll in your path.
This JavaCV implementation works fine. CODE: import com.googlecode.javacv.OpenCVFrameGrabber; import com.googlecode.javacv.cpp.opencv_core.IplImage; import static com.googlecode.javacv.cpp.opencv_highgui.*; public class CaptureImage { private static void captureFrame() { // 0-default camera, 1 – next…so on final OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0); try { grabber.start(); IplImage img = grabber.grab(); if (img != null) { cvSaveImage(“capture.jpg”, img); } } catch (Exception e) { … Read more
There isn’t any need for a third-party DLL. This simple method captures the current screen image into a .NET Bitmap object. private Image CaptureScreen() { Rectangle screenSize = Screen.PrimaryScreen.Bounds; Bitmap target = new Bitmap(screenSize.Width, screenSize.Height); using(Graphics g = Graphics.FromImage(target)) { g.CopyFromScreen(0, 0, 0, 0, new Size(screenSize.Width, screenSize.Height)); } return target; } I am sure you … Read more
You cannot simply use messaging the same way you would use it in a content script from an arbitrary webpage’s code. There are two guides available in the documentation for communicating with webpages, which correspond to two approaches: (externally_connectable) (custom events with a content script) Suppose you want to allow http://example.com to send a message … Read more
The typical reason for 2+ USB cameras to not work together (still they might be working fine separately) is that USB bandwidth is insufficient for them both to run simultaneously. There is a bandwidth limit, which is rather low: The maximum throughput of an isochronous pipe (which is usually used for video) is 24MB/s. More … Read more
I have contacted an engineer at Apple’s support and he told me that simultaneous AVCaptureVideoDataOutput + AVCaptureMovieFileOutput use is not supported. I don’t know if they will support it in the future, but he used the word “not supported at this time”. I encourage you to fill a bug report / feature request on this, … Read more
This code uses SharpAvi available on NuGet. using System; using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using SharpAvi; using SharpAvi.Codecs; using SharpAvi.Output; using System.Windows.Forms; namespace Captura { // Used to Configure the Recorder public class RecorderParams { public RecorderParams(string filename, int FrameRate, FourCC Encoder, int Quality) { FileName = filename; FramesPerSecond = … Read more
I can’t answer the specific question put, but I’ve been successfully recording video and grabbing frames at the same time using: AVCaptureSession and AVCaptureVideoDataOutput to route frames into my own code AVAssetWriter, AVAssetWriterInput and AVAssetWriterInputPixelBufferAdaptor to write frames out to an H.264 encoded movie file That’s without investigating audio. I end up getting CMSampleBuffers from … Read more
My hypothesis is that the jitter is most likely due to network limitations and occurs when a frame packet is dropped. When a frame is dropped, this causes the program to display the last “good” frame which results in the display freezing. This is probably a hardware or bandwidth issue but we can alleviate some … Read more