如何从编码网络摄像头视频H.264将在C#中? [英] How to encode Video from Web-Camera into H.264 in C#?

查看:170
本文介绍了如何从编码网络摄像头视频H.264将在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何从编码网络摄像头视频H.264将在C#中?

How do you encode video from Webcam into H.264 in C#?

我需要做什么


  • MSDN如果有任何帮助。

  • 开启源代码libs /编码/解码包装。

  • 教程和怎么做博客文章。

的如何编码成3GP或FLV或低文件大小别的一些例子将超过赞赏。

Some examples of of how to encode into 3GP or FLV or something else with low file size would be more than appreciated.

推荐答案

您需要考虑的DirectShow SDK。

You will need to look into DirectShow SDK.

编码到H.264是直接不可能的,但也有商业的ActiveX控件,可以帮助你。但你需要了解一些东西,

Encoding into H.264 is directly not possible, however there are commercial activex controls that can help you. But you need to understand few things,

DirectShow是音频/视频处理框架,你可以使用图形编辑工具将在图形上的设备并对其进行测试。而且你必须写类似的代码来构建图形,图形是设备/彼此相互作用,产生最终的输出对象链。

DirectShow is audio/video processing framework, and you can use graph edit tool to put your devices on the graph and test it. And you have to write similar code to build graph, graph is chain of devices/objects that interact with each other to produce final output.

DirectShow中可以在.NET中使用,你可以使用GraphEditPlus工具来创建一个图形,并在.NET中使用它,但是我怀疑.NET是更好的办法,因为这可能导致未知的错误,DirectShow是息息相关至COM。如果创建ActiveX控件,在本地C ++和使用DirectShow做整个记录和您使用ActiveX WPF中,这将是程序更稳定多么困难。

DirectShow can be used in .NET, you can use GraphEditPlus tool to create a graph and use it in .NET, however I doubt .NET is better way because it may lead to unknown errors as DirectShow is closely bound to COM. If you create ActiveX control, in native C++ and use DirectShow to do entire recording and you use ActiveX in WPF, that will be more stable however difficult to program.

通常你需要如下,

Video Source => Demux -> Audio Stream + Video Stream -> MP4Muxer



X264是免费开源的,并具有良好MP4Muxer但不合法的,你必须有专利许可获得在你的代码中使用H264。

x264 is free open source and has a good MP4Muxer but not legal, you must have patent licenses acquired for using H264 in your code.

替代品,你可以有很多的商业控件去,英特尔IPP是H264的最佳实施至今,但其有点棘手放它DirectShow中。

Alternatives are you can go with lots of commercial controls, Intel's IPP is the best implementation of H264 so far, but its little tricky to put it in directshow.

这篇关于如何从编码网络摄像头视频H.264将在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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