简体   繁体   English

通过服务器将视频从一个客户端传输到另一个客户端

[英]Stream video from one client to another client through a server

I am trying to send a video stream from one laptop to another laptop, and route it through a server.我正在尝试将视频流从一台笔记本电脑发送到另一台笔记本电脑,并通过服务器进行路由。 Lets call them laptop A sending a video stream to laptop B.让我们称它们为笔记本电脑 A,向笔记本电脑 B 发送视频流。

On laptop A, I have no particular requirement to how I collect the video stream, but I was thinking there would be some sort of NodeJS server running that opens a web socket to a server to send back the video stream.在笔记本电脑 A 上,我对如何收集视频流没有特别的要求,但我认为会有某种 NodeJS 服务器在运行,它会打开一个连接到服务器的网络套接字以发回视频流。

On laptop B, I'd like to render the video inside of a browser in a html5 video tag.在笔记本电脑 B 上,我想在浏览器中以 html5 视频标签呈现视频。

Does anyone have any suggestions on how this can be done technically?有没有人对如何在技术上做到这一点有任何建议?

The gaps I don't really understand are: * How to send a stream from laptop A to a server (which could also be running NodeJS) * How to provide a video stream that can be plugged into a video tag on laptop B我不太明白的差距是: * 如何将流从笔记本电脑 A 发送到服务器(也可以运行 NodeJS) * 如何提供可以插入笔记本电脑 B 上的视频标签的视频流

Thanks!谢谢!

Trying to do this with javscript/html5 is really to choose the wrong technology.试图用 javscript/html5 来做这件事,真的是选错了技术。 You should have a look on Flash (and RTMP) on the client side, and use any of the free (open source) Flash Media Server alternatives out there.您应该在客户端查看 Flash(和 RTMP),并使用任何免费(开源)Flash Media Server 替代品。 (You must have a plugin like Flash or Silverlight to get access to the webcam data - your web browser/javascript can not access the webcam.) (您必须有 Flash 或 Silverlight 等插件才能访问网络摄像头数据 - 您的网络浏览器/javascript 无法访问网络摄像头。)

node-rtmp is a RTMP protocol server written in Node.JS, that might be in your interest. node-rtmp 是一个用 Node.JS 编写的 RTMP 协议服务器,你可能会对它感兴趣。 I have not tested node-rtmp myself, but it can be a starting point for you.我自己没有测试过 node-rtmp,但它可以作为你的起点。 If it does not suite you, there are multiple other RTMP server projects out there.如果它不适合您,那么还有多个其他 RTMP 服务器项目。 (I have used Red5 a lot, which is in java.) (我用过很多 Red5,它是在 java 中的。)

On Computer A you would then need a Flash application that takes your webcam data and sends it to the RTMP server.在计算机 A 上,您需要一个 Flash 应用程序来获取您的网络摄像头数据并将其发送到 RTMP 服务器。 There are open source projects doing this already, for example: https://github.com/AF83/webcam-streaming There is also example code of such flash applications included in Red5, and possibly also in other RTMP server projects.已经有开源项目在这样做,例如: https : //github.com/AF83/webcam-streaming Red5 中也包含此类 Flash 应用程序的示例代码,可能也包含在其他 RTMP 服务器项目中。

You can not use the HTML video tag to display a RTMP stream on Computer B. If it is RTMP, then you will have to use a Flash player.您不能使用 HTML 视频标签在计算机 B 上显示 RTMP 流。如果是 RTMP,则必须使用 Flash 播放器。 It might be possible to convert the RTMP data to something else, to make it possible to show with a HTML video tag.可以将 RTMP 数据转换为其他内容,以便使用 HTML 视频标签进行显示。 It would (probably) be possible to do with a combination of Open Source Softwares like Red5, rtmpdump, ffmpeg and some http hacking to make it go over http.它(可能)可以结合使用 Red5、rtmpdump、ffmpeg 和一些 http hacking 等开源软件来使其通过 http。 However, I would really consider if it is worth the work and hassle to do that just for not running a Flash application...但是,我真的会考虑是否值得为了不运行 Flash 应用程序而这样做并且麻烦...

On Computer B, I would use jwplayer (or any of the jwplayer clones) to play the RTMP stream.在计算机 B 上,我将使用 jwplayer(或任何 jwplayer 克隆)来播放 RTMP 流。

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

相关问题 无法通过flask-socketIO服务器在HTML客户端中显示来自python客户端的视频流 - Cant display my video stream from a python client in the HTML client through a flask-socketIO server 有没有办法在没有 WebRTC 的情况下从客户端 A -> 服务器 -> 客户端 B 的 stream 视频进行一对多广播? - Is there a way to stream video from client A -> server -> client B for one-to-many broadcast without WebRTC? 我可以通过Web RTC将视频从一个客户端流传输到另一个客户端吗? - Can I stream a video from one client to another via Web RTC? 如何从客户端到 flask 服务器并返回客户端的 stream 实时视频帧? - How to stream live video frames from client to flask server and back to the client? 将视频的一部分流传输到客户端 - Stream part of the video to the client 如何从Node.js服务器流到客户端 - how to stream from nodejs server to client 客户端可以“等待”来自服务器的流吗? - Can a Client "await" for a stream from a Server? Stream 音频从客户端到服务器到客户端使用 WebSocket - Stream audio from client to server to client using WebSocket 客户端和服务器在一个应用程序中 - Client and Server in One Application 如何通过ajax从javascript服务器获取换行符并在客户端中执行? - how to get newline from server through ajax as javascript and execute it in client?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM