Featured post
Getting IP Cam video stream on Android (MJEPG) -
i doing andar project in group of 3. i'm person who's in charge of video streaming android phone. got ourselves d-link dcs-920 ip camera , found out uses mjpeg codec live video stream , webserver uses jview view live stream. far know mjpg not supported file type android os i've came out idea, instead of using imageview, use webview stream video. i've implemented simple concept , works! problem is, refresh rate terrible. video image (eg: http://192.168.1.10/image.jpg
) view on webview , implement timer control refresh rate (supposed set 30fps, refresh every 33ms) can go 500ms interval, lower interval notice not smoother,sometimes image wont load , connection unstable (eg: dropped). i'm refreshing @ rate faster can receive? on over webserver jview has no problem! trying find source code jview have no hope. anyway here's code i've written
package org.example.test; import java.util.timer; import java.util.timertask; import android.app.activity; import android.os.bundle; import android.view.view; import android.webkit.webview; import android.widget.button; import android.widget.edittext; public class webview extends activity { public webview webview; public timer autoupdate; public string url; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview = (webview) findviewbyid(r.id.webview); webview.getsettings(); final edittext urltext = (edittext) findviewbyid(r.id.urltext); //buttons//////////////////------------ final button connectb = (button)findviewbyid(r.id.connectbutton); connectb.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { //actions goes here url = urltext.gettext().tostring(); webview.loadurl(url); timersetup(); } }); final button exitb = (button)findviewbyid(r.id.exitbutton); exitb.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { //actions goes here finish(); } }); } //refresh timer//////////////----------------- public void timersetup(){ autoupdate = new timer(); autoupdate.schedule(new timertask() { @override public void run() { runonuithread(new runnable() { @override public void run() { //actions goes here webview.loadurl(url); } }); } }, 0, 500);//refresh rate time interval (ms) } }
is there anyway can video stream in @ least 15fps/have faster refresh rate? there such thing mjpeg viewer/source code can use display these images?
here's screenshot of app http://s945.photobucket.com/albums/ad295/kevinybh/?action=view¤t=video.jpg (not enough points post pictures) :(
i need make video stream around 15-30fps. suggestions/help appreciated :) thanks!
instead of arduino use raspberry pi, should have enough cpu power control vehicle , convert video stream @ same time. sure, you'll need port of arduino software raspberry...
- Get link
- X
- Other Apps
Comments
Post a Comment