jzfeng2014 / spydroid-ipcamera

Automatically exported from code.google.com/p/spydroid-ipcamera
GNU General Public License v3.0
0 stars 0 forks source link

Stream to Wowza Successful!!!! #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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!!!!

Original issue reported on code.google.com by tck....@gmail.com on 16 Sep 2011 at 5:26

Attachments:

GoogleCodeExporter commented 9 years ago
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

Original comment by FyHertz on 16 Sep 2011 at 5:12

GoogleCodeExporter commented 9 years ago
Galaxy S One with android 2.3.3 

Original comment by tck....@gmail.com on 17 Sep 2011 at 3:14

GoogleCodeExporter commented 9 years ago
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???

Original comment by tck....@gmail.com on 17 Sep 2011 at 3:20

GoogleCodeExporter commented 9 years ago
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

Original comment by iitkgpni...@gmail.com on 19 Sep 2011 at 8:07

GoogleCodeExporter commented 9 years ago
Thanks all,
Can anyone share me link for downloading Wowza Server.

Original comment by shivha...@gmail.com on 19 Sep 2011 at 8:46

GoogleCodeExporter commented 9 years ago
http://www.wowza.com/

Original comment by tck....@gmail.com on 19 Sep 2011 at 10:36

GoogleCodeExporter commented 9 years ago
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

Original comment by tck....@gmail.com on 19 Sep 2011 at 10:38

GoogleCodeExporter commented 9 years ago
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?

Original comment by zenithan...@gmail.com on 20 Sep 2011 at 1:47

GoogleCodeExporter commented 9 years ago
have you ensured the port number in CameraStreamer.java and myStream.sdp are 
the same???

Original comment by tck....@gmail.com on 20 Sep 2011 at 1:56

GoogleCodeExporter commented 9 years ago
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?

Original comment by zenithan...@gmail.com on 20 Sep 2011 at 2:46

GoogleCodeExporter commented 9 years ago
yes thats why i change it.
Here you are.
live in Application

Original comment by tck....@gmail.com on 20 Sep 2011 at 2:50

Attachments:

GoogleCodeExporter commented 9 years ago
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 -

Original comment by zenithan...@gmail.com on 20 Sep 2011 at 5:27

GoogleCodeExporter commented 9 years ago
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.

Original comment by commiela...@gmail.com on 21 Sep 2011 at 3:50

GoogleCodeExporter commented 9 years ago
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:)

Original comment by tck....@gmail.com on 21 Sep 2011 at 4:29

GoogleCodeExporter commented 9 years ago
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 -

Original comment by commiela...@gmail.com on 21 Sep 2011 at 5:02

GoogleCodeExporter commented 9 years ago
if everything is correct,
then is your phone support h.264?
What is the model of your phone?

Original comment by tck....@gmail.com on 21 Sep 2011 at 5:24

GoogleCodeExporter commented 9 years ago
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.

Original comment by commiela...@gmail.com on 21 Sep 2011 at 8:13

GoogleCodeExporter commented 9 years ago
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,

Original comment by FyHertz on 22 Sep 2011 at 3:46

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

Original comment by FyHertz on 22 Sep 2011 at 3:49

GoogleCodeExporter commented 9 years ago
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'. 

Original comment by commiela...@gmail.com on 23 Sep 2011 at 3:26

Attachments:

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

Original comment by tck....@gmail.com on 25 Sep 2011 at 4:42

GoogleCodeExporter commented 9 years ago
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 !

Original comment by FyHertz on 26 Sep 2011 at 1:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 :)

Original comment by FyHertz on 26 Sep 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Here's the video. Logs to follow shortly.

Original comment by commiela...@gmail.com on 26 Sep 2011 at 2:58

Attachments:

GoogleCodeExporter commented 9 years ago
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)

Original comment by FyHertz on 26 Sep 2011 at 4:43

GoogleCodeExporter commented 9 years ago
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

Original comment by commiela...@gmail.com on 26 Sep 2011 at 5:00

GoogleCodeExporter commented 9 years ago
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!

Original comment by commiela...@gmail.com on 28 Sep 2011 at 7:25

GoogleCodeExporter commented 9 years ago
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.

Original comment by human1...@gmail.com on 30 Sep 2011 at 8:27

GoogleCodeExporter commented 9 years ago
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. 

Original comment by wzh...@gmail.com on 6 Oct 2011 at 4:01

GoogleCodeExporter commented 9 years ago
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.

Original comment by yanmi....@gmail.com on 12 Oct 2011 at 9:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, streaming to wowza working, but whithout sound. The problem is that Wowza 
does not support AMR...

Original comment by dgane...@gmail.com on 31 Oct 2011 at 9:34

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

Original comment by Sun.Jr...@gmail.com on 6 Nov 2011 at 8:19

GoogleCodeExporter commented 9 years ago
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.

Original comment by yogesh.g...@gmail.com on 11 Nov 2011 at 12:30

GoogleCodeExporter commented 9 years ago
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.

Original comment by kaze....@gmail.com on 28 Nov 2011 at 4:02

GoogleCodeExporter commented 9 years ago
What is the version of spydroid you use? 1.6?

Original comment by tbodas...@gmail.com on 20 Jan 2012 at 12:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 ????

Original comment by mhiraha...@gmail.com on 13 Mar 2012 at 3:19

GoogleCodeExporter commented 9 years ago
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.

Original comment by roguz...@gmail.com on 5 May 2012 at 3:04

GoogleCodeExporter commented 9 years ago
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.

Original comment by mail.mos...@gmail.com on 25 Jun 2012 at 1:39

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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.

Original comment by goyal.ar...@gmail.com on 4 Sep 2012 at 1:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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

Original comment by diego.montaner@gmail.com on 27 Nov 2012 at 2:06

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

Original comment by upadhyay...@gmail.com on 8 May 2013 at 1:27

GoogleCodeExporter commented 9 years ago
i couldnt found CameraStreamer.java , where to place file you provided here 

Original comment by hmad7...@gmail.com on 25 Jun 2013 at 2:44

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

Original comment by hmad7...@gmail.com on 26 Jun 2013 at 11:11

GoogleCodeExporter commented 9 years ago
but not with spydroid

Original comment by hmad7...@gmail.com on 26 Jun 2013 at 11:12