Tutorial #92: Live Streaming using Vitamio in Android

Hello friends!

Live video streaming is one of the most challenging functionalities to incorporate in an Android application. RTMP (Real Time Messaging Protocol) was developed by Adobe for Flash Player to transmit real-time media (audio, video) between a server and flash player. However, Android does not support RTMP out of the box. Hence, developers need to use third party libraries in order to stream a RTMP video.

Vitamio is an open multimedia framework or library for Android and iOS, with full and real hardware accelerated decoder and renderer. It supports streaming network protocols such as RTSP, RTMP, HLS and can play 720p/1080p HD mp4, mkv, m4v, mov, flv, avi, rmvb and many other video formats in Android and iOS. Through this tutorial, we will learn how to implement live streaming using Vitamio in Android.

Pre-requisites: Eclipse IDE, Android SDK

Step 1: Create Android project

Launch Eclipse IDE and create a new Android application project called AndroidVitamioDemo with package name com.app.vitamio.stream. Choose the target SDK as Android 4.4

Step 2: Add reference to Vitamio bundle (library)

Before creating the streaming Activity class, one needs to download the Vitamio Bundle and add the same as a reference to the above Android project. The Vitamio library will provide the required classes to setup, initialize and play the live stream.

Step 3: Create Activity class

Create a new Activity class called LiveStreamingActivity in order to implement the streaming process. Developers can also add an EditText to obtain the path or URL of the media file. For this tutorial, I have directly provided the URL to the media file.

LiveStreamingActivity.java

package com.app.vitamio.stream;

import io.vov.vitamio.LibsChecker;
import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;

public class LiveStreamingActivity extends Activity {

	private String pathToFileOrUrl= "rtmp://204.107.26.252:8086/live/796.high.stream";
	private VideoView mVideoView;
	
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		
		if (!LibsChecker.checkVitamioLibs(this))
			return;
		
		setContentView(R.layout.activity_video_stream);
		mVideoView = (VideoView) findViewById(R.id.surface_view);

		if (pathToFileOrUrl == "") {
			Toast.makeText(this, "Please set the video path for your media file", Toast.LENGTH_LONG).show();
			return;
		} else {

			/*
			 * Alternatively,for streaming media you can use
			 * mVideoView.setVideoURI(Uri.parse(URLstring));
			 */
			mVideoView.setVideoPath(pathToFileOrUrl);
			mVideoView.setMediaController(new MediaController(this));
			mVideoView.requestFocus();

			mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
				@Override
				public void onPrepared(MediaPlayer mediaPlayer) {
					// optional need Vitamio 4.0
					mediaPlayer.setPlaybackSpeed(1.0f);
				}
			});
		}

	}
	
	public void startPlay(View view) {
		if (!TextUtils.isEmpty(pathToFileOrUrl)) {
			mVideoView.setVideoPath(pathToFileOrUrl);
		}
	}

	public void openVideo(View View) {
		mVideoView.setVideoPath(pathToFileOrUrl);
	}

}

activity_video_stream.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal">

        <Button
            android:id="@+id/start"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="startPlay"
            android:text="@string/play_video"/>
    </LinearLayout>

    <io.vov.vitamio.widget.VideoView
        android:id="@+id/surface_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:onClick="openVideo"
        android:text="@string/open_video"/>

</LinearLayout>

Step 4: Add permissions to Manifest file!

One needs to update the AndroidManifest.xml file in order to include the required permissions.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app.vitamio.stream"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />
 
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name=".LiveStreamingActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       
        <activity
            android:name="io.vov.vitamio.activity.InitActivity"
            android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
            android:launchMode="singleTop"
            android:theme="@android:style/Theme.NoTitleBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        
    </application>

</manifest>

Save all changes. Make sure no errors are present. Run the application on an Android device and you should see the following output!

output_1

output_2

That’s it for this tutorial. Stay tuned for more! 🙂

Reference: Vitamio Bundle

Karan Balkar About Karan Balkar
self proclaimed extraterrestrial fandroid, computer engineer, amateur gamer and die hard punk rock fan!

98 thoughts on “Tutorial #92: Live Streaming using Vitamio in Android

  1. hi,
    I have followed all the steps. There are no errors. But I am not able to play the video. Only ‘Play Video’ is coming on my android device and nothing happens when I click on it.

    Any suggestions!

      • Hi Karan, I got same problem, the app can build ok, but when I run on my real device, it’s just show components and not play any videos. Maybe you right when said that it’s buffering. But, about 5 minutes later, app alert that “Sorry, can’t play this video”. So, do you know what happen?
        Thanks in advanced.

      • Hi Karan, I got same problem, the app can build ok, but when I run on my real device, it’s just show components and not play any videos. Maybe you right when said that it’s buffering. But, about 30 or 40 seconds later, app alert that “Sorry, can’t play this video”. So, do you know what happen?
        How to can i manage this error?
        Thanks in Advance

        • What is the video URL you are using? It may happen that the URL I was using is no longer active. So you might have to find some other URL. I used to get that message whenever there was no video stream present.

  2. Thank you friend the tutorial is perfect, would like an idea of ??how to add the EditText , is working 100 % my transfer an IP camera that is in unidados states and I’m currently in Brazil , thanks for sharing beautiful tutorial.

  3. package com.app.vitamio.stream;
    import io.vov.vitamio.LibsChecker;
    import io.vov.vitamio.MediaPlayer;
    import io.vov.vitamio.widget.MediaController;
    import io.vov.vitamio.widget.VideoView;
    i added vitamio library successfully but in side ma activity
    i cant import these class
    package com.app.vitamio.stream;
    import io.vov.vitamio.LibsChecker;
    import io.vov.vitamio.MediaPlayer;
    import io.vov.vitamio.widget.MediaController;
    import io.vov.vitamio.widget.VideoView;

  4. Thank you… nice work (y).
    But i can’t play this video. There is no error in code. When running the app, it shows “[tcp @ 0x5ce10850] Connection to tcp://204.107.26.252:8086 failed: Connection refused ” on logcat.

    • Yes it is possible. You need to first check how to setup an Android project with dependencies using Android Studio. There are many tutorials available on the internet for the same.

  5. it is showing error ‘Error:Configuration with name ‘default’ not found’.i checked all solutions but it is still there .

  6. hi,
    my emulator shows : unfortunately AndroidVitamioDemo
    Has Stopped….
    and in logchat :Could not find InitActivity.apk!
    what’s problem?

  7. Hey! Just one question: How did you modified your R.layout? If I dont modify my R.layout, both activity_video_stream and surface_view are set as error. Thank You!

  8. import io.vov.vitamio.LibsChecker;
    import io.vov.vitamio.MediaPlayer;
    import io.vov.vitamio.widget.MediaController;
    import io.vov.vitamio.widget.VideoView;

    I get an error for these imports.
    “Cannot resolve symbol”
    What do i have to do?

  9. hi,
    I have followed all the steps but i have some errors

    setContentView(R.layout.activity_video_stream);

    can not resolve symbol activity_video_stream

    mVideoView = (VideoView) findViewById(R.id.surface_view);

    can not resolve symbol surface_view

  10. i am not able to play multiple video simultaneously using vitamio lib error is ..Surface::lock failed, already locked , [Player](28590): LOCK BUFFER FAILED.

    • when i send by ffmpeg playlist with my command prompt that will show on my app but after end of this single video file of this playlist player stop how i will run continuos autoplay video while rtmp queue data/ video files

  11. I can run this on the emulator in Android Studio and works fine, but when i run the apk instalator into my android device and try to open the activity stay in black and then it close, how can i solve this situation?

  12. Hey Karan !
    such a nice and easy to follow tutorial. i am getting error at LibsChecker. although i have added library reference into my project.

  13. Hi Karan

    I use the code with above tutorial and i am able to play videos from urls, however the video play back is not sharp or smooth and the video also play slowly. But if i use other video players they are able to play everything fine. Please kindly help solve this problem. Thanks you

  14. Hi,

    Is is possible that I use it the other way round – I mean to say I record a video through my phone and I push it on the Webserver without saving it on my device?

    If yes, how?

    In gratitude,

  15. Hi,
    i am working on video streaming android app, if i try to run my app in avd i am not getting the video played. So here i have posted the logcat details,please help me in getting the video played.

    08-26 12:51:20.800: D/AndroidRuntime(2775): Shutting down VM
    08-26 12:51:20.801: E/AndroidRuntime(2775): FATAL EXCEPTION: main
    08-26 12:51:20.801: E/AndroidRuntime(2775): Process: com.example.javacodegeeks.androidvideoviewexample, PID: 2775
    08-26 12:51:20.801: E/AndroidRuntime(2775): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.javacodegeeks.androidvideoviewexample/com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample}: java.lang.ClassNotFoundException: Didn’t find class “com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample” on path: DexPathList[[zip file “/data/app/com.example.javacodegeeks.androidvideoviewexample-1/base.apk”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread.access$800(ActivityThread.java:151)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.os.Looper.loop(Looper.java:135)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread.main(ActivityThread.java:5257)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.reflect.Method.invoke(Native Method)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.reflect.Method.invoke(Method.java:372)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    08-26 12:51:20.801: E/AndroidRuntime(2775): Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample” on path: DexPathList[[zip file “/data/app/com.example.javacodegeeks.androidvideoviewexample-1/base.apk”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    08-26 12:51:20.801: E/AndroidRuntime(2775): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
    08-26 12:51:20.801: E/AndroidRuntime(2775): … 10 more
    08-26 12:51:20.801: E/AndroidRuntime(2775): Suppressed: java.lang.ClassNotFoundException: com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.Class.classForName(Native Method)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    08-26 12:51:20.801: E/AndroidRuntime(2775): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    08-26 12:51:20.801: E/AndroidRuntime(2775): … 13 more
    08-26 12:51:20.801: E/AndroidRuntime(2775): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
    08-26 12:51:39.434: I/Process(2775): Sending signal. PID: 2775 SIG: 9
    08-26 12:53:04.643: D/AndroidRuntime(2824): Shutting down VM
    08-26 12:53:04.643: E/AndroidRuntime(2824): FATAL EXCEPTION: main
    08-26 12:53:04.643: E/AndroidRuntime(2824): Process: com.example.javacodegeeks.androidvideoviewexample, PID: 2824
    08-26 12:53:04.643: E/AndroidRuntime(2824): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.javacodegeeks.androidvideoviewexample/com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample}: java.lang.ClassNotFoundException: Didn’t find class “com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample” on path: DexPathList[[zip file “/data/app/com.example.javacodegeeks.androidvideoviewexample-2/base.apk”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread.access$800(ActivityThread.java:151)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.os.Looper.loop(Looper.java:135)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread.main(ActivityThread.java:5257)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.reflect.Method.invoke(Native Method)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.reflect.Method.invoke(Method.java:372)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    08-26 12:53:04.643: E/AndroidRuntime(2824): Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample” on path: DexPathList[[zip file “/data/app/com.example.javacodegeeks.androidvideoviewexample-2/base.apk”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    08-26 12:53:04.643: E/AndroidRuntime(2824): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
    08-26 12:53:04.643: E/AndroidRuntime(2824): … 10 more
    08-26 12:53:04.643: E/AndroidRuntime(2824): Suppressed: java.lang.ClassNotFoundException: com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.Class.classForName(Native Method)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    08-26 12:53:04.643: E/AndroidRuntime(2824): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    08-26 12:53:04.643: E/AndroidRuntime(2824): … 13 more
    08-26 12:53:04.643: E/AndroidRuntime(2824): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
    08-26 12:53:09.083: I/Process(2824): Sending signal. PID: 2824 SIG: 9
    08-26 13:02:30.299: I/System.out(2964): Sending WAIT chunk
    08-26 13:02:30.331: I/art(2964): Debugger is active
    08-26 13:02:30.514: I/System.out(2964): Debugger has connected
    08-26 13:02:30.514: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:30.724: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:30.934: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:31.144: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:31.354: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:31.564: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:31.774: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:31.984: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:32.194: I/System.out(2964): waiting for debugger to settle…
    08-26 13:02:32.404: I/System.out(2964): debugger has settled (1486)
    08-26 13:15:16.551: W/ActivityThread(3070): Application com.example.javacodegeeks.androidvideoviewexample is waiting for the debugger on port 8100…
    08-26 13:15:16.556: I/System.out(3070): Sending WAIT chunk
    08-26 13:15:16.599: I/art(3070): Debugger is active
    08-26 13:15:16.766: I/System.out(3070): Debugger has connected
    08-26 13:15:16.766: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:16.976: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:17.186: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:17.395: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:17.605: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:17.816: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:18.026: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:18.236: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:18.445: I/System.out(3070): waiting for debugger to settle…
    08-26 13:15:18.655: I/System.out(3070): debugger has settled (1445)

    • Hi,

      As per the logcat, it shows error “Unable to instantiate activity ComponentInfo{com.example.javacodegeeks.androidvideoviewexample/com.example.javacodegeeks.androidvideoviewexample.AndroidVideoViewExample}: java.lang.ClassNotFoundException”. Can you please check if this Activity has been added in the AndroidManifest.xml file?

  16. First of all great work! thanks for sharing all your knowledge with us. However, i have a problem with one site. The rtmp in particular is: rtmp://servicioamerica.net:1935/8358,8358
    the 8358 part at the end is, as i presume, the “stream alias” or user. I’ve tried this in http://www.wowza.com/resources/3.5.0/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html and it works, using this numer in the field stream.

    Is there a way to set alias or user to the path? or a method to do so?

    thanks in advance, regards from argentina

  17. Thanks for your helpful post.

    http://prntscr.com/8fej9p

    Please visit the URL. I am getting this error, when I want play a live streaming video. The URL is working in my web using flash player but is not working in there.

    url is looklike
    rtmp://x.x.x.x:8134/live/sports1

    Could you please advice me.

  18. Hello Karan,
    I am making an app.I import the vitamio library project to my eclipse.It shows like this
    “No projects are found to import”
    How to import vitamio library project to eclipse?

  19. I am getting this exception :
    E/AndroidRuntime(3520): java.lang.NullPointerException: Attempt to invoke virtual method ‘void io.vov.vitamio.widget.VideoView.setVideoPath(java.lang.String)’ on a null object reference

    does someone knows about it ?

  20. hey , first of all , thanks for the tutorial is really heplfull. i just have a litle problem. i can not play rtmp streams with vitamio. i just can play rtsp and other formats, but not the rtmp url. i just have this error on the logcat : E/Vitamio[Player]: Native libs libffmpeg.so not exists!.

    I am very grateful if someone can assist me a little about what’s going on that error.

  21. Thanks for sharing your knowledge. Do we need libffmpeg.so to build into project?

    I have some problem. I am using Android Studio. I can able to add vitamio as a library. I can able to write video player code using vitamio API classes.

    While running, when playing a https url, It Logs,

    “Native libs libffmpeg.so not exists!”

    Looking forward for a response.

  22. Run Vitamio in a service
    Hi, i am using vitamio to play mp3 (audio). before this i tried android’s media player that also work, but it have some problems according to efficiency. Now Vitamio works well.
    My problem is, as when i am playing audio(from url), it playing just nice, but as i close that activity the stops which is usual, now i want to play vatamio in a service, or with any other method to play in background. Even when the app is closed. Please guide, any help will be appreciated. if possible please mail me. Thank u.

  23. I broadcast a rtsp video to womza media server (rtps://ipadress:port/application/test.stream) and I can successfully play using test player on web using url rtmp://ipaddress:port/application/test.stream, but when I play it with Vitamio library with that url the message Buffering video is constantly displayed with no errors on the log and active stream never starts playing. In addition, my wowza streaming engine manager connectio monitor doesn’t show any rtmp connection while I try to play video. I am using H263 format for my video and wowza media server for streaming. My android version is API 22 Lolipop (LGG4 phone) and my wowza server is temporarely located in my own laptop (I use my IP address). Do I need to use rtps or rtmp protocol when playing this video with vitamio videoview. Do I even need it or I can use videoview with rtps video. Please send me a hint on email zukinatibor@gmail.com

  24. I have a problem streaming my rtsp H263 video in API 22 Lolipop using Vitamio videoview. The message Buffering video is constantly displayed and the video never starts playing. I am using another Android device to stream this video to Wowza Media server with rtmp protocol and I can easily see it’s preview on test rtmp player in any other browser. When I try to play the same rtmp video with Vitamio it doesn’t start and my Wowza Media Server connection monitor doesn’t see any rtmp connection to it. Do I need to use rtmp or rtsp protocol to play the video? Can I use standard videoview instead of Vitamio videoview. Please give me a hint about my problem. My email is zukinatibor@gmail.com

  25. Hi! Thanks for your tutorial, it work fine :D, but when i test in genymotion, seem “return” at “if (!LibsChecker.checkVitamioLibs(this))
    return;”
    my logcat show “: Native libs libffmpeg.so not exists!”
    I know Vitamio had supported x86 since version 4.1.0
    Can you help me?

    • Hi All,

      Please update the RTMP URL in the LiveStreamingActivity.java file to “rtmp://fms.12E5.edgecastcdn.net/0012E5/mp4:videos/8Juv1MVa-485.mp4” as the current URL is no longer active.

      Thanks,
      Karan

  26. Hi,

    I am using your tutorial to play videos from a URL. But i am not able to play any video. I get the following in my logcat –

    01-18 12:13:18.621: E/Vitamio[4.2.6][Player](3045): avformat_open_input: No such file or directory : -2
    01-18 12:13:18.621: E/Vitamio[4.2.6][Player](3045): error (1, -2)
    01-18 12:13:18.815: E/Vitamio[Player](3045): Error (1, -2)

    Could you please help?

  27. I have been trying to make this tutorial for days now and it never worked for me as everything is different from the latest Eclipse I even tried with the latest Android studio but I am getting a lot of error.
    Can someone please confirm this tut is not outdated?
    Or at least on how to use Android Studio please.

    • Hi Ade,

      The tutorial is not outdated. It is not an Android Studio project so you will have to use Eclipse IDE to run the same. Can you tell me what issues are you facing? Have you referenced the latest Vitamio library to your Android project? Are you getting any errors?

      Regards,
      Karan

  28. Informative,keep doing the great job.Learn to create great Video Tutorials,Streaming, Corporate Videos & Animations.Learn to shoot with the right ISO, Exposure & Aperture and then learn to edit them.

  29. Hi karan,
    At first thanks alot for the tutorial.It really helped me. I am trying to make an Android App where i can see the Live Videos from an IP CCTV camera. Can you help me in how to search and connect to the IP cameras and integrate with the code you provided. I am a beginner and dont know how to proceed with this. With the help of th above posts , I managed to fix the similar errors Just need a little Push,
    Would be really nice if you can help me out
    Thanks

  30. I am very happy for this tutorial. Once again thank you for this great tutorial. In effe I’m on final project study and I used to read Vitamio radio streams and AC works very well. but I do not know how to add a service for the radio playing in the background on Vitamio. Thank you very much for your help. you excluser me the quality of my French. here is my email address blaisedjontso@gmail.com

  31. Hello karan,
    Have you a sample URL?
    If you have then please give me i want to test in your demo, because i don’t have any sample URL so…
    Thanks in advance..

  32. I can’t able to add vitamio Library in the project .. Kindly suggest me some method. I am new in android programming

    • Hi,

      Are you using Eclipse or Android Studio? In case of Eclipse, you need to add the Vitamio library as a reference project. Check this link to learn how to reference library projects in Eclipse.

      In case of Android Studio, you need to add the .jar file inside the libs folder of your project and mention the path for the same in the build.gradle file. Let me know if any concerns.

      Regards,
      Karan

  33. Hi Karan,
    I can able to add vitamio as a library and I can able to write code using vitamio API. But when playing a https url, It Logs,

    “Native libs libffmpeg.so not exists!”

    While running, when playing a https url, It Logs,

    “Native libs libffmpeg.so not exists!”

  34. i got problem while running applicaton on real device,

    20834/com.example.admin.myproject I/Vitamio[4.2.6][Player]: VPLAYER INIT BEGIN
    04-03 12:06:13.999 20834-20834/com.example.admin.myproject I/Vitamio[4.2.6][Player]: Application package name: com.example.admin.myproject
    04-03 12:06:13.999 20834-20834/com.example.admin.myproject A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 20834 (admin.myproject)

Leave a Reply

Your email address will not be published. Required fields are marked *