# Android sample

**URL:** <https://community.wowza.com/t/android-sample/43118>\
**Category:** Wowza Streaming Engine\
**Tags:** media-players-and-devices\
**Created:** [May 26, 2014, 1:17am UTC](https://community.wowza.com/t/android-sample/43118 "2014-05-26T01:17:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denis\_Zabolotny](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Denis\_Zabolotny](https://community.wowza.com/u/Denis_Zabolotny)\
**Post date:** [May 26, 2014, 1:17am UTC](https://community.wowza.com/t/android-sample/43118/1 "2014-05-26T01:17:46Z")

</div>

Hello. I need your advice in this matter:

1. Need to do live stream and vod from Android devices (version 4 +) on the Wowza server.

2. Be able to receive the stream on the Android devices from Wowza server.

Do you have some example for Android?

I would be grateful for any help in this matter. Thank you.

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [May 26, 2014, 8:47am UTC](https://community.wowza.com/t/android-sample/43118/2 "2014-05-26T08:47:51Z")

</div>

Hi there,

You can use the Wowza GoCoder app for Android to publish live streams:

[How to use Wowza GoCoder video broadcasting Android app](https://www.wowza.com/docs/how-to-use-wowza-gocoder-video-broadcasting-android-app)

The playback URL for Android looks like this:

```auto
rtsp://[wowza-ip]:1935/[application-name]/[stream-name]
rtsp://[wowza-ip]:1935/vod/mp4:sample.mp4

```

Also, please read through the [Quick Start Guide](https://www.wowza.com/docs/quick-start-guides) to help get you up to spead with Wowza.

Salvadore

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 28, 2014, 5:48pm UTC](https://community.wowza.com/t/android-sample/43118/3 "2014-05-28T17:48:41Z")

</div>

Follow [this guide](https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtsp-rtp-based-encoder) to setup an application to use with GoCoder as the live encoder.

Richard

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [June 3, 2014, 3:13am UTC](https://community.wowza.com/t/android-sample/43118/4 "2014-06-03T03:13:35Z")

</div>

Please refer to ticket

```auto
#93286

```

.

---

<div class="post-metadata">

**Author:** ![Denis\_Zabolotny](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Denis\_Zabolotny](https://community.wowza.com/u/Denis_Zabolotny)\
**Post date:** [May 28, 2014, 3:22am UTC](https://community.wowza.com/t/android-sample/43118/5 "2014-05-28T03:22:37Z")

</div>

> Hi there,
> 
> You can use the Wowza GoCoder app for Android to publish live streams:
> 
> [How to use Wowza GoCoder video broadcasting Android app](https://www.wowza.com/docs/how-to-use-wowza-gocoder-video-broadcasting-android-app)
> 
> The playback URL for Android looks like this:
> 
> ```auto
> rtsp://[wowza-ip]:1935/[application-name]/[stream-name]
> rtsp://[wowza-ip]:1935/vod/mp4:sample.mp4
> 
> ```
> 
> Also, please read through the [Quick Start Guide](https://www.wowza.com/docs/quick-start-guides) to help get you up to spead with Wowza.
> 
> Salvadore

Thanks for reply.

I’m doing a live stream from Android device. How to play it on another device?

Such URL - rtsp://[wowza-ip]:1935/[application-name]/[stream-name] does not work. How transform URL in “http” protocol? For example such URL - [http://live.3gv.ifeng.com/live/zixun.m3u8](http://live.3gv.ifeng.com/live/zixun.m3u8) work perfect on my Android device.

---

<div class="post-metadata">

**Author:** ![Denis\_Zabolotny](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Denis\_Zabolotny](https://community.wowza.com/u/Denis_Zabolotny)\
**Post date:** [May 30, 2014, 6:59am UTC](https://community.wowza.com/t/android-sample/43118/6 "2014-05-30T06:59:15Z")

</div>

Hello.

Thanks for reply. I read the user manual.

Use case #1:

I’m doing a live stream from Android device(version 4.2) on Wowza server. Here my config:

host - rtsp://10.0.1.9:1935/mediaApp/MyStream

user - root

password -123

Video codec - H264

Audio codec - AAC(AudioQuality(8000,16000))

In the console, I see this live stream tab “Incoming stream”. This stream I can watch through Flesh player and iOS (they use rtmp). Thats okay.

But when I try to watch live video on another Android device, nothing happens.(Message arrives, it is impossible to play video) Here’s the code:

> public class MainActivity extends Activity
> 
> {
> 
> @Override
> 
> protected void onCreate(Bundle savedInstanceState) {
> 
> super.onCreate(savedInstanceState);
> 
> getWindow().addFlags( WindowManager.LayoutParams.FLAG\_KEEP\_SCREEN\_ON);
> 
> requestWindowFeature( Window.FEATURE\_NO\_TITLE);
> 
> setContentView(R.layout.main\_new);
> 
> VideoView videoView = (VideoView) findViewById(R.id.videoView);
> 
> String httpLiveUrl = “rtsp://10.0.1.9.com:1935/mediaApp/MyStream”;
> 
> videoView.setVideoURI( Uri.parse( httpLiveUrl ));
> 
> videoView.setMediaController(new MediaController(this));
> 
> videoView.requestFocus();
> 
> videoView.start();
> 
> }
> 
> }

Use case #2:

I do stream from Android device to the Wowza server. In the console, do video recording in ‘mp4’ and ‘flv’ formats.

Next, I change the server settings for playing records and trying to play this video, using the same code.

host - rtsp://tc.themidnightcoders.com:1935/mediaApp/mp4:MyStream.mp4(for Android)

Flash - can play only flv format, but mp4 not(is there any way to play video in this format?).

iOS - can play only flv format, but mp4 not(is there any way to play video in this format?).

Android - сan not play video, which has been recorded on the device. (Basic “sample.mp4” work perfect)

Can you help me in this case?

Note: I think that you can do to stream from any client(Android, iOs, Flesh), your server converts it and outputs in the format that you want.

Such cases i have:

> publisher type player
> 
> Android Live Flash yes
> 
> Android Live iOS yes
> 
> Android Live Android no
> 
> Android Record Flash yes (flv format)
> 
> Android Record iOS yes (flv format)
> 
> Android Record Android no
> 
> Flash Live Android no
> 
> Flash Record Android no

Now I have the biggest problem is with the Android client, as you can see.

I hope very much for your help.

---

<div class="post-metadata">

**Author:** ![Denis\_Zabolotny](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Denis\_Zabolotny](https://community.wowza.com/u/Denis_Zabolotny)\
**Post date:** [June 2, 2014, 7:13am UTC](https://community.wowza.com/t/android-sample/43118/7 "2014-06-02T07:13:28Z")

</div>

Hello.

Another issue.

I do stream from Android device to the Wowza server. Here my file config:

Video codec - H.264

Audio codec - AAC(AudioQuality(8000,16000))

In the console, do video recording in ‘mp4’:

> File Name : M320.mp4
> 
> Directory : .
> 
> File Size : 342 kB
> 
> File Modification Date/Time : 2014:06:02 13:54:52+03:00
> 
> File Permissions : rw-rw-r–
> 
> File Type : MP4
> 
> MIME Type : video/mp4
> 
> Major Brand : Unknown (f4v )
> 
> Minor Version : 0.0.0
> 
> Compatible Brands : isom, mp42, m4v
> 
> Movie Data Size : 346518
> 
> Movie Header Version : 0
> 
> Create Date : 2014:06:02 10:54:40
> 
> Modify Date : 2014:06:02 10:54:40
> 
> Time Scale : 90000
> 
> Duration : 12.19 s
> 
> Preferred Rate : 1
> 
> Preferred Volume : 100.00%
> 
> Preview Time : 0 s
> 
> Preview Duration : 0 s
> 
> Poster Time : 0 s
> 
> Selection Time : 0 s
> 
> Selection Duration : 0 s
> 
> Current Time : 0 s
> 
> Next Track ID : 3
> 
> Track Header Version : 0
> 
> Track Create Date : 2014:06:02 10:54:40
> 
> Track Modify Date : 2014:06:02 10:54:40
> 
> Track ID : 1
> 
> Track Duration : 12.19 s
> 
> Track Layer : 0
> 
> Track Volume : 100.00%
> 
> Image Width : 320
> 
> Image Height : 240
> 
> Graphics Mode : srcCopy
> 
> Op Color : 0 0 0
> 
> Compressor ID : avc1
> 
> Source Image Width : 320
> 
> Source Image Height : 240
> 
> X Resolution : 72
> 
> Y Resolution : 72
> 
> Compressor Name : WowzaStreamingEngine
> 
> Bit Depth : 24
> 
> Video Frame Rate : 20.015
> 
> Matrix Structure : 1 0 0 0 1 0 0 0 1
> 
> Media Header Version : 0
> 
> Media Create Date : 2014:06:02 10:54:40
> 
> Media Modify Date : 2014:06:02 10:54:40
> 
> Media Time Scale : 90000
> 
> Media Duration : 12.18 s
> 
> Media Language Code : eng
> 
> Handler Type : Audio Track
> 
> Handler Description : WowzaStreamingEngine
> 
> Balance : 0
> 
> Audio Format : mp4a
> 
> Audio Channels : 1
> 
> Audio Bits Per Sample : 16
> 
> Audio Sample Rate : 8000
> 
> Avg Bitrate : 227 kbps
> 
> Image Size : 320x240
> 
> Rotation : 0
> 
> Note. On PC(Linux) video play well with sound. A video is played on the device itself is also good.
> 
> Next, try to play it in VOD mode on Android device. I use:
> 
> 1. rtsp://myIp:1935/mediaApp/mp4:M320.mp4
> 
> 2. [http://myIp:1935/mediaApp/mp4:M320.mp4/playlist.m3u8](http://myIp:1935/mediaApp/mp4:M320.mp4/playlist.m3u8)
> 
> Video does not play. ☹
> 
> But when I try to do the same with your “sample.mp4” All works. Why is this happening? Help me to understand the reason for this behavior.
