6

I've used VideoView in Android to play video on wowza successfully. Now I got to deal with my server which the UDP ports seems to be blocked. With the proof of openRTSP command:

-> % openRTSP rtsp://61.218.52.250:554/live/ch00_0

Opening connection to 61.218.52.250, port 554...
...remote connection opened
Sending request: OPTIONS rtsp://61.218.52.250:554/live/ch00_0 RTSP/1.0
CSeq: 2
User-Agent: openRTSP (LIVE555 Streaming Media v2013.12.16)


Received 105 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Server: UBNT Streaming Server v1.2
Public: DESCRIBE, SETUP, TEARDOWN, PLAY


Sending request: DESCRIBE rtsp://61.218.52.250:554/live/ch00_0 RTSP/1.0
CSeq: 3
User-Agent: openRTSP (LIVE555 Streaming Media v2013.12.16)
Accept: application/sdp


Received 562 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Server: UBNT Streaming Server v1.2
Content-Base: rtsp://61.218.52.250:554/live/ch00_0/
Content-Type: application/sdp
Content-Length: 393

v=0
o=- 1 1 IN IP4 127.0.0.1
s=Ubiquiti Live
i=UBNT Streaming Media
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 99
b=AS:50000
a=framerate:25
a=x-dimensions:1280,720
a=x-vendor-id:ubnt,a521
a=x-rtp-ts:4617405454576779984
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z0IAKOkAoAt1xIAG3dAAzf5gDYgQlA==,aM4xUg==
a=control:trackID=0

Opened URL "rtsp://61.218.52.250:554/live/ch00_0", returning a SDP description:
v=0
o=- 1 1 IN IP4 127.0.0.1
s=Ubiquiti Live
i=UBNT Streaming Media
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 99
b=AS:50000
a=framerate:25
a=x-dimensions:1280,720
a=x-vendor-id:ubnt,a521
a=x-rtp-ts:4617405454576779984
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z0IAKOkAoAt1xIAG3dAAzf5gDYgQlA==,aM4xUg==
a=control:trackID=0

Created receiver for "video/H264" subsession (client ports 63346-63347)
Sending request: SETUP rtsp://61.218.52.250:554/live/ch00_0/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: openRTSP (LIVE555 Streaming Media v2013.12.16)
Transport: RTP/AVP;unicast;client_port=63346-63347


Received 47 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 461 Unsupported Transport
CSeq: 4


Failed to setup "video/H264" subsession: 461 Unsupported Transport

After searching around I found it seems Android still not support RTSP over TCP:

When streaming to an Android device using RTSP/RTP, the RTP portion must flow over UDP. Android doesn't support RTSP/RTP interleaved (RTP over TCP). This means that if UDP is unavailable for RTP playback, RTP over TCP won't work as a failover and your stream won't play.

Considering it's posted on 2010, does Android 4.x support RTSP over TCP now? I've found lots of post asking for how to force transfer via TCP other than UDP. I guess it's not.

If not, could I achieve it by re-compiling and using ffmpeg library?

Basically I hope ffmpeg could help me to automatically switch to TCP while UDP not available.

Mycoola
  • 1,135
  • 1
  • 8
  • 29
Robert
  • 1,660
  • 22
  • 39
  • 1
    I have same problem, do you have found a solution ? – tulkas85 Feb 21 '14 at 11:15
  • Well, I use the source code of VLC for android to do the job instead. VLC handle the underlying UDP streaming with some elegant native code. And with JNI it will post back the stream back to Java to display it with Android activity. You can check out here: https://wiki.videolan.org/AndroidCompile/ – Robert Feb 23 '14 at 06:56
  • Thank you, do you think is possible to use vlc for display two or more streaming video in same activity's layout ? I have a grid-video-view with more streaming video, but works only using udp. For my purpose I think that need to replace videoviews with many vlc surfaces... – tulkas85 Feb 24 '14 at 11:37
  • The hard work of receiving & decoding stream is done by LibVLC which is constructed with Singleton and the class is wrapped with synchronized keyword, so I think it could be used in your situation. From VideoPlayerActivity I see two handlers responsible for doing what the libVLC told it to do, so you might need to find a way to extract the surfaceView with all those event triggers. I'd like to know how you work it out! :D – Robert Feb 25 '14 at 05:53
  • Have you same example code for help me to start ? – tulkas85 Feb 25 '14 at 11:35
  • You can just clone from the link here: https://wiki.videolan.org/AndroidCompile/#Get_VLC_Source. It contains the whole package of native & java code. Make yourself a successfully-compiled apk, run it, see what the logcat print out. I think you can start from VideoPlayerActivity to see how things connect up. – Robert Feb 26 '14 at 08:43
  • I try using fragment for show multiple vlc player, but only one surface does work. If I set three fragments in layout, only last surface rendering video. I not see important error. I post my code and my question here : https://forum.videolan.org/viewtopic.php?f=35&t=117760 – tulkas85 Feb 28 '14 at 12:01
  • I open same question on stackoverflow: http://stackoverflow.com/questions/22094779/android-libvlc-multiple-surface-problems – tulkas85 Feb 28 '14 at 12:07

0 Answers0