Programmatically add AVI file header to video stream

旧巷老猫 提交于 2019-12-11 15:04:22

问题


I have a capturing device (analogue to digital converter: AverMedia USB Capture Card). When I want to record video using DirectShowLib in C#, I only receive frames. I am able to record frames and play the file using RawVideo Player. How can I create a standard video file header like AVI? Second problem occurs when I want to compress the data. When I use compression, I can't read it at all.

Here is my working GraphEdit schema:

How can I create standard AVI or MPEG file with header and etc?


回答1:


The playable files have certain structure and captured data is typically written into such file through so called multiplexer filter. For AVI format, the standard filter is AVI Mux Filter. It takes video/audio on input and converts into file-compatible stream on the output. If/when this output is connected to File Writer Filter, the latter produces the file with proper headers.




回答2:


Take a look at this you should be able to use this to set up an Avi object, then AddFrame() with your frames to create an avi.



来源:https://stackoverflow.com/questions/15446975/programmatically-add-avi-file-header-to-video-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!