KunZhong / ipcam-view

MJPEG video streaming on Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ipcam-view ipcam-view

Android Arsenal Download

Android MJPEG video streaming made simple!

A wrapper library around the well known SimpleMjpegView and android-camera-axis projects.

If you have problem to identify your IpCam url, please follow this link

Features

  • Default support by android-camera-axis
  • Native support by SimpleMjpegView
  • Handle credentials
  • Multiple camera in one activity
  • Snapshot
  • Video recording

Demo app

main default

two-camera snapshot

settings

Get it on Google Play

Usage

Add to your layout: example

<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  // ADD THIS
  xmlns:stream="http://schemas.android.com/apk/res-auto"
  ...>

    <com.github.niqdev.mjpeg.MjpegSurfaceView
      android:id="@+id/VIEW_NAME"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      stream:type="stream_default OR stream_native" />

</RelativeLayout>

Read stream in your activity/fragment: example

int TIMEOUT = 5; //seconds

Mjpeg.newInstance()
  .credential("USERNAME", "PASSWORD")
  .open("IPCAM_URL.mjpg", TIMEOUT)
  .subscribe(inputStream -> {
      mjpegView.setSource(inputStream);
      mjpegView.setDisplayMode(DisplayMode.BEST_FIT);
      mjpegView.showFps(true);
  });

Gradle dependency

repositories {
    jcenter()
}
dependencies {
    compile 'com.github.niqdev:mjpeg-view:1.1.0'
}

Apps that use this library

You are welcome to add your app to the list!

Development

Download Android NDK:

  • manually
  • in Android Studio: File > Other Settings > Default Project Structure > download NDK

Compile manually (verify your paths)

$ chmod a+x compileJni.sh
$ ./compileJni.sh

About

MJPEG video streaming on Android

License:MIT License


Languages

Language:C 72.7%Language:Shell 15.2%Language:Java 3.0%Language:Makefile 2.8%Language:C++ 2.1%Language:Roff 1.6%Language:SAS 0.6%Language:Module Management System 0.6%Language:M4 0.5%Language:Assembly 0.4%Language:HTML 0.3%Language:Smalltalk 0.1%