简体   繁体   English

如何结合实时视频和音频进行流媒体播放

[英]How to combine live video and audio for streaming

I want to stream live video and audio over ip on c#. 我想在c#上通过ip流式传输实时视频和音频。 The audio and video come from a webcam and Will be sent in rtp protocol. 音频和视频来自网络摄像头,将以rtp协议发送。 My idea is to capture the audio with naudio encode it with g711 and send it on port X, Capture images with rate of 20/25 fps from the webcam, do some encoding(dont know which kind yet..) and send it on port Y. My question is: is this way is the right one for streaming live video and audio? 我的想法是使用naudio用g711对其进行编码并将其发送到端口X,从网络摄像头以20/25 fps的速率捕获图像,进行一些编码(不知道哪种类型......)并将其发送到端口Y.我的问题是:这种方式是流媒体直播视频和音频的合适方式吗? Is there is a way to combine both video and audio to the same packet and send it on the same port? 有没有办法将视频和音频组合到同一个数据包并在同一个端口上发送?

This is a clear case of "Built or Buy". 这是“建造或购买”的明显案例。 I wouldn't built something like this. 我不会建造这样的东西。 It's full of technical pitfalls and very (very) questionable if a single developer, as intelligent as he might be, should even try to implement that from scratch. 如果一个开发人员尽可能聪明,他甚至应该尝试从头开始实现它,那就充满了技术上的陷阱和非常(非常)可疑的问题。 It's far better to find an open-source solution that does the dirty work for you. 找到一个为您完成脏工作的开源解决方案要好得多。 Your question will then be secondary and solved by configuring the package accordingly. 您的问题将是次要的,并通过相应地配置包来解决。

What comes to my mind is this: how to embed vlc media player into my c# windows form app? 我想到的是: 如何将vlc媒体播放器嵌入到我的c#windows窗体应用程序中?

At least look at this route, it might be a much quicker way to accomplishing your final objective. 至少看看这条路线,它可能是一个更快的方式来实现你的最终目标。

Your problem doesn't sound that complicated,and is easily doable. 你的问题听起来并不那么复杂,而且很容易实现。 You have separate audio, and video streams, and you want to combine them and stream it, right ? 您有单独的音频和视频流,并且您希望将它们组合并流式传输,对吧?

Simplest way will be to use either windows media encoder or adobe media encoder. 最简单的方法是使用Windows媒体编码器或adobe媒体编码器。 Windows media encoder do have the additional capability of streaming the video straight, without a streaming server involved. Windows媒体编码器确实具有直接流式传输视频的附加功能,无需涉及流媒体服务器。 You can select your webcam as 'source video' and select any microphone as 'audio source', and windows media encoder will combine both of them, and create a stream for you, which can be watched live by anyone, or could be pushed to a streaming media server for relay broadcasting. 您可以选择网络摄像头作为“源视频”并选择任何麦克风作为“音频源”,Windows媒体编码器将两者结合起来,并为您创建一个流,可以被任何人现场观看,或者可以推送到用于中继广播的流媒体服务器。

Link to wme http://www.microsoft.com/en-in/download/details.aspx?id=17792 链接到wme http://www.microsoft.com/en-in/download/details.aspx?id=17792

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM