fyhertz / libstreaming-examples

Some examples of how to use libstreaming
283 stars 231 forks source link

libstreaming + Google Glass #28

Closed Philip7777 closed 8 years ago

Philip7777 commented 8 years ago

Hello,

first of all: Thanks for your great work! Im currently trying to get libstreaming to work with google glass. I tried example 1. If I'm connecting to the rtsp server with vlc player it seems like the connection is succesfull but one second after the connection is made, the connection gets lost. The app keeps running. Do you think it is possible to use libstreaming with google glass? I'm posting the output of the logcat below maybe you could help me figure out where the problem could be.

Regards Philip

03-23 14:27:42.570: I/RtspServer(11165): Connection from 192.168.2.101 03-23 14:27:42.578: E/RtspServer(11165): OPTIONS rtsp://192.168.2.103:1234 03-23 14:27:42.578: D/RtspServer(11165): RTSP/1.0 200 OK 03-23 14:27:42.578: D/RtspServer(11165): Server: MajorKernelPanic RTSP Server 03-23 14:27:42.578: D/RtspServer(11165): Cseq: 2 03-23 14:27:42.578: D/RtspServer(11165): Content-Length: 0 03-23 14:27:42.578: D/RtspServer(11165): Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE 03-23 14:27:42.585: E/RtspServer(11165): DESCRIBE rtsp://192.168.2.103:1234 03-23 14:27:42.632: D/dalvikvm(11165): GC_FOR_ALLOC freed 185K, 4% free 5805K/6028K, paused 23ms, total 24ms 03-23 14:27:42.640: D/RtspServer(11165): RTSP/1.0 200 OK 03-23 14:27:42.640: D/RtspServer(11165): Server: MajorKernelPanic RTSP Server 03-23 14:27:42.640: D/RtspServer(11165): Cseq: 3 03-23 14:27:42.640: D/RtspServer(11165): Content-Length: 171 03-23 14:27:42.640: D/RtspServer(11165): Content-Base: 192.168.2.103:1234/ 03-23 14:27:42.640: D/RtspServer(11165): Content-Type: application/sdp 03-23 14:27:42.640: D/RtspServer(11165): v=0 03-23 14:27:42.640: D/RtspServer(11165): o=- 0 0 IN IP4 192.168.2.103 03-23 14:27:42.640: D/RtspServer(11165): s=Unnamed 03-23 14:27:42.640: D/RtspServer(11165): i=N/A 03-23 14:27:42.640: D/RtspServer(11165): c=IN IP4 192.168.2.101 03-23 14:27:42.640: D/RtspServer(11165): t=0 0 03-23 14:27:42.640: D/RtspServer(11165): a=recvonly 03-23 14:27:42.640: D/RtspServer(11165): m=video 5006 RTP/AVP 96 03-23 14:27:42.640: D/RtspServer(11165): a=rtpmap:96 H263-1998/90000 03-23 14:27:42.640: D/RtspServer(11165): a=control:trackID=1 03-23 14:27:42.648: E/RtspServer(11165): SETUP 192.168.2.103:1234/trackID=1 03-23 14:27:42.648: D/VideoStream(11165): Video encoded using the MediaRecorder API 03-23 14:27:43.375: D/VideoStream(11165): Unlocking camera 03-23 14:27:43.382: I/MediaRecorderJNI(11165): prepare: surface=0x5a54a918 03-23 14:27:43.843: W/CameraBase(11165): Camera service died! 03-23 14:27:43.843: W/CameraBase(11165): mediaserver's remote binder Camera object died 03-23 14:27:43.843: E/Camera(11165): Error 100 03-23 14:27:43.843: E/VideoStream(11165): Media server died ! 03-23 14:27:43.843: W/IMediaDeathNotifier(11165): media server died 03-23 14:27:46.835: W/JNIHelp(11165): Discarding pending exception (java.io.IOException: Try again) to throw java/io/IOException 03-23 14:27:46.835: E/VideoStream(11165): Couldn't skip mp4 header :/ 03-23 14:27:46.835: D/VideoStream(11165): Locking camera 03-23 14:27:46.835: E/RtspServer(11165): Try again 03-23 14:27:46.835: W/System.err(11165): java.io.IOException: Try again 03-23 14:27:46.835: W/System.err(11165): at android.net.LocalSocketImpl.read_native(Native Method) 03-23 14:27:46.835: W/System.err(11165): at android.net.LocalSocketImpl.access$300(LocalSocketImpl.java:33) 03-23 14:27:46.835: W/System.err(11165): at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:79) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.video.VideoStream.encodeWithMediaRecorder(VideoStream.java:373) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.MediaStream.start(MediaStream.java:250) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.video.VideoStream.start(VideoStream.java:278) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.video.H263Stream.start(H263Stream.java:68) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.Session.syncStart(Session.java:453) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.rtsp.RtspServer$WorkerThread.processRequest(RtspServer.java:506) 03-23 14:27:46.835: W/System.err(11165): at net.majorkernelpanic.streaming.rtsp.RtspServer$WorkerThread.run(RtspServer.java:390) 03-23 14:27:46.843: D/RtspServer(11165): RTSP/1.0 500 Internal Server Error 03-23 14:27:46.843: D/RtspServer(11165): Server: MajorKernelPanic RTSP Server 03-23 14:27:46.843: D/RtspServer(11165): Cseq: 4 03-23 14:27:46.843: D/RtspServer(11165): Content-Length: 0 03-23 14:27:46.859: I/RtspServer(11165): Client disconnected 03-23 14:27:46.867: I/RtspServer(11165): Connection from 192.168.2.101 03-23 14:27:46.882: E/RtspServer(11165): OPTIONS rtsp://192.168.2.103:1234 03-23 14:27:46.882: D/RtspServer(11165): RTSP/1.0 200 OK 03-23 14:27:46.882: D/RtspServer(11165): Server: MajorKernelPanic RTSP Server 03-23 14:27:46.882: D/RtspServer(11165): Cseq: 1 03-23 14:27:46.882: D/RtspServer(11165): Content-Length: 0 03-23 14:27:46.882: D/RtspServer(11165): Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE 03-23 14:27:46.890: I/RtspServer(11165): Client disconnected

Philip7777 commented 8 years ago

I figured out the problem by myself. I had to set the VideoEncoder to VIDEO_H264 (like it is in the original example) I tried H263 and H264 before but I also had to restart the device...

Thanks again for your work, it helps me a lot!