This may be a dumb question but I'm having a hard time conceptualizing what I need to do here...In the past I've used DirectShow to connect to a camera and capture an AVI using a source filter, AVI mux, compression filter, run the graph, etc...piece of cake. In this particular case I am getting notified when my non DirectShow camera driver has a buffer ready. I get notification and then I go and grab the BYTE* and render it using GDI. I now also need to create an AVI with these buffers. Conceptually it makes sense for me to use something like vfw and write to an AVI stream every time I receive a buffer, of course vfw is old technology and I was also having some problems getting that to work (as I posted in a different forum). How can I push these buffers into a DirectShow AVI Mux and write to a file? Do I have to create my own source filter to receive these buffers, then add my source filter and avi mux to a filter graph? Thanks for any tips
Asked
Active
Viewed 989 times
1 Answers
2
So you have BYTE*
with video frame data. It is very close to what you supposed. Your choices are to either use VFW AVIFileOpen
and friends to write into AVI
file, or inject data into DirectShow pipeline. To do the latter, you typically make your PushSource-like filter and push video frames from there (through AVI Mux to File Writer).

Roman R.
- 68,205
- 6
- 94
- 158
-
Thanks Roman. I will look into creating PushSource filter. Though I think I prefer using VFW, it seems like less work. I tried but was having problems with VFW,described here [Problems creating AVI](http://stackoverflow.com/questions/9106347/avi-created-with-avistreamwrite-has-incorrect-length-and-playback-speed). I'll keep plugging away. Thanks! – mash Feb 03 '12 at 14:00
-
1If your video is already compressed, then to write into AVI file you would be better off with `Video for Windows` (after all you don't need to even touch filters). If you yet need to compress (and yet to choose suitable compressor) and/or merge with audio, then perhaps `DirectShow` would be a better choice. – Roman R. Feb 03 '12 at 14:03
-
Yes I agree with you, I was looking into compressing the video in vfw and it seems like it would just make sense to use DirectShow if I need to compress. I'm going to work on both methodologies to get them working properly. If you have any thoughts on my VFW issue mentioned in my previous post I would appreciate it. Otherwise thanks very much for your help. – mash Feb 03 '12 at 15:19