spex66 / RTSP-Camera-for-Android

Android based RTSP Server which is able to serve live camera view to multiple RTSP clients, such as VLC.
406 stars 257 forks source link

Huge Delay #1

Open amitaymolko opened 12 years ago

amitaymolko commented 12 years ago

I am getting a delay of about 20 seconds. This is outrageous... I will look into it and comment if i find a solution.

spex66 commented 12 years ago

Welcome to RTSPCamera project. To clarify the context of the issue:

20sec delay is for example normal if you used WebView RTSP capability. That is why we implemented the RTSPCamera as well.

amitaymolko commented 12 years ago

I edited the project and added ANNOUCE and RECORD methods to the client. (with authentication) And copied some of the server code to send the RTP Packets. I got video working and am now working on audio. I am sending the camera stream to my Darwin server setup on a real server. I am recieving the stream using vlc on my Mac book. I get a 20 sec delay. When I broadcast from my Mac using QuickTime broadcaster and receive on android phone using rtspviewer app I found on google play I have a 1-2 sec delay. All network is tethered 3G from my iPhone 1mbps

spex66 commented 12 years ago

Thank you for details. I understand that you "started" with RTSPCamera code and extended it. I have no idea, which parts of RTSPCamera survived your surgery.

From my tests I can remember that VLC (on Win7) got the stream with max 2sec delay. This was independent of JNI based encoding or use of Java H263 packetizer within RTSPCamera.

The bottleneck was the viewer on Android, which lead (as I said) to implementation of RTSPViewer (not RTSPCamera). VLC delay was not the case in my tests.

Development of native encoding on RTSPCamera was started, to test H264 packetizer based on JNI for performance comparison against Java based version.

Summary: At the moment I'm not able to help you with your bottleneck. If you find the source for your delay, or if you have questions about coding, I'm happy to get your feedback here.

amitaymolko commented 12 years ago

If anyone wants my code. I edited rtspclient to this --> http://pastebin.com/05DtFQ7U And edit rtspcontrol to this --> http://pastebin.com/EMVDH2ns then call this in main class. rtspControl = new RtspControl2("rtsp://url/stream.sdp", rtspVideoEncoder,"username","password"); while (rtspControl.getState() != RtspConstants.READY) { }

spex66 commented 12 years ago

Thank you for sharing your changes. Did you solved your issue with 20sec delay with that changes? Or is that issue still open? regards Peter (=PA=)

amitaymolko commented 12 years ago

I did not solve... but i think its a network issue not program. I am also still trying to get audio to work..

andresteves commented 12 years ago

Hi, when you say: "then call this in main class. rtspControl = new RtspControl2("rtsp://url/stream.sdp", rtspVideoEncoder,"username","password"); while (rtspControl.getState() != RtspConstants.READY) { }"

What is the main class you are talking about? Im trying to make it stream to a wowza server but with no luck.

Regards

amitaymolko commented 12 years ago

Hi! I will upload the full project and send you a link when i get home...

andresteves commented 12 years ago

Thanks bro

Regards

amitaymolko commented 12 years ago

Try this --> http://www.4shared.com/rar/cm2e1ZML/RtspCamera.html you need to edit RtspNativeCodecsCamera2.java if you need anymore help, you know where to find me :)

andresteves commented 12 years ago

Thank you very much. Im now trying to get the audio to work with wowza :)

amitaymolko commented 12 years ago

Im happy i could help. Tell me one thing... How big is your delay?

andresteves commented 12 years ago

About 5sec. But im using Wifi connection and dont know how its going to work when connect by 3G.

amitaymolko commented 12 years ago

Thanks :) Update here if you get the audio working correctly.

gmavenis commented 11 years ago

Dear amitaymolko, It still do not work for me. For example: Host: 192.168.1.170 Port: 88 User: admin Pass: tommy1234

You can tell me the way to edit? Many thanks,

amitaymolko commented 11 years ago

Make sure you are using digest authentication and not basic.

On Nov 22, 2012, at 8:31, Tommy notifications@github.com wrote:

Dear amitaymolko, It still do not work for me. For example: Host: 192.168.1.170 Port: 88 User: admin Pass: tommy1234

You can tell me the way to edit? Many thanks,

— Reply to this email directly or view it on GitHub.

gmavenis commented 11 years ago

Yes, I can play this rtsp url on VLC but it can not run on mobile. Maybe I built this project uncorrect. I need it much. Please help me, so thanks very much.

amitaymolko commented 11 years ago

The project i built only supports digest authentication. VLC supports both basic and digest. I haven't worked on this project for quite a while but i think it might have something to do with the ports. You should try to post errors and not only say that it doesn't work for you.

liuyaoCS commented 8 years ago

Dear amitaymolko, I am tying to send the camera stream to my Darwin server. I can't visit http://www.4shared.com/rar/cm2e1ZML/RtspCamera.html. Could you send me a copy? My email address is liuyao@chinaso.com. thanks!

andresteves commented 8 years ago

Dear amitaymolko, I am tying to send the camera stream to my Darwin server. I can't visit http://www.4shared.com/rar/cm2e1ZML/RtspCamera.html. Could you send me a copy? My email address is liuyao@chinaso.com. thanks!

The link seems to be working for me @liuyaoCS