2013-04-22 84 views
0

我想通過我的本地網絡流動我的攝像頭生活到一個android VideoView。視頻顯示,但經過了15-20秒的滯後。 VLC流媒體設置: usgin HTTP Enacpsulation:MPEG-TS 視頻編解碼器:H-264 分辨率:640×480 碼率:我不斷地改變它試圖找出一個合適的。 VLC輸出字符串:VLC攝像頭流到Android滯後

:sout=#transcode{vcodec=h264,vb=2000,fps=30,scale=1,width=640,height=480,acodec=none}:http{mux=ts,dst=:8080/stream} :sout-all :sout-keep 

的Android VideoView代碼:

VideoView view1 = (VideoView) findViewById(R.id.videoView1); 
getWindow().setFormat(PixelFormat.TRANSLUCENT); 

MediaController mc = new MediaController(this); 
mc.setMediaPlayer(view1); 

view1.setMediaController(mc); 
view1.setVideoURI(Uri.parse("http://192.168.1.101:8554/stream")); 
view1.requestFocus(); 
view1.start(); 

我也到處去尋找這個問題,但似乎無法找到解決的辦法,所以任何建議將高度讚賞:)

+0

沒有人幫忙? :) – nick28 2013-04-23 17:59:12

回答

0

我對VideoView並不熟悉,但是當VLC在端口8080上流式傳輸時,爲什麼您的代碼引用端口8554?

我建議將您的GOP size設置爲something around 120--sout-x264-min-keyint <integer>)作爲測試的起點。

+0

這篇文章可能會幫助你更接近你要去的地方... http://stackoverflow.com/questions/1762063/vlc-desktop-streaming?rq=1 – 2014-04-16 17:29:49