GithubHelp home page GithubHelp logo

tommyteavee / androidstreamingclient Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ekumenlabs/androidstreamingclient

0.0 1.0 0.0 927 KB

Library that receives UDP packets wrapped into RTP and coded in H264, decodes the corresponding frames and plays the resulting stream in an Android SurfaceView

License: Apache License 2.0

HTML 84.79% CSS 1.07% Java 14.14% Shell 0.01%

androidstreamingclient's Introduction

#Android Streaming Client

##Introduction

###What it does?

Android Streaming Client is a library to play real time video in an Android device.

###How does it work

The current version of the code only supports RTP over UDP as the transport protocol and only decodes H264 encoded video.
Android Streaming Client uses efflux library to create an underlying RTP session and listen to packages.

It includes two different approaches to handle the package arrival:

  • Min-delay, which uses an RTP buffer that sends packets upstream for processing immediately. Each packet will be sent upstream only if it is the one being expected, hence this approach will work as long as the packages arrive in order. If a received packet is newer than the one being expected, it will be stored in order. Also, If stored packages are older than the configured threshold, they will be discarded.

* *Time-window*, which uses an RTP buffer that keeps packets for a fixed amount of time and moves forward at a fixed rate. The received packets are pushed upstream in the same order and at a fixed rate. This approach uses two threads, one for storing the packets that arrive to the client and another to consume them with some wisdom.

##How do I use it

  • Add the following dependency in your module's build.gradle file:
dependencies {
   compile('com.creativa77:android_streaming_client:1.0.+')
}

Version number may change.

  • Import the library in your main activity

   import com.c77.androidstreamingclient.lib.RtpMediaDecoder;
   
  • On onCreate method, create a Decoder and start it
   @Override
   protected void onCreate(Bundle savedInstanceState) {

      ...
   
      // create an RtpMediaDecoder with the surface view where you want 
      // the video to be shown
      RtpMediaDecoder rtpMediaDecoder = new RtpMediaDecoder(surfaceView);   
      // start it
      rtpMediaDecoder.start();
      
      ...
   }
   
  • Remember to release the Decoder when onStop is called.
   @Override
   protected void onStop() {
      
      ...
      
      // release decoder when application is stopped
      rtpMediaDecoder.release();
      
      ...
      
   }
   

##Video Publishers

###Libstreaming

Android Streaming Client can play video streamed by an Android library called libstreaming. To give it a try, you can use the repositories used while developing Android Streaming Client library.

Follow this steps:

  • Clone libstreaming-examples fork:
   > git clone https://github.com/ashyonline/libstreaming-examples

  • Clone libstreaming inside libstreaming-examples's folder:
   > git clone https://github.com/ashyonline/libstreaming

  • Create an empty Android Studio project.

* Import [libstreaming](https://github.com/ashyonline/libstreaming) library in Android Studio as a module.

  • Import example4 project as a module in Android Studio and add the libstreaming dependency to its build.gradle file:
   dependencies {
      compile project(':libstreaming')
   }

  • Clone this repository:
   > git clone [email protected]:creativa77/AndroidStreamingClient.git

  • Import example as a module in Android Studio.

* Check the IP address of the *player* device and change [this line](https://github.com/ashyonline/libstreaming-examples/blob/master/example4/src/net/majorkernelpanic/example4/MainActivity.java#L25) accordingly, so that the publisher knows where to stream the video to.

  • Run example4 in the publisher Android device.

  • Run the example module from Android Streaming Client in the player Android device.

If everything works, you will be streaming video from one device to another in real time.

##Other video publishers

Be sure to point your video publisher to the device's IP where you are playing video.

###Disclamer

So far, Android Streaming Client was tested with video streamed from libstreaming library running in a separate Android device. It uses a custom version of libstreaming which is composed of the original libstreaming library plus a couple changes that fix particular issues encountered while working on the Android Streaming Client library.

##Content of the project

This project contains an Android library which source code is located in the folder android_streaming_client and an Android application that uses the library located in the folder example. The efflux folder includes the efflux library source code.

Since Android Streaming Client was created using Android Studio, you will find several gradle files that include dependencies, versions, and other project configurations. The license_script folder includes a script to apply the license to every java file. You can also find the LICENSE and README files.

##Documentation

Android Streaming Client library documentation is located in doc, inside the android_streaming_client folder.

##Authors

Ayelen Chavez [email protected]

Julian Cerruti [email protected]

##Issues, bugs, feature requests

Github issue tracker

##Licensing

This project uses code from efflux library Copyright 2010 Bruno de Carvalho, licensed under the Apache License, Version 2.0. Efflux author gave us full approval to use his library.

Android Streaming Client is licensed under the Apache License, Version 2.0.

androidstreamingclient's People

Contributors

adamantivm avatar ashyonline avatar flyingpumba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.