StreamPack: live streaming SDK for Android based on Secure Reliable Transport

Related tags

SDK StreamPack
Overview

StreamPack: live streaming SDK for Android based on Secure Reliable Transport (SRT)

StreamPack brings the best audio/video live technologies together in order to achieve low-latency & high quality live streaming for Android.

Setup

Get StreamPack latest artifacts on jitpack.io

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.ThibaultBee:StreamPack:1.1.0'
}

Sample

For source code example, check the sample app directory. On first launch, you will have to set SRT server IP in the settings menu.

Quick start with a FFmpeg SRT server

FFmpeg has been used as an SRT server+demuxer+decoder for the tests. Check how to build FFmpeg with libsrt in SRT CookBook. Tells FFplay to listen on IP 0.0.0.0 and port 9998:

ffplay -fflags nobuffer srt://0.0.0.0:9998?mode=listener

On StreamPack sample app settings, set the server IP to your server IP and server port to 9998. At this point, StreamPack sample app should successfully sends audio and video frames. On FFplay side, you should be able to watch this stream.

API

Captures your camera and microphone frames. Streams them to a SRT server. It is that simple:

// Prepare A/V configurations
val audioConfig = AudioConfig.Builder()
                      .setStartBitrate(128000)
                      .setSampleRate(48000)
                      .setNumberOfChannel(2)
                      .build()

val videoConfig = VideoConfig.Builder()
                    .setStartBitrate(1000000) // 1 Mb/s
                    .setResolution(Size(1280,720))
                    .setFps(30)
                    .build()

val streamer = CameraSrtLiveStreamer.Builder()
                .setContext(getApplication())
                .setServiceInfo(tsServiceInfo)
                .setConfiguration(audioConfig, videoConfig)
                .build()
...
// where to display preview
streamer.startPreview(surface)
...
// Connect to a SRT server
streamer.connect(ip, port)
...
streamer.startStream()
...
// Stops and cleans stream
streamer.stopStream()
...
streamer.disconnect()
...
streamer.stopPreview()
...
streamer.release()

For more detailed explanation, check out the API documentation.

Permissions

You need to add the following permissions in your AndroidManifest.xml:

">
    
  
    
  
    
  

    
  

Your application also has to request the following dangerous permission: android.permission.RECORD_AUDIO, android.permission.CAMERA and android.permission.WRITE_EXTERNAL_STORAGE (only for CaptureFileStream).

For the PlayStore, your application might declare in its AndroidManifest.xml

">

  

  

Android SDK version

Even if StreamPack sdk supports a minSdkVersion 21. I strongly recommend to set the minSdkVersion of your application to a higher version (the highest is the best!).

Licence

Copyright 2021 Thibault B.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Android Chat SDK built on Firebase
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

新浪微博 Android SDK

ReadMe 公告: 鉴于线上服务器出现问题,推荐下载本地aar后上传到自己公司的服务器,保证后续服务稳定, 我们也将尽快重新提供一个稳定的地址供大家使用。 新包地址:https://github.com/sinaweibosdk/weibo_android_sdk/tree/master/2019

Official Appwrite Android SDK 💚  🤖
Official Appwrite Android SDK 💚 🤖

Appwrite Android SDK This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check previous releases. Appwrite is an ope

This App is sending Face capture data over network, built around the latest Android Arcore SDK.
This App is sending Face capture data over network, built around the latest Android Arcore SDK.

AndroidArcoreFacesStreaming From any Android phone ArCore compatible, using this app will send over TCP 5680 bytes messages: The first 5616 bytes is a

Trackingplan for Android SDK
Trackingplan for Android SDK

With Trackingplan for Android you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Desk360 Mobile Chat SDK for Android

Desk360 Chat Android SDK Introduction Desk360 Live Chat SDK is an open source Android library that provides live support to your customers directly fr

Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included 🚀 • About

Owner
guo shao hong
guo shao hong
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
HubSpot Kotlin SDK 🧺 Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
Peer Support is a community-based peer to peer mental health therapy platform built using Webex Android SDK

Peer Support Peer Support is a community-based peer to peer mental health therapy platform built using Webex Android SDK. Table of Contents Video Demo

Webex Solution Developers 1 Sep 6, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Countly Team 648 Dec 23, 2022
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Applozic 659 May 14, 2022
Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Evernote 424 Dec 9, 2022
Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Freshplanet 219 Nov 25, 2022