简体   繁体   English

Android直播视频流延迟

[英]Android live video streaming delay

I'm trying to play an axis video stream over rtsp in a VideoView on my HTC Desire HD. 我正在尝试在HTC Desire HD的VideoView中通过rtsp播放轴视频流。 Currently there is a delay of 7 seconds on the video when I play it on the HTC Desire HD. 目前,当我在HTC Desire HD上播放视频时,视频会延迟7秒。

Is there a way to reduce this delay? 有没有办法减少这种延迟?

I have tried to play the video stream on my computer with vlc and it works with a delay of 0,5 seconds. 我试图用vlc在计算机上播放视频流,并且它的延迟为0.5秒。 When I reduced the framerate, bitrate and resolution the delay still stays at 7 seconds. 当我降低帧率,比特率和分辨率时,延迟仍然保持在7秒。 I have tried functions as prepareasync and seekto but I could not get them to work. 我已经尝试过将函数用作prepareasync和seekto,但是无法使其正常工作。

Has anyone got live video working with the VideoView wrapper or the MediaPlayer? 有没有人使用VideoView包装器或MediaPlayer获得实时视频?

As far as I can tell from looking through the Gingerbread (Android 2.3.3) source code implementing MediaPlayer (which VideoView is based on), there is no way to change the buffer settings. 据我从实现MediaPlayer的Gingerbread(Android 2.3.3)源代码(VideoView所基于的代码)来看,无法更改缓冲区设置。 MediaPlayer seems inherently designed for playback, where gaps and errors must be avoided at all costs. MediaPlayer似乎是为播放而设计的,必须不惜一切代价避免间隙和错误。 For live streaming like video chat, low latency is more important than gaps and errors. 对于像视频聊天这样的实时流媒体,低延迟比差距和错误更为重要。

There is currently an effort to port GStreamer to Android, which should provide tools for doing low-latency video streaming. 当前正在努力将GStreamer移植到Android,这应该提供用于执行低延迟视频流的工具。

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

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