fyhertz / libstreaming

A solution for streaming H.264, H.263, AMR, AAC using RTP on Android
Apache License 2.0
3.49k stars 1.08k forks source link

No throughput on Wowza Streaming Engine for Android app using libstreaming library #173

Open jhodgski opened 8 years ago

jhodgski commented 8 years ago

I have created a test Android app using this tutorial.

I have got everything to connect OK, and I can see my app in my localhost's Wowza Streaming Engine's > Incoming Streams > MyApp panel but, although the connection clearly exists, no video data is making it through. (This is confirmed with nothing showing in WSE's Test Player.)

When I test with the official GoCoder Android app, the video data is making it through fine. (Also confirmed with WSE's Test Player.)

Both Android apps are set up with the same config (my stream URL is rtsp://192.168.1.2:1935/live/MyApp, so it seems like there is an issue with the libstreaming library.

I am new to streaming so am not sure where to start troubleshooting and would be very appreciative of some help.

Thanks in advance, James

parthsaxena commented 8 years ago

I am having this issue as well.

sbaar commented 8 years ago

No guarantees, but i think when I had this problem it was fixed by making sure mTransport in RTPSocket.java was TRANSPORT_UDP and mParameters.transport in RtspClient.java is set to TRANSPORT_UDP

parthsaxena commented 8 years ago

Hey thanks for the reply @sbaar. I actually figured this out. Your solution is related to my solution as well. It turned out that I didn't have the UDP ports open on my AWS EC2 server.

Here is a screenshot from the Wowza Guide which tells all the Wowza Ports that should be open: capture

(Here is a link to the section of the Wowza guide explaining the ports: https://www.wowza.com/forums/content.php?625-How-to-get-started-as-a-Wowza-Streaming-Engine-Manager-administrator#openPorts)

Anyways, I THINK the problem was that I didn't open the UDP ports... All I know is that the streaming issue fixed right after opening all these ports.

It's weird because when I was using an app with libstreaming and Wowza a couple months back, it worked without opening any ports.... I think maybe an update with Wowza required a couple new ports to be opened.

Thanks, Parth Saxena

jhodgski commented 8 years ago

Thank you, Scott and Parth, for your very helpful responses.

I have got this issue sorted now. I didn't need to open any more ports. All I need to do was change this line... mTmpParameters.transport = TRANSPORT_UDP; ...in RtspClient.java to... mTmpParameters.transport = TRANSPORT_TCP; ...and now everything is working a treat. :-)

Cheers, James

PS - You will find RtspClient.java in the net/majorkernelpanic/streaming/rtsp/ directory.

PPS - No changes were required in RTPSocket.java .

parthsaxena commented 8 years ago

Oh that explains it. The ports I didn't have open were the UDP ports. That means that the android app was attempting to stream via UDP not TCP...

Thanks for your response.

Thanks, Parth Saxena

mingtai511 commented 8 years ago

Now I 'm working on live streaming video to wowza sever android app by using libstreaming library By the way session is failed and show 'try again' alert. So I have been debugged. The wowza server return unkown error. How Can I fix it?