Shine Kay
Shine Kay

Reputation: 51

open a video in C# and iterate into frames and save the processed frames as another video

I am trying to open a video in my application to process on the frames and then save the results into another video. I used OpenCV (Emgu) for my image processing with no issues. But I cannot use it properly for processing videos as it pops "Access Violation" exception from time to time. Also I want to keep the audio track of the video for the output. So I just want to iterate through the frames in simple C# code and use my Emgu function on each frame.

These are desirable for my app:

  1. Keeping the audio
  2. Video codec/compression support
  3. Fast performance

Upvotes: 4

Views: 3021

Answers (1)

Luca Del Tongo
Luca Del Tongo

Reputation: 2702

Opencv is a library mainly for Computer Vision stuff and so there's no built-in function that let you process audio data. There's a similar question with a solution here on stackoverflow: Adding audio to video produced from OpenCV

To take advantage of FFMPEG and it's related softwares take a look here: http://opencv.willowgarage.com/wiki/FFMPEG

The Access Violation error you are facing using Emgu may be related to some emgu or opencv bugs, the 2.2 version has some known with video saving.

Upvotes: 2

Related Questions