I have a .Net application which renders graphics using GDI+ and/or XNA and I want to record the frames directly into a video (preferably an AVI, where I can include a codec like xvid etc). I’ve tried many of the solutions out there, and run into show stoppers with all of them.
All of the FFMPeg based libs seem to be dedicated to transcoding an existing stream, not so much generating a new one from frames.
There is a .Net lib called Splicer on codeplex, but from what I can tell it is more geared towards building a “slideshow” because it takes each frame and stores it on the HD. The directshow solutions behave the same way.
Then there is the AVIFile wrapper, which is almost exactly what I need. The only problem is that when you start a new encoding it pops up (and sometimes UNDER!?) a dialog box. The dialog isn’t a problem for normal use, but I also need this to run as a service, so mandatory UI is obviously a show stopper.
Anyone know of another option that is relatively .Net friendly, or am I just asking too much?
I don’t know which AVIFile wrapper you’re using, but I believe AviFile is probably calling AVISaveOptions to get an initialized AVICOMPRESSOPTIONS struct. You can just initialize AVICOMPRESSOPTIONS yourself. Most members in AVICOMPRESSOPTIONS are pretty easy. lpParms and cbParms contain a block (cbParms = length of block) of binary codec configuration data. You can get this data calling ICGetState.
It should be a fairly simple change to your native AVIFile and your wrapper should still work.
Have a look at this sample for how to init AVICOMPRESSOPTIONS.