If video is really turning into a big problem for people in the Managed
world speak up. I'd be happy to sit down and write up a couple of tutorials
surrounding the kinds of things I've done with video. I'm guessing most
people haven't put a large amount of time into examining video since the
time to place it in an application versus the pay-off isn't spectacular.
I'd be curious to see what you've done. I wrote a screensaver to show both
my jpg's and avi's from my camera (can be found here:
http://www.mag37.com/projects/screensaver/ - plug, it also does all kinds
of other things including rotating and skipping files)
I spent a lot of time trying to get the Video class to play nicely with
GDI+. That is, after playing a video, I needed to Dispose the video object
so that I could use the screen for Graphics.DrawImage calls.
My first problem was how to call Dispose for a video class. Ideally, I
would do it as a result of the Ending event. However, if I actually put a
call to Dispose in the Ending event handler function, then I'd get terrible
exceptions when my method returned (and the "calling" video class that
called my event was suddenly disposed). So instead I set a timer in the
Ending event, and had that timer dispose the Video class.
Later, when I wanted to mute the audio of the video class, I ran into more
problems. It turns out you can't even look at the Audio property of a Video
class without screwing it up. I got workarounds to get the Ending event to
fire again. But video.Dispose() still doesn't work if you do
video.Audio.anything.
I finally went to two separate forms - one for Graphics.DrawImage and one
for Video playing, with the two forms being made visible or not as needed.
I still have sporadic errors popping up when I close my application, if I
have avi video files play.
I'd like a more elegant solution - thought maybe DirectShow might work
better, but haven't gotten around to it yet.
I'd be happy to work with you on tutorials and post and/or give you some of
my code and workarounds - especially for dealing with Audio in a Video
class. Although a lot of my code is specific to trying to handle both video
and images.