如何连接code /德code视频使用C#? [英] How to encode/decode video using C#?

查看:163
本文介绍了如何连接code /德code视频使用C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个小的背景下,我得到了固定的几个小的错误和维护该解决方案为我们的应用程序的两个实例之间通过网络视频流的任务。该解决方案是由人谁是这里不再所以在code,以及一些很有趣的陷阱一些神秘感。该解决方案是用ffmpeg的用C ++ code写来包装编码/解码关联code,以及一些流code写的。此的C ++然后用SWIG缠绕以便它能够互操作用C#,并通过在视频帧上在那里它们被使用 VideoRendererElement 的呈现哪些生活在一个WPF控件。帧传递了主要的原因是因为我们有我们需要在发送视频数据的一些自定义的协议和那些正在使用C#这样的视频帧传递了我们总结他们在我们自己的数据包,并把他们派出上线写。该解决方案的工作,我们可以用我们的自定义协议,但它是值得的噩梦,以保持工作与视频流。

A little background, I was given the task of fixing a few "small" bugs and maintaining this solution for streaming video across the network between two instances of our application. The solution was written by someone who is no longer here so there is some mystery in the code as well as some really fun pitfalls. The solution was written using ffmpeg with C++ code written to wrap the encoding/decoding related code as well as some of the streaming code. This C++ was then wrapped with SWIG so that it could interop with C# and pass the video frames up where they are rendered using VideoRendererElement which lives in a WPF control. The main reason the frames are passed up is because we have some custom protocols we need to send video data over and those are written using C# so as the video frames are passed up we wrap them in our own packets and send them out on the wire. This solution works and we can stream video using our custom protocols though it is something of a nightmare to maintain and work with.

我的问题是,有没有更好的方式来进行此事?我正在寻找的方式在一个较低的水平与视频数据进行工作(在C#),这样我可以把视频帧并将其打包在我们自己的数据包并将其发送出去,并能接收和重建在视频另一边。 FFMPEG似乎是共同的解决办法,但我已经遇到了很多与它的GPL / LGPL的事情,我认为这是一个问题的问题。

My question is there a better way to go about this? I'm looking for ways to work at a lower level with the video data (in C#) so that I can take the video frames and package them in our own packets and send them out and be able to receive and rebuild the video on the other side. ffmpeg seems to be the common solution but I've run into a lot of issues with it and the GPL/LGPL thing I think is a problem.

基本流程我期待实现, 视频文件 - >连接code - >包装在包 - >寄过来线的协议,X - >得到的数据包的视频数据 - >去code - >渲染/保存到磁盘

The basic flow I'm looking to achieve, video file -> encode -> wrap in packet -> send over wire on protocol X -> get video data from packet -> decode -> render / save to disk

推荐答案

DirectShow是你的朋友。 DirectShow是由大多数的窗户多媒体的应用,如媒体播放器,音频恩codeRS,等等低电平层

DirectShow is your friend. DirectShow is the low level layer used by most of the windows "multimedia" applications like Media Player, Audio Encoders, and so on.

即使这个库已为本地开发者可以从托管世界感谢DirectShow.net访问它。 http://directshownet.sourceforge.net 这是一个众所周知的和稳定的DirectShow托管的包装

Even if this library has been made for native developers you can access it from the managed world thanks to DirectShow.net. http://directshownet.sourceforge.net This is a well known and stable managed wrapper for DirectShow.

您需要做的唯一的事情就是学习一点点的DirectShow了解graphes和过滤器的概念,然后创建自己的过滤器和graphes,利用DirectShow的力量!

The only thing you have to do is to learn a little bit DirectShow to understand the concept of graphes and filters and then to create your own filters and graphes to use the power of DirectShow !

这篇关于如何连接code /德code视频使用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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