
Hi !
Super short post today, however is the base of the next series of posts around OpenCV and .Net 5. I already wrote on how to work with a webcam, and now it’s time to share a simple piece of code to show
How to open and process a video frame by frame
I’ve downloaded a “traffic cam” video from Youtube, and this is the output in a Winform.

Super easy ! And as usual, the source code
And the source video
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.
More info in https://beacons.ai/elbruno
References
- OpenCVSharp, https://github.com/shimat/opencvsharp
Net 5 and OpenCV
- 13 lines to display a π¦ camera feed with OpenCV and Net5
- Detecting edges on the π¦ camera feed with Canny algorithm, OpenCV and Net5
- Detecting corners on the π¦ camera feed with FAST algorithm, OpenCV and Net 5
- Display the π¦ camera feed in a WinForm using OpenCV and Net5
- Face Detection using Face Cascades on the π¦ camera feed using OpenCV and Net 5
- Face Detection using DNN on the π¦ camera feed using OpenCV and Net 5
- Face Detection, DNN vs Haar Cascades on the π¦ camera feed using OpenCV and Net 5
- Age and Gender estimation on the π¦ camera feed using OpenCV and Net 5
- Caffe Model Zoo (GoogleNet) detection from the π¦ camera feed using OpenCV and Net5
- Pose detection from the π¦ camera feed using OpenCV and Net5
- Packaging a WinForm OpenCV and Net5 App in a one-self contained file
- Display a video file π₯ in Winform using OpenCV and Net5
- Open a video file π₯ and save each frame as a PNG πΌ file to a folderΒ π
- (Coming Soon) QR Codes detection on the π¦ camera feed using OpenCV and Net 5
hello Sir
I hope you are well. I am new to openCvSharp. I am facing a problem from past couple of days and the problem is i am able to capture a video from device but absolutely no video from file may it be a mp4 or a sdp.
using
OpenCvSharp 4.6 version
OpenCvSharp.runtime.win 4.6
I have installed latest OpenCV 4.7 on my System my OS is windows. I have added its path to bin folder path to my system and Enviromental variables.
visual studio 2019. i am sharing my code,
namespace cvsharpwebcam
{
public partial class Form1 : Form
{
VideoCapture capture;
Mat frame;
Bitmap image;
public string _videoFile = “d:\video.mp4”;
public Form1()
{
InitializeComponent();
frame = new Mat();
}
Above is my whole code which works fine for my videocapture from webcam but not from file.
can you kindly guide me what I am doing wrong. Why videocapture is not working for files. I am clueless . please please any help will be greatly appreciated.
i will be truly grateful.
Best Regards,
Sarah
LikeLike