I'm a little unsure of the exact problem you're trying to solve. It sounds like you want to encode mpg,avi,wmv files into DV AVI type 1 and you want to use ffmpeg as part of the solution.
There are Microsoft DV Video Encoder and DV muxer DirectShow filters that will combine video and audio into the single video+audio DV stream needed for type 1 DV AVI.
I'm not very familiar with ffmpeg but I'm not sure why you need it for your particular problem. DirectShow can handle a wide variety of input formats. It seems from the FAQ that ffmpeg can get input from a DirectShow filter but not write data to a DirectShow filter.
It would be simplest to do the conversion with DirectShow alone without ffmpeg:
- Create a DirectShow graph (CoCreateInstance getting IGraphBuilder).
- Create a source filter from your input file (IGraphBuilder::AddSourceFilter)
- Create a DV encoder filter (CoCreateInstance)
- Add the DV encoder filter to the graph (IFilterGraph::AddFilter)
- Connect the video source pin to the dv encoder (IGraphBuilder::Connect)
Then similarly:
- Connect a new dv muxer to the output
of the dv video encoder and the audio
ouput from the source filter (you may
need an intermediate filter to
compress the audio into the right
format).
- Connect the output of the dv
muxer to a new avi mux filter.
- Connect the output of the avi mux to
a new file writer filter set up with
your destination file.
- Run the graph using IMediaControl and IMediaEvents to convert your input file to your output file.
If I've misunderstood your question then you should be able to construct a different graph that will convert to or from DV AVI type 1 or 2. For writing type 2 you wouldn't need to use the dv muxer.
All of this can be easily tested in advance using GraphEdit or similar tools before writing any code. GraphEdit is available with the Windows SDK. GraphStudio is one open source alternative but there are others too. For development purposes you could also construct a graph in GraphEdit or similar and then load it and run it in your own test application (see http://msdn.microsoft.com/en-us/library/dd390649(v=vs.85).aspx)
For some basic getting started information see:
- The Wikipedia page on DirectShow
- How can I learn a DirectShow programming?
- Where can I find a thorough DirectShow tutorial?