简体   繁体   English

HTTP流桌面到浏览器的巨大延迟

[英]Huge latency in HTTP streaming desktop to browser

I'm trying to put together a reliable, reasonably low (<2s) latency desktop window share to browser solution. 我正在尝试将可靠的,合理的低延迟(<2s)桌面窗口共享共享给浏览器解决方案。 Currently I have: 目前我有:

client sender using FFMPEG: 使用FFMPEG的客户端发件人:

ffmpeg -f gdigrab -i "title=notepad.exe" -r 10 -framerate 10  -c:v libx264 -g 50  -preset fast -tune zerolatency -f rtp rtp://192.168.1.85:1234

server re-stream to HTTP using VLC: 服务器使用VLC重新传输到HTTP:

vlc -vv test.sdp  --sout=#transcode{vcodec=theo,vb=1600,scale=1,channels=1,acodec=none}:http{dst=:8080/webcam.ogg} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep 

where the sdp file is generated from the output of the ffmpeg command 从ffmpeg命令的输出生成sdp文件的位置

Client browser: 客户端浏览器:

<video  id="video" autoplay loop muted preload="auto">
<source src="http://192.168.1.85:8080/webcam.ogg" type="video/ogg"/>
</video>

This works and gives good quality. 这有效,并提供良好的质量。 But the latency is terrible (around 10s) and I'm at a loss to know how to tune it. 但是延迟非常糟糕(大约10秒钟),我不知所措,不知道如何进行调整。 I know that the latency is in the VLC transcoding/restreaming - displaying the RTP stream from the client on the server only has around 1s lag. 我知道延迟是在VLC转码/流传输中-在服务器上显示来自客户端的RTP流只有大约1秒的延迟。

I guess there are two questions - can this approach be sensibly tuned, or is the approach wrong to start with? 我猜有两个问题-这种方法是否可以合理地调整,或者这种方法一开始是错误的?

Sub 2 second over http is near impossible. 低于2秒的HTTP几乎是不可能的。 Latency can be reduced, but you probably need to change out you http origin software, switch delivery to chunked transfer, optimize your encoding pipeline, and manage your player buffer. 可以减少延迟,但是您可能需要更换http原始软件,将交付切换为分块传输,优化编码管道并管理播放器缓冲区。 Even then I doubt you will get to 2 seconds. 即使那样,我仍然怀疑你会达到2秒。

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

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