RTSP issues on Android 4.x series

Hi.

Android 4.x does not stream RTSP content from Wowza, while 2.x and VLC work just fine.

Any idea what changed in Android 4.x, and what can be done to resolve it?

Thanks.

It is more likely that UDP ports are blocked. If you see two sets of audio and info info blocks in VLC Tools > Codec info, that indicates that UDP ports are blocked or not mapped to your server, in which case VLC fails-over to TCP. However Android devices typically cannot do that.

Take a look at these guides:

https://www.wowza.com/docs/how-to-set-up-an-application-for-rtsp-rtp-streaming

https://www.wowza.com/docs/how-to-troubleshoot-rtsp-rtp-playback

Richard

Do you still see VLC failing-over like that?

Another indicator is in the Wowza logs, when you try to playback on the Android if you see RTPTransport.bind messages followed immediately by RTPTransport.unbind messages for the same port.

You also have to map UDP ports in your network to the Wowza server, for example port-forwarding in a home router

Richard

Make sure UDP ports are wide open and that you are properly configured for RTSP streaming. Take a look at these articles:

https://www.wowza.com/docs/how-to-set-up-an-application-for-rtsp-rtp-streaming

https://www.wowza.com/docs/how-to-troubleshoot-rtsp-rtp-playback

For encoding, you can emulate the encoding of BigBuckBunny_115k.mov in your live stream. Take a look at the FFmpeg command that encoded that file for reference, in this article:

https://www.wowza.com/docs/how-to-encode-video-on-demand-content

We can’t recommend HLS to Android.

Richard

The RTP section looks unchanged. It if is not behind a NAT, that’s okay. Did you go thru those two guides? UDP ports are the most common problem.

Richard

Android 3.x+ supports HLS. If latency is not an issue, simply use that?

Just do some useragent detection and switch playback between rtsp/HLS based on Android version from useragent.

Hi.

VLC indeed works only in RTSP-over-TCP mode, but it never impacted Android clients before, on versions 2.x…

Anyhow, I verified and we have the ports 6970-9999 opened on the server side. Should we open or change anything else?

Thanks.

Just to add, Android’s HLS support is still very buggy:

http://www.longtailvideo.com/blog/31646/the-pain-of-live-streaming-on-android

We embed with JW 6 and just do something like this:

<div id="myElement">
    <a href="rtsp://[wowza-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4">Watch this stream over RTSP</a>
</div> 
jwplayer("myElement").setup({
    file: "http://[wowza-ip-address]/vod/_definst_/mp4:myvideos/sample.mp4/playlist.m3u8",
    fallback: false
});

That will give them the same thing as other users (HLS, or RTMP if you prefer), and if that’s not supported, it should just display the RTSP link they can click on manually.

I’d go one step further and give them that same RTSP link outside the JW Player, in case Flash or HLS support is detected but just not working right:

<script type="text/javascript" language="JavaScript">
if ( navigator.userAgent.indexOf('Android') >= 0) ) {
  document.write('<a href="rtsp://[wowza-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4">Watch this stream over RTSP</a>');
}
</script>

I don’t think any finer/better control is possible with Android right now unless you know your clients specific devices and software versions.

Hello. I have the same issue

Wowza has a direct internet connection, and all UDP ports are opened.

At the client side I have a home wifi router and Samsung Galaxy Note II. Also, I have a PC connected to that router by ethernet.

The sample rtsp stream at https://www.wowza.com/html/mobile.html is playing well both on mobile and PC (by VLC). So, I think, it is all good at the client side.

But the stream from my server is played on VLC only, not on the phone. (rtsp://grey.ether.tv/live/moskva/broadcast37)

Android video player says me just “Can not play the video”, and does not explain why.

And there are no records containing “RTPTransport” in the log:

grey logs # tail -f access.log

2013-04-21 19:55:48 MSK connect rtsp INFO 200 defaultVHost live moskva -

2013-04-21 19:55:48 MSK create stream INFO 200 defaultVHost live moskva -

2013-04-21 19:55:48 MSK describe rtsp INFO 200 defaultVHost live moskva -

2013-04-21 19:55:48 MSK unpublish stream INFO 200 defaultVHost live moskva -

2013-04-21 19:55:48 MSK destroy stream INFO 200 defaultVHost live moskva -

2013-04-21 19:55:48 MSK disconnect rtsp INFO 200 defaultVHost live moskva -

I have tried to change log level to DEBUG (log4j.properties), but nothing about RTPTransport and UDP ports was appeared.

How ca I see, does Wowza attempts to bind to UDP or not?

Sorry, I have left out that test stream (Big Buck Bunny) is a VOD, and my issue and the topic is live streaming.

VOD is working well, in all cases

Hi, I see you use Transcoder.

Could you provide more details about the target stream.

I try to stream IP camera to Android Nexus device and it fails with native android player.

VOD works perfectly.

I made sure all UDP ports were open though EC2. They were not - However, now that they ARE open, I have the same behavior - choppy video and audio on Android 4.1.2.

I also went through both guides and seem to be doing all that they ask for - I apparently don’t need to set my IP in RTPTransportMode/* when I am using EC2, it is set for me.

Here are 2 links to the stream: rtsp://54.235.112.103/live/livestream_240p/ & rtsp://54.235.112.103/live/livestream_720p/

HLS to android 4.1.2 has better video than this, but the audio is way out of sync.

Has there been any resolution to this?

I am experiencing the same issues. HLS is buggy and there’s a lot of issues/drift in Android 4.x+

I am also having problems getting RTSP to work - I can get audio only to work fine, but any time Video is also involved, on Android 4.1 the video is distorted and miscolored and out of sync.

For what it’s worth, rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov works fine for me as well. But … that’s not live streaming

Here’s my configuration. Do you see any issues that would be causing RTSP not to work properly to Android 4.x?

Everything works fine with HTTP Live Streaming to Apple. I am sending Wowza a H.264 RTMP stream created with Adobe Flash Encoder which is transcoded to RTSP, HLS, etc. I am using Wowza 3.5.2.01 build3917 on EC2

<Root>
	<Application>
		<!-- Uncomment to set application level timeout values
		<ApplicationTimeout>60000</ApplicationTimeout>
		<PingTimeout>12000</PingTimeout>
		<ValidationFrequency>8000</ValidationFrequency>
		<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
		<MaximumSetBufferTime>60000</MaximumSetBufferTime>
		<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
		-->
		<Connections>
			<AutoAccept>true</AutoAccept>
			<AllowDomains></AllowDomains>
		</Connections>
		<Streams>
			<StreamType>live</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater -->
			<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer</LiveStreamPacketizers>			
			<Properties>
				<Property>
					<Name>enableDynamicStreamMarkers</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</Streams>
		<Transcoder>
			<!-- To turn on transcoder set to: transcoder -->
			<LiveStreamTranscoder>transcoder</LiveStreamTranscoder>
			<!-- [templatename].xml or ${SourceStreamName}.xml -->
			<Templates>${SourceStreamName}.xml,transrate.xml</Templates>
			<ProfileDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles</ProfileDir>
			<TemplateDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/templates</TemplateDir>
			<Properties>
			</Properties>
		</Transcoder>
		<DVR>
			<!-- As a single server or as an origin, use dvrstreamingpacketizer in LiveStreamPacketizers above -->
			<!-- Or, in an origin-edge configuration, edges use dvrstreamingrepeater in LiveStreamPacketizers above -->
			<!-- As an origin, also add dvrchunkstreaming to HTTPStreamers below -->
			<!-- To turn on DVR recording set Recorders to dvrrecorder.  This works with dvrstreamingpacketizer  -->
			<Recorders></Recorders>
			<!-- As a single server or as an origin, set the Store to dvrfilestorage-->
			<!-- edges should have this empty -->
			<Store></Store>
			<!--  Window Duration is length of live DVR window in seconds.  0 means the window is never trimmed. -->
			<WindowDuration>0</WindowDuration>
			<!-- Storage Directory is top level location where dvr is stored.  e.g. c:/temp/dvr -->
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/dvr</StorageDir>
			<!-- valid ArchiveStrategy values are append, version, delete -->
			<ArchiveStrategy>append</ArchiveStrategy>
			<!-- If this is a dvrstreamingrepeater, define ChunkOriginURL to point back to origin -->
			<!-- And define Application/Repeater/OriginURL to point back to the origin -->
			<Repeater>
				<ChunkOriginURL></ChunkOriginURL>
			</Repeater>
			<!-- Properties for DVR -->
			<Properties>
			</Properties>
		</DVR>
		<TimedText>
			<!-- VOD caption providers (separate with commas): vodcaptionproviderttml, vodcaptionprovidermp4_3gpp -->
			<VODTimedTextProviders>vodcaptionprovidermp4_3gpp</VODTimedTextProviders>
			<Properties>
			</Properties>		
		</TimedText>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>			
		<SharedObjects>
			<StorageDir></StorageDir>
		</SharedObjects>
		<Client>
			<IdleFrequency>-1</IdleFrequency>
			<Access>
				<StreamReadAccess>*</StreamReadAccess>
				<StreamWriteAccess>*</StreamWriteAccess>
				<StreamAudioSampleAccess></StreamAudioSampleAccess>
				<StreamVideoSampleAccess></StreamVideoSampleAccess>
				<SharedObjectReadAccess>*</SharedObjectReadAccess>
				<SharedObjectWriteAccess>*</SharedObjectWriteAccess>
			</Access>
		</Client>
		<RTP>
			<!-- RTP/Authentication: none, basic, digest -->
			<Authentication>
				<PublishMethod>none</PublishMethod>
				<PlayMethod>none</PlayMethod>
			</Authentication>
			<!-- RTP/AVSyncMethod: senderreport, systemclock, rtptimecode -->
			<AVSyncMethod>senderreport</AVSyncMethod>
			<MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
			<IdleFrequency>75</IdleFrequency>
			<RTSPSessionTimeout>90000</RTSPSessionTimeout>
			<RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
			<RTSPBindIpAddress></RTSPBindIpAddress>
			<RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
			<RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
			<IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
			<Properties>
			</Properties>
		</RTP>
		<MediaCaster>
			<RTP>
				<RTSP>
					<!-- udp, interleave -->
					<RTPTransportMode>interleave</RTPTransportMode>
				</RTSP>
			</RTP>
			<Properties>
			</Properties>
		</MediaCaster>
		<MediaReader>
			<Properties>
			</Properties>
		</MediaReader>
		<MediaWriter>
			<Properties>
			</Properties>
		</MediaWriter>
		<LiveStreamPacketizer>
			<Properties>
				<Property>
					<Name>cupertinoChunkDurationTarget</Name>
					<Value>10000</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoMaxChunkCount</Name>
					<Value>10</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoPlaylistChunkCount</Name>
					<Value>3</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoRepeaterChunkCount</Name>
					<Value>3</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoEnableDataEvents</Name>
					<Value>false</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</LiveStreamPacketizer>
		<HTTPStreamer>
			<Properties>
			</Properties>
		</HTTPStreamer>
		<Repeater>
			<OriginURL></OriginURL>
			<QueryString><![CDATA[]]></QueryString>
		</Repeater> 
		<Modules>
			<Module>
				<Name>base</Name>
				<Description>Base</Description>
				<Class>com.wowza.wms.module.ModuleCore</Class>
			</Module>
			<Module>
				<Name>properties</Name>
				<Description>Properties</Description>
				<Class>com.wowza.wms.module.ModuleProperties</Class>
			</Module>
			<Module>
				<Name>logging</Name>
				<Description>Client Logging</Description>
				<Class>com.wowza.wms.module.ModuleClientLogging</Class>
			</Module>
			<Module>
				<Name>flvplayback</Name>
				<Description>FLVPlayback</Description>
				<Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
			</Module>
		</Modules>
		<Properties>
		</Properties>
	</Application>
</Root>

I made sure all UDP ports were open though EC2. They were not - However, now that they ARE open, I have the same behavior - choppy video and audio on Android 4.1.2.

I also went through both guides and seem to be doing all that they ask for - I apparently don’t need to set my IP in RTPTransportMode/* when I am using EC2, it is set for me.

Here are 2 links to the stream: rtsp://54.235.112.103/live/livestream_240p/ & rtsp://54.235.112.103/live/livestream_720p/

HLS to android 4.1.2 has better video than this, but the audio is way out of sync.

Hi, I see you use Transcoder.

Could you provide more details about the target stream.

I try to stream IP camera to Android Nexus device and it fails with native android player.

VOD works perfectly.

Sam, have you read through this guide:

How to troubleshoot RTSP/RTP playback

Do you get any error messages in the logs when you try to play back the stream on Android?

Salvadore

During the initial installation of your router, no internet connection is detected on your phone line. So I search many websites to resolve common home network connection issues, So I see Netgear Arlo Support Number at https://www.netgearroutersupportnumber.com/netgear-arlo-support/ to improve my network security and reduce theft chances from high theft protection.