Android Camera RTSP/RTP Stream? -


how can send android camera video using rtp/rtsp , play in pc(using vlc or other player).

i googled , found 2 answers:

1) using mediarecorder (http://sipdroid.org/ using videocamera.java)

how work tried no result :(

2) using previewcallback() - onpreviewframe(data, camera) method.

by using sipdroid's (rtppacket,rtpsocket,sipdroidsocket) able send rtp packets containing each frame data , able catch via wireshark.

but not able play packets in vlc :(

this code:

mcamera.setpreviewcallback(new previewcallback() {           public void  onpreviewframe(byte[] data, camera camera) {             int width= 320;             int height=240;             eth=getinterfaces();             log.v("connected ","ethernet"+eth);                   if(eth!=null){             try{                                       inetaddress serveraddr = inetaddress.getbyname("ip address of pc");                            log.v("trying ","connect with"+serveraddr);                             sipdroidsocket soc = new sipdroidsocket(9954);             log.v("trying ","connect sipdroid socket");                             soc.connect(serveraddr, 9954);                                            log.v("socket ","connected");                                            rtppacket rtpp=new rtppacket(data,height);                            //rtpp.setpayloadtype(125);                             log.v("rtppacket","created");                             rtpsocket rtps= new rtpsocket(soc,serveraddr,9954);                                 log.v("rtpsocket","created");                                         rtps.send(rtpp);                             log.v("packet","sent");                            }              catch(exception e){e.printstacktrace();log.v(tag, "socket");}             }         }   }); 

how can play packets? please give suggestions!!!

i totally confused:( new android development!! need experts!!!!

i think might need decode stream via decodeyuv420sp since byte[] data in yuv format.


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -