[.net] Video capture

Started by
3 comments, last by DrGUI 18 years ago
Does anyone know of any code examples to split a mpeg video into seperate frames and save them as jpgs? or alternatively grab frames from a webcam at least 30 times a second? I have found code to do this but it either only runs at 15 fps or uses the ridiculously bloated directshow which needs over 400 lines of code!!!! I can't believe there is not a simple way to do this in this age of the webcam and video calls! I could probably do with the first example more than the second as this would mean that I could video with a far superior Camcorder and get the frames from the mpeg. Speed of capture is very important as I am filming high speed action. I am programming this in c# 1.1 but code in 2.0 would be fine as I am moving over to this soon anyway. note, I do not necessarily need to display the video I just need to split it into frames. Thank you in advance.
Advertisement
I'm sure there was some library on CodeProject; sorry I don't have time to look for you now, gtg in like 2 seconds. Try searching for 'video'.
VirtualDUB might do what you're looking for.
Rob Loach [Website] [Projects] [Contact]

you have two options that I can think of.

You either use DirectShow. DirectShow is a very complex api, yes, however it's complex for a reason, that being that media playback is a very complex thing to do. However that doesn't mean playing a media file is complex, the api actually makes it fairly simple, it's just if you account for everything that may go wrong (and there is a lot) things do get bloated. You will probably find the sample you have is accounting for every possibility.

Unfortunatly microsoft does not fully support directShow in managed directx. This I don't blame them for.
However there are .net wrappers avaliable. Check codeproject here.

You might notice I said 'fully'. There is, however, Microsoft.DirectX.AudioVideoPlayback. Unforunatly, from what I can tell, there is no way to get the image data from this set of classes as they are designed for use with direct3D (you could, however, take the video texture it provides, render it to a dynamic texture, lock the dynamic texture and read back the pixel data, but I would not recommend this approach).
This was it :) Hope that helps

This topic is closed to new replies.

Advertisement