以编程方式将AVI文件头添加到视频流 [英] Programmatically add AVI file header to video stream

查看:97
本文介绍了以编程方式将AVI文件头添加到视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个捕获设备(模拟到数字转换器:AverMedia USB捕获卡)。
当我想在C#中使用DirectShowLib录制视频时,我只接收帧。我可以使用RawVideo Player录制帧并播放文件。如何创建像AVI这样的标准视频文件头?当我想压缩数据时会发生第二个问题。当我使用压缩时,我根本看不懂它。

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.

这是我工作的GraphEdit模式:

Here is my working GraphEdit schema:

如何创建带有标头等的标准AVI或MPEG文件?

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

推荐答案

可播放文件具有特定的结构,捕获的数据通常写入该文件中通过所谓的多路复用器滤波器。对于AVI格式,标准过滤器为 AVI Mux过滤器。它在输入上接收视频/音频,并在输出上转换为文件兼容的流。如果/当此输出连接到File Writer Filter时,后者将生成带有正确标题的文件。

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.

这篇关于以编程方式将AVI文件头添加到视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆