About this project
# RootEncoder for Android
RootEncoder (formerly rtmp-rtsp-stream-client-java) is a comprehensive stream encoder library for Android, enabling developers to push video and audio to media servers using multiple protocols: RTMP, RTSP, SRT, UDP, and WHIP (beta). All code is written in Java/Kotlin, making it a native solution for Android streaming applications.
## Key Features
- **Protocols**: Supports RTMP (including RTMPS, RTMPT, RTMPTS), RTSP (TCP/UDP, RTSPS), SRT (with encryption and packet resend), UDP (unicast, multicast, broadcast, MPEG2-TS), and WHIP (beta with bearer token auth).
- **Codecs**: Hardware/software encoding for AV1, H264, H265, VP8, VP9, G711, AAC, HE-AAC, and OPUS.
- **Video Sources**: Camera1 and Camera2 APIs, screen capture (API 21+), and file streaming (mp4, webm, mp3, etc.).
- **Real-time Processing**: OpenGL filters, image/GIF/text overlays, and audio noise suppression/echo cancellation.
- **Dynamic Control**: Enable/disable video/audio during streaming, switch cameras, change bitrate on the fly (API 19+), and record MP4 while streaming (API 18+).
- **Compatibility**: Minimum Android API 16; extra video sources require API 21+.
## Installation
Add JitPack repository and dependency in your build.gradle:
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation "com.github.pedroSG94.RootEncoder:library:2.8.1"
// Optional for CameraXSource and CameraUvcSource
implementation "com.github.pedroSG94.RootEncoder:extra-sources:2.8.1"
}
```
For older versions (≤2.2.6), use `rtplibrary` instead.
## Permissions
Add to AndroidManifest.xml:
```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
```
## Usage Examples
- **Rotation**: Recommended way supporting screen rotation, orientation, filters, and dynamic source changes.
- **Screen Streaming**: Stream device screen via a background service.
- **File Streaming**: Use video files as sources.
- **Old API**: For low-API devices (16+).
All examples are in the `app/src/main/java/com/pedro/streamer/` directory.
## Documentation & Support
- [Wiki](https://github.com/pedroSG94/RootEncoder/wiki) for detailed guides, including real-time filters.
- [Documentation](https://pedroSG94.github.io/RootEncoder) for API reference.
- iOS version available at [RootEncoder-iOS](https://github.com/pedroSG94/RootEncoder-iOS).
## Sponsorship
The library is sponsored by Stream (chat/feeds APIs) and Recall.ai (mobile recording SDK). Donations are welcome via GitHub Sponsors or PayPal to support testing and development.
## Related Projects
- [RTSP-Server](https://github.com/pedroSG94/RTSP-Server) for server-side implementation.
- Third-party extensions like [recordcontrollers](https://github.com/FunnyDevs/rtmp-rtsp-stream-client-java-recordcontrollers).
RootEncoder is ideal for developers building live streaming, video conferencing, or broadcasting apps on Android, offering robust protocol support and flexible encoding options.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.