Export to GitHub

spydroid-ipcamera - issue #2

Stream to Wowza Successful!!!!


Posted on Sep 16, 2011 by Happy Cat

Hi Guys, I have tried to stream to Wowza successfully so that VLC can play it successfully!!! I think my vlc cant read that sdp but can read rtsp stream!!!

So first, i change to port setting for spydroid-ipcamera I dont know its true that wowza can only digest in 5006 because it shows 5006 all the time in the command prompt and fail to stream in 5004,5005. And also I found that if my pc cant read the stream then spydroid-ipcamera will stop sending packet to pc after sometimes!!

So now i tech everyone to do it!!! Step 1 : Download my sdp file and place it in the wowza-install-dir/content (Actually I just change the port to 5006)

Step 2 : Open the project in Eclipse,in cameraStreamer.java,change the port to 5006 rsock = new SmallRtpSocket(InetAddress.getByName(dest), 5006, buffer); Or you can just download my file and replace it. And then you can compile the file and generate .apk or just run it in your own way

Step 3: Wowza time,Stop the server first follow http://www.wowza.com/forums/content.php?36-How-to-publish-and-play-a-live-stream-(RTMP-or-RTSP-RTP-based-encoder) I follow them exactly!!!

Step 4: Restart the server and stream it at VLC!!! rtsp://[wowza-address]:1935/live/myStream.sdp Its work!!!! The streaming is very stable more than 15 minutes and its delay around 3-5 seconds. Maybe just the conversion of wowza server. I think it is success dont you think???

So i am working on video chat program,and guys can we add sound into it.I think i need acc codec for streaming because i only try H.264 and aac work in android with wowza. I hope everyone can benefit on it. And thank you guys you guys are bravo!!!!

Attachments

Comment #1

Posted on Sep 16, 2011 by Helpful Camel

Good news ! I will add a page about wowza on the wiki, based on what you wrote. But could you tell me your phone and android version pls so that I can had it to the supported device page

Comment #2

Posted on Sep 17, 2011 by Happy Cat

Galaxy S One with android 2.3.3

Comment #3

Posted on Sep 17, 2011 by Happy Cat

So actually I want to add audio stream on it? What should i do?

I have put audiostream into Mediarecorder but i think the problem is on rtp packet and the sdp file. Do u familiar with that, i actually really not understand rtp and sdp. Should i add some description about audio in sdp so that it can be read? Also if I own more than 1 stream(mulit-stream at the same time),can it been handled???

Comment #4

Posted on Sep 19, 2011 by Grumpy Hippo

hiii guys....thanks for such an useful post. but i am not able to understand what should i write in the ip address field in an app before starting streaming and how my wowza server will take this stream of data. Thanks

Comment #5

Posted on Sep 19, 2011 by Massive Giraffe

Thanks all, Can anyone share me link for downloading Wowza Server.

Comment #6

Posted on Sep 19, 2011 by Happy Cat

http://www.wowza.com/

Comment #7

Posted on Sep 19, 2011 by Happy Cat

ip address should be where your wowza host follow the guide. Wowza will read sdp file so that it know how to read the udp data. U need to go into the streaming manager. Follow step by step wowza setting is on Step 3

Comment #8

Posted on Sep 20, 2011 by Massive Bird

I can't seem to get the wowza media server working with the app. I've followed the guide step by step, and even checked wireshark to ensure the server is getting the UDP packets from the phone - which it is. The problem is that the server times out upon receiving the first packet every time. Any ideas as to what would cause this?

Comment #9

Posted on Sep 20, 2011 by Happy Cat

have you ensured the port number in CameraStreamer.java and myStream.sdp are the same???

Comment #10

Posted on Sep 20, 2011 by Massive Bird

Yes, the ports are 5006 on both.

For some reason wowza binds to both ports 5006 and 5007 though, does this happen for you too?

It's possible that there's a config file problem, would it be possible for you to attach your working Application.xml file?

Comment #11

Posted on Sep 20, 2011 by Happy Cat

yes thats why i change it. Here you are. live in Application

Attachments

Comment #12

Posted on Sep 20, 2011 by Massive Bird

What do you mean by "yes that's why I change it"?

I'm using your Application.xml and an unmodified build of the IP-camera, but it still doesn't work. I create an rtp stream on the server with the sdp file, and in console, these lines just repeat:

INFO server comment - RTPUDPTransport.bind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.bind[live/definst]: 0.0.0.0/0.0.0.0:5007 INFO stream publish myStream.sdp - INFO server comment - RTPMediaCaster.Reconnector[14454885:live/definst:myStream.sdp]: done: 2 INFO server comment - UDPTransport.firstPacket: bind:0.0.0.0/0.0.0.0:5006 msg:/172.21.1.4:46039 INFO server comment - RTPMediaCaster.streamTimeout[14454885:live/definst:myStream.sdp]: timeout:12000 diff:12008 reason:101 INFO server comment - RTPMediaCaster.resetConnection[14454885:live/definst:myStream.sdp]: INFO server comment - RTPMediaCaster.closeRTPSession[14454885:live/definst:myStream.sdp] INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5007 INFO stream unpublish myStream.sdp - INFO stream destroy myStream.sdp -

Comment #13

Posted on Sep 21, 2011 by Helpful Wombat

He means that Wowza binds to 5006 by default, that's why he changed it.

OP: Your solution doesn't work either. On phone with 2.3.3 or Asus Tranformer with 3.2, sending video stream works but Wowza does not accept it.

Comment #14

Posted on Sep 21, 2011 by Happy Cat

Actually i just try it luckily. I am not sure everyone can work. But to ensure everything is correct

1) Android CameraStreamer.java Change to 5006 rsock = new SmallRtpSocket(InetAddress.getByName(dest), 5006, buffer);

2)sdp file set to 5006

3) Wowza application.xml

if cant,sorry i really dun know. I really just a beginning haha:)

Comment #15

Posted on Sep 21, 2011 by Helpful Wombat

Yes, I did all of those things.

This is what Wowza does when I start streaming:

INFO stream publish myStream.sdp - INFO server comment - RTPMediaCaster.Reconnector[5734522:live/definst:myStream.sdp]: done: 13 INFO server comment - UDPTransport.firstPacket: bind:0.0.0.0/0.0.0.0:5006 msg:/172.21.87.124:53880 INFO server comment - RTPMediaCaster.streamTimeout[5734522:live/definst:myStream.sdp]: timeout:12000 diff:12005 reason:101 INFO server comment - RTPMediaCaster.resetConnection[5734522:live/definst:myStream.sdp]: INFO server comment - RTPMediaCaster.closeRTPSession[5734522:live/definst:myStream.sdp] INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5007 INFO stream unpublish myStream.sdp - INFO stream destroy myStream.sdp - INFO server comment - RTPMediaCaster.Reconnector[5734522:live/definst:myStream.sdp]: start: 14 INFO server comment - RTPSessionDescriptionDataProviderBasic.getStreamInfo[live/definst]: /usr/local/WowzaMediaServer/content/myStream.sdp INFO stream create - - INFO server comment - RTPUDPTransport.bind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.bind[live/definst]: 0.0.0.0/0.0.0.0:5007 INFO stream publish myStream.sdp - INFO server comment - RTPMediaCaster.Reconnector[5734522:live/definst:myStream.sdp]: done: 14 INFO server comment - UDPTransport.firstPacket: bind:0.0.0.0/0.0.0.0:5006 msg:/172.21.87.124:53880 INFO server comment - RTPMediaCaster.streamTimeout[5734522:live/definst:myStream.sdp]: timeout:12000 diff:12006 reason:101 INFO server comment - RTPMediaCaster.resetConnection[5734522:live/definst:myStream.sdp]: INFO server comment - RTPMediaCaster.closeRTPSession[5734522:live/definst:myStream.sdp] INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5007 INFO stream unpublish myStream.sdp - INFO stream destroy myStream.sdp -

Comment #16

Posted on Sep 21, 2011 by Happy Cat

if everything is correct, then is your phone support h.264? What is the model of your phone?

Comment #17

Posted on Sep 21, 2011 by Helpful Wombat

Asus Transformer TF101, Android 3.2, h264 is supported. Everything is correct.

Tried it on HTC Desire Z running 2.3.3 as well. logcat shows h264 encoder is supported.

No output from VLC and Wowza just keeps cycling the stream, timing out. I cannot replicate your success.

Comment #18

Posted on Sep 22, 2011 by Helpful Camel

Hi,

What you should try is to make a dummy app that records h.264 video in a file, let's say /sdcard/vid.mp4 . Set the resolution to 640x480 and the framerate to 15.

Then, record, recover the file on your pc, for example with "adb pull /sdcard/vid.mp4 ~/Desktop" if you're using Linux and have the ADK.

Then use VLC to generate a proper sdp file: vlc -I rc "~/Desktop/vid.mp4" --sout="#rtp{dst=127.0.0.1,port=5004,sdp=file:///home/YOURHOME/lol.sdp}"

This asks VLC to stream the video and o generate an SDP file.

Then try to use spydroid-ipcamera with the generated SDP file !

Regards,

Comment #19

Posted on Sep 22, 2011 by Helpful Camel

If you manage to do this, i would be interested to see the differences between your sdp file and mine.

Comment #20

Posted on Sep 23, 2011 by Helpful Wombat

OK. Here is sdp file, and log output from VLC. After 'main playlist debug: art not found' I start the stream, you can see it starts receiving data but is forever 'buffering'.

Attachments

Comment #21

Posted on Sep 25, 2011 by Happy Cat

i dun know is it useful but try to update wowza with patch http://www.wowza.com/forums/content.php?199-Development-Builds

Comment #22

Posted on Sep 26, 2011 by Helpful Camel

That's weird that you can't even capture the h264 stream with an SDP file vlc specially made for you :( Maybe the packetization process is not working properly for some reason. Could you uncomment all lines beginning with "Log.e" in CameraStreamer.java and show me what logcat displays.

Especially this one: //Log.e(SpydroidActivity.LOG_TAG,"- Nal unit length: " + naluLength);

Normally you should see NAL units with length like 10k bytes max.

Could you send me a dummy video made with your phone as well. Encoded in h264/mpeg4 pls.

Thank you !

Comment #23

Posted on Sep 26, 2011 by Helpful Camel

Comment deleted

Comment #24

Posted on Sep 26, 2011 by Helpful Camel

Actually I would really appreciate any video recorded on a phone spydroid doesn't seem to support, it would probably really help me to find out what's going on :)

Comment #25

Posted on Sep 26, 2011 by Helpful Wombat

Here's the video. Logs to follow shortly.

Attachments

Comment #26

Posted on Sep 26, 2011 by Helpful Camel

Ouch ! No wonder why it's not working, the mp4 files your phone generate contain an unknown "free" atom preceding the mdat atom. And it only contains zeros :/

Have you tried THREE_GP instead of MPEG4 for the output format ??

Anyhow I will soon commit a fix for the 1.0 version, and it should work on your phone :)

(Really interesting video btw)

Comment #27

Posted on Sep 26, 2011 by Helpful Wombat

This is the Asus Tranformer TF101. Although I am sure the phones are similar. I'm eagerly awaiting your fix - please, send it to me ASAP before you do your release. :) commielawngnome at gmail dot com

Comment #28

Posted on Sep 28, 2011 by Helpful Wombat

OK with the latest patch from our good French friend here, I was able to get VLC to play a stream from Spydroid. I was NOT able to replicate the success with Wowza! I tries listening on udp://0.0.0.0:5006, I tried the SDP file I generated from my device's mp4 file, Wowza will NOT have any of it. I did install the Wowza patch.

Clearly, the streaming is working, but VLC does a lot to 'smooth out' any kinks - I wonder why you are getting success streaming to Wowza but I am not?

Please advise!

Comment #29

Posted on Sep 30, 2011 by Grumpy Monkey

With your latest patch, this is the error I get from WOWZA.

WARN server comment 2011-09-30 16:23:51 217782892 192.168.0.101 - 0 0 50.006 - - - - - - - stream.sdp MediaReaderH264.open[2]: java.lang.Exception: QTUtils.parseQTMediaContainer: File is missing 'moov' atom.

Comment #30

Posted on Oct 6, 2011 by Happy Camel

Why after installed the app, always cause error, ---Deprecated Thread methods are not supported. Can anyone help me to figure it out? I think there is sth wrong in the code. I'm using sansum nexus s, android 2.3.4.

Comment #31

Posted on Oct 12, 2011 by Helpful Cat

Hi Simon, i must say that you have done a great effort to make this project working well.

Yet i've used your last patch with its updated SDP, but VLC still couldn't play the stream correctly. It seemed that most frames were skipped. When i open the message log with the verbosity level increased to 1, i got these following errors.

main warning: PTS is out of range (2311526), dropping buffer main warning: PTS is out of range (2291630), dropping buffer ...

and sometimes:

main warning: late picture skipped (205340 > -17) avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?) main warning: late picture skipped (113567 > -9) main warning: late picture skipped (70029 > -19) main warning: late picture skipped (178196 > -12) avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?) main warning: late picture skipped (27813 > -10) main warning: late picture skipped (79569 > -9)

Actually i dont understand what the above errors mean.

Comment #32

Posted on Oct 31, 2011 by Happy Kangaroo

Comment deleted

Comment #33

Posted on Oct 31, 2011 by Grumpy Cat

Yes, streaming to wowza working, but whithout sound. The problem is that Wowza does not support AMR...

Comment #34

Posted on Nov 6, 2011 by Happy Kangaroo

who can tell me the details of step4? how can streaming to wowza,and how to play it?thanks very much..

Comment #35

Posted on Nov 11, 2011 by Helpful Wombat

Hi does anyone succeeded to encode audio in AAC and play it over VLC. I am trying to create a video chat sort of app where wowza will stream the content sent from mobile camera. But wowza doesn't supports AMR. And this app has AMR packetzier. I need AAC packetzier on RTP so that wowza can play audio.

Comment #36

Posted on Nov 28, 2011 by Helpful Hippo

Hi Everyone.. I have a problem. I use Samsung Galaxy S2 to stream to Wowza Server. When I test stream to VLC , It's work.

when I stream to Wowza, the data package enter to the server (I test by command tcpdump -nn dst port 5006) but there was no response from the server.

I use all configuration from the topic and use Application.xml from comment 11 . What should I do??

Thank you.

Comment #37

Posted on Jan 20, 2012 by Massive Dog

What is the version of spydroid you use? 1.6?

Comment #38

Posted on Mar 8, 2012 by Quick Hippo

Comment deleted

Comment #39

Posted on Mar 8, 2012 by Quick Hippo

Comment deleted

Comment #40

Posted on Mar 13, 2012 by Quick Hippo

Hi all i can to stream to wowza with a sumsung 2.2 tab but without audio is be cause encoded in arm_nb and the last is not supported in wowza so now i search a solution to transcod him with ffmpeg and re stream any one can play the stream with ffmpeg ????

Comment #41

Posted on May 5, 2012 by Happy Cat

INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5006 INFO server comment - RTPUDPTransport.unbind[live/definst]: 0.0.0.0/0.0.0.0:5007

The reason you are getting those may be due to the Wowza using these ports for the same tracks (video and audio). I was getting these errors, then changed the ports the video and audio are using. Just make the audio track port 5004 and video track port 5006.

Comment #42

Posted on Jun 25, 2012 by Quick Camel

I was trying to stream live video using wowza media server & SpyDroid. The whole process worked fine in my local network where both wowza server & my Android Galaxy S2 has private IP address.

Now I am trying to have it working on Rackspace server but it doesn't work there either by passing directly sdp file to Vlc player or passing the url: rtsp://50.56.64.121:1935/live/savicam.sdp. It displayed the following error message though I added local IP & global IP into RTP section.

"Your input can't be opened: VLC is unable to open the MRL 'rtsp://50.56.64.121:1935/live/savicam.sdp'. Check the log for details."

Also checked logs from wowza server which is attached with the email.

Can anyone help me what's going on here. I am really getting problem with that.

Attachments

Comment #43

Posted on Sep 4, 2012 by Happy Dog

Comment deleted

Comment #44

Posted on Sep 4, 2012 by Happy Dog

can anybody can give me url for download spydroid for wowsa.I got code from google code but there is no camera streamer class in this code and I have to provide two port no. one for audio and other for video but in your sdp there is only one port is mentioned what about other one.I am successful in streaming video to wowsa but I m not getting audio because wowsa doesn't Amr codec.Provide me code for both.

Help regarding this will be appreciable.

Comment #45

Posted on Nov 27, 2012 by Helpful Lion

Comment deleted

Comment #46

Posted on Nov 27, 2012 by Helpful Lion

Hi,

I am trying to do the same. I added your files, also SmallRtpSocket and followed the instructions here but no success with streaming the video to wowza. Wowza looks configured ok and I create an instance of CameraStreamer setup and startStream(). I get in my logcat something like:

11-27 00:02:38.610: E/MainActivity(16832): --- FU-A unit, end:false 11-27 00:02:38.620: E/MainActivity(16832): Data read: 15949,1386 11-27 00:02:38.620: E/MainActivity(16832): Dec delay: 86

But no success to stream to wowza. Would I need anything else besides CameraStreamer, sdp, SmallRtpSocket and wowza properly configured?

Thanks in advance!

Diego

Comment #47

Posted on May 8, 2013 by Helpful Cat

Is it possible to stream the video from our device to Adobe server. If yes then please tell me how can i do this...???

Comment #48

Posted on Jun 25, 2013 by Happy Giraffe

i couldnt found CameraStreamer.java , where to place file you provided here

Comment #49

Posted on Jun 26, 2013 by Happy Giraffe

Thanks i am done with wowza, streaming from android to wowza server and playing stream/video in win C# application

Comment #50

Posted on Jun 26, 2013 by Happy Giraffe

but not with spydroid

Comment #51

Posted on Jul 5, 2013 by Helpful Hippo

I am trying to implement RTSP streaming from iPhone to Wowza server. On mac I can see the video being received by Wowza server but when I try to get it into Quicktime player or in Flash player through the browser, I get the following error in the Terminal: WARN server comment - Missing function: createStream I am using Wowza 3.6.2

Comment #52

Posted on Sep 13, 2013 by Happy Monkey

It's good!

Comment #53

Posted on Oct 25, 2013 by Happy Horse

What version of Spydroid you are useing? I cant find the class SmallRtpSocket in version 9.0

Comment #54

Posted on Nov 21, 2013 by Helpful Bird

I am unable to checkout the code from https://code.google.com/p/spydroid-ipcamera/ is that link has been modified? please provide the updated one.

Comment #55

Posted on May 27, 2014 by Quick Horse

I am facing one issue could please help me some one, i have minicaster encoder, i need to do live steaming with wowza, how can i do that? out put from minicaster encoder where i can configer in wowza and from wowza how can i get output to my website? please help me.

Comment #56

Posted on Sep 20, 2014 by Happy Horse

Comment deleted

Comment #57

Posted on Sep 20, 2014 by Happy Horse

Follow the stars I still do not get, you can send the code via their reference no. Send by e-mail: phuquycntt@gmail.com. Thanks Very much

Comment #58

Posted on Nov 24, 2014 by Grumpy Kangaroo

i want more detail about wowza gocoder mobile application streaming live default ip address and port number

Status: New

Labels:
Type-Defect Priority-Medium