Android的VideoView RTSP延迟 [英] Android VideoView RTSP delay
问题描述
我在我的Android应用程序通过VideoView打开一个IP摄像机的RTSP流。目前,它已经到达20多秒的巨大延迟问题!虽然从通过其浏览器中的普通的PC观看相机不存在这样的延迟。任何想法吗?
我的code:
字符串路径=RTSP://192.168.1.20/3gpp
myVideoView.setVideoURI(Uri.parse(路径));
myVideoView.setMediaController(新的MediaController(本));
myVideoView.requestFocus();
myVideoView.start();
使用MJPEG流,而不是RTSP。经过大量的研究,从来就发现,在实时播放近实时流的MJPEG浏览器类(取决于您的网络连接)。
Here's的code Android和MJPEG
I am opening a RTSP stream of an IP camera in my Android application through VideoView. There is a problem that It has a great delay that reaches more than 20 seconds! although viewing the Camera from an ordinary PC via its browser there is no such delay. Any Ideas please?
My Code:
String path="rtsp://192.168.1.20/3gpp";
myVideoView.setVideoURI(Uri.parse(path));
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
Use MJPEG stream, instead of RTSP. After lots of research, I´ve found an MJPEG viewer class that plays live stream near in real time (depending on your network connection).
Here´s the code Android and MJPEG
这篇关于Android的VideoView RTSP延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!