How to Live stream with HTML5, without Flash?

爱⌒轻易说出口 提交于 2019-12-21 03:42:29

问题


The Problem: I need my clients to be able to stream their webcam to my streaming server(for instance Wowza server). I am building my site in PHP. I have gone through various streaming sites like twitch.tv, livestream.com and found that they all use third party broadcasting software like Wirecast, XSplit broadcaster, OBS etc to stream the Webcam feeds to the server. Then I came across sites like vLine, Opentokrtc that uses WebRTC for Video chat.

My Question: So, my question is that, is it possible for me to send the stream to the broadcasting servers like Wowza(So that they can then broadcast my live stream) without using broadcasting softwares with only WebRTC? If Yes, then how? If, No, then what are the other alternatives?

PS. I don't want to use Flash, ActionScript here.


回答1:


You will basically need a server which has a pseudo WebRTC client integrated in it. WebRTC can get the stream but cannot start streaming until a PeerConnection is setup. You can try using various servers/gateways like Janus, Kurento, Licode, FreeSwitch, etc.

Also MediaStream generate by WebRTC can be directly attached to an HTML5 <video> tag.




回答2:


Using WebRTC for such a use case incurs a high computing cost on the server side and is a rather new technique, which means you should be using it if you know what you are doing.

My suggestion would be to stick to Flash or MPEG-DASH instead - unless what you need must have a very low latency to it and you are fine with paying for it by smaller solution scales.




回答3:


Unless I misunderstand, I think you're looking to stream video to your server (for distributing using "normal" live-streaming mechanisms), not using WebRTC to stream video from the server.

If so, WebRTC will work, though you'll need a server-side implementation of a fairly full set of the WebRTC protocol including video decoding. These exist, but not in PHP directly of course. This would handle getting realtime audio and video from a client, without needing a plugin on the client, including bandwidth adaptation and error correction.

Once the data is decoded on the server, you have a video+audio datastream you can feed to your live-streaming encoders to stream out.




回答4:


Wowza does support what you need in order to become the other peer in your WebRTC scenario. From there you can redistribute the stream in whatever way media servers typically do.

This feature is still in "Preview" mode and has some limitations, but does function for most cases. You can request access to this via https://www.wowza.com/products/capabilities/webrtc-streaming-software



来源:https://stackoverflow.com/questions/31355533/how-to-live-stream-with-html5-without-flash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!