• Stars
    star
    633
  • Rank 71,037 (Top 2 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

It is probably the smallest(~60KB, fat version ~300KB) rtmp client for android. It calls librtmp functions over JNI interface

Librtmp Client for Android

It is probably the smallest(~60KB) rtmp client for android. It calls librtmp functions over JNI interface. With all cpu architectures(arm, arm7, arm8, x86, x86-64, mips) its size is getting about 300KB

It compiles librtmp library without ssl.

In version 0.2, it supports FLV muxing and sending stream via RTMP. FLV muxing is based on this repo https://github.com/rainfly123/flvmuxer

To read streams, you can call below functions of RtmpClient from Java

For live streams add " live=1" at the end of the url when calling the open function

  • public native int open(String url, boolean isPublishMode);
  • public native int read(byte[] data, int offset, int size);
  • public native int write(byte[] data);
  • public native int seek(int seekTime);
  • public native int pause(int pause);
  • public native int close();
  • public native int isConnected();: Call this function to query the connection status. Returns 1 if connected, returns 0 if not connected

Don't forget calling the close function after you are done. If you don't, there will be memory leakage

To publish streams, you can call below functions of RtmpMuxer from Java
  • public native int open(String url, int width, int height); : First, call this function with the url you plan to publish. Width and height are the width and height of the video. These two parameters are not mandatory. They are optional. They put width and height values into the metadata tag.
  • public native int writeVideo(byte[] data, int offset, int length, int timestamp);: Write h264 nal units with this function
  • public native int writeAudio(byte[] data, int offset, int length, int timestamp);: Write aac frames with this function
  • public native int close();: Call this function to close the publishing.
  • public native int isConnected();: Call this function to query the connection status. Returns 1 if connected, returns 0 if not connected

To save flv file locally as well, you can use below functions

  • public native void file_open(String filename); : call this function with full file path
  • public native void write_flv_header(boolean is_have_audio, boolean is_have_video);: After opening file call this function
  • public native void file_close();: Call this function to close the file.

if any local file is opened, library will write the audio and video frames to local file as well.

Install

  • Add dependency to your build gradle
dependencies {
    ...
    compile 'net.butterflytv.utils:rtmp-client:3.1.0'
    ...
}
  • That's all. You can use RtmpClient class

Ant Media

More Repositories

1

Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
Java
4,275
star
2

LiveVideoBroadcaster

Native RTMP client for publishing and playing video streams for Android
Java
471
star
3

StreamApp

Streaming application for Ant Media Server
JavaScript
62
star
4

videojs-webrtc-plugin

Webrtc plug-in for videojs
JavaScript
52
star
5

WebRTC-Flutter-SDK

Ant Media Server WebRTC Flutter SDK
Dart
39
star
6

WebRTC-React-Native-SDK

Ant Media Server WebRTC React Native SDK and Reference Project
TypeScript
26
star
7

Scripts

Auxiliary Shell Scripts
Shell
17
star
8

WebRTC-Android-SDK

Ant Media Server WebRTC Android SDK and Reference Project
Java
13
star
9

conference-call-application

Conference Call Application over Ant Media Server
JavaScript
11
star
10

spaceport-web-player

JavaScript
10
star
11

ConferenceApp

Conference Application For Ant Media Server
JavaScript
9
star
12

Ant-Media-Management-Console

Ant Media Management Console written in Angular to create, publish and play streams
HTML
8
star
13

iOSRTMPReferenceApp

Swift
8
star
14

WebRTC-iOS-SDK

Ant Media Server iOS WebRTC SDK
Objective-C
7
star
15

Plugins

Plugins for Ant Media Server
JavaScript
7
star
16

sora-unity-sdk

C++
4
star
17

sora-unity-sdk-samples

Sora Unity SDK Sample project for Ant Media Server
C#
3
star
18

utilities

Shell
2
star
19

WebRTCEmbeddedSDKReference

Reference project to show how Embedded SDK is used
C++
2
star
20

helm

Shell
2
star
21

ant-media-documentation

Documentation for Ant Media Server.
JavaScript
2
star
22

TunaDesk

TunaDesk is a Remote Desktop Control application running in Ant Media Server
JavaScript
2
star
23

SamplePlugin

This is a sample plugin project for Ant Media Server
Java
1
star
24

WebRTC-Unity-SDK

WebRTC Unity SDK for Ant Media Server
C#
1
star