What is the best method to capture images from a live video device for use by a Java-based application?

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

Record a video of the screen using .NET technologies [closed]

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

Sending message to background script

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

2 usb cameras not working with opencv

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

Simultaneous AVCaptureVideoDataOutput and AVCaptureMovieFileOutput

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

How to capture screen to be video using C# .Net?

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

Can use AVCaptureVideoDataOutput and AVCaptureMovieFileOutput at the same time?

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

OpenCV real time streaming video capture is slow. How to drop frames or get synced with real time?

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