开发者

Convert to DV AVI Type-1 video

I'm working on a project that requires converting mpg,avi,wmv formats. A vendor requires the format to be in DV AVI Type 1. This is a format that Windows Movie Maker offers during capture off your camcorder.

I need this format for some vendor tools that assume that the user is capturing the data off the device, or that the import of an existing file is in this format.

I know of t开发者_Python百科hese 2 tools that do it, but I'm looking to incorporate a stand-alone library / command line interface so that I can wrap the encoding process in my own application.

http://paul.glagla.free.fr/dvdate_en.htm http://www.stoik.com/products/video/STOIK-Video-Converter/

Last time I checked FFMPEG does NOT support this conversion... just the reverse from DV AVI1 to DV AVI2.

I've read through this resource, but don't know how this could be incorporated into ffmpeg http://msdn.microsoft.com/en-us/library/dd388641(v=VS.85).aspx

Has anyone tried to convert from format X to DV AVI Type 1 ?


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.

  • http://msdn.microsoft.com/en-us/library/dd388645(v=vs.85).aspx
  • http://msdn.microsoft.com/en-us/library/dd388642(v=vs.85).aspx

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜