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
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).
Related
I'm creating avi videos from device dependent bitmaps, DDB's.
The pipeline is quite simple, a GigE camera provides frame by frame, and each frame, a DDB, is piped to a ffmpeg process creating a final AVI file, using h264 compression.
These videos are scientific in nature, and we would like to store/embed experimental hardware information, such as the states of a few digital lines, with each frame.
This information need to be available in the final avi video
Question is, is this possible?
Looking at this: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmap it does not seem that adding additional data to the DDB themselves is possible, but I'm not sure.
I would like to render a video stream from a gstreamer pipeline into a directshow one. I was wondering if I had to write a directshow filter source getting data from the pipeline or if it was simpler? If I have to, I don't really see where I could get an idea of what to do.
I have got a directshow source filter which is based on http://tmhare.mvps.org/downloads/vcam.zip. I want to write the webcam frames that has been manipulated using opencv by my (separate) application, to this virtual webcam (Directshow filter). How can I do this?
Any helpful code snippets please?
A good practice for manipulating frames in Directshow is adding a SampleGrabber filter after your source filter. see
The SampleGrabber purpose is to manipulate frames.
I'm writing a program in C++ using DirectShow API in order to accelerate video encoding part. This program should read video stream from Video Capture Card, and pass it to the encoder, without intermediate raw data file which is usually passed.
But encoder is not my software, in fact, it was bought.
This encoder used to accept a raw data file with it's details and give an encoded file as an output. So I've decided to read video stream from Video Capture Card, save it to some buffer, and when the size of a buffer is appropriate (appropriate is specified in encoder) pass it to encoder.
But I'm new to DirectShow as well as to a whole multimedia programming, so what I'm asking is an advise about a function to use to read a stream, or about total solution, or any useful links.
Thanks in Advance
EDIT 1: What I meant by Accelerate is to read video stream in encoder directly, instead of creating intermediate YUV file and making encoder to read YUV file.
What's the most recommended way to go?
This is a pretty big topic. Try looking at OpenCV. It is nice for image and video manipulation, and you can stream video from files and webcams.
Take a look at DirectX "Filter Graphs". You can use a simple tool from the DirectX SDK called 'Graph Edit' to construct a sequence of DirectShow Filters which can do things like capture video streams from a TV card or decode an MPEG/AVI file and then operate on the data stream and ultimately render it to video/audio or a file.
Most of the DirectShow samples are in VC++.