forked from pedroSG94/RootEncoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.md
More file actions
182 lines (128 loc) · 6.04 KB
/
Copy pathREADME.md
File metadata and controls
182 lines (128 loc) · 6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# RootEncoder for Android
[](https://android-arsenal.com/details/1/5333)
[](https://jitpack.io/#pedroSG94/RootEncoder)
[](https://pedroSG94.github.io/RootEncoder)
<p align="center">
<strong>Sponsored with 💖   by</strong><br />
<a href="https://getstream.io/?utm_source=github.com/pedroSG94/rtmp-rtsp-stream-client-java&utm_medium=github&utm_campaign=oss_sponsorship" target="_blank">
<img src="assets/images/stream-logo.png" alt="Stream Chat" style="margin: 8px; width: 350px" />
</a>
<br />
Enterprise Grade APIs for Feeds & Chat. <a href="https://getstream.io/tutorials/android-chat/?utm_source=https://github.com/pedroSG94/rtmp-rtsp-stream-client-java&utm_medium=github&utm_content=developer&utm_term=java" target="_blank">Try the Android Chat tutorial</a> 💬
</p>
</br>
RootEncoder (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP and SRT with all code written in Java/Kotlin
Note: The library was renamed from rtmp-rtsp-stream-client-java to RootEncoder after add SRT protocol because the name has no sense anymore
## iOS version:
https://github.com/pedroSG94/RootEncoder-iOS
## Wiki
https://github.com/pedroSG94/RootEncoder/wiki
## Permissions:
```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
```
## Compile
To use this library in your project with gradle add this to your build.gradle:
<details open>
<summary>Last version</summary>
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.pedroSG94.RootEncoder:library:2.5.9'
//Optional, allow use CameraXSource and CameraUvcSource
implementation 'com.github.pedroSG94.RootEncoder:extra-sources:2.5.9'
}
```
</details>
<details close>
<summary>Old versions (2.2.6 or less)</summary>
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.pedroSG94.RootEncoder:rtplibrary:2.2.6'
}
```
</details>
## Features:
- [x] Android min API 16.
- [x] Extra video sources minAPI 21+ (BitmapSource, CameraXSource and CameraUvcSource)
### Encoder:
- [x] Support [camera1](https://developer.android.com/reference/android/hardware/Camera.html) and [camera2](https://developer.android.com/reference/android/hardware/camera2/package-summary.html) API
- [x] Encoder type buffer to buffer.
- [x] Encoder type surface to buffer.
- [x] Audio noise suppressor.
- [x] Audio echo cancellation.
- [x] Disable/Enable video and audio while streaming.
- [x] Switch camera while streaming.
- [x] Change video bitrate while streaming (API 19+).
- [x] AV1, H264, H265, G711, AAC and OPUS hardware/software encoding.
- [x] Force video and audio Codec to use hardware/software encoding (Not recommended).
- [X] Record MP4 file while streaming (API 18+).
- [X] Set Image, Gif or Text to stream on real time.
- [X] OpenGL real time filters. [More info](https://github.com/pedroSG94/RootEncoder/wiki/Real-time-filters)
- [x] Stream from video and audio files like mp4, webm, mp3, etc (Limited by device decoders). [More info](https://github.com/pedroSG94/RootEncoder/wiki/Stream-from-file)
- [x] Stream device screen (API 21+).
### RTMP:
- [X] Get upload bandwidth used.
- [x] RTSP auth (adobe and llnw).
- [x] AV1, H265 ([Using RTMP enhanced](https://github.com/veovera/enhanced-rtmp/tree/main)), H264, AAC and G711 support.
- [x] RTMPS (under TLS)
- [x] RTMPT and RTMPTS (tunneled and tunneled under TLS)
- [x] AMF0
- [ ] AMF3
### RTSP:
- [X] Get upload bandwidth used.
- [x] RTMP auth (basic and digest).
- [x] AV1, H264, H265, AAC, G711 and OPUS support.
- [x] TCP/UDP.
- [x] RTSPS.
### SRT (beta):
- [X] Get upload bandwidth used.
- [X] H264, H265, AAC and OPUS support.
- [X] Resend lost packets
- [X] Encrypt (AES128, AES192 and AES256)
- [ ] SRT auth.
https://haivision.github.io/srt-rfc/draft-sharabayko-srt.html
### UDP (beta):
- [X] Get upload bandwidth used.
- [X] H264, H265, AAC and OPUS support.
- [X] Unicast, Multicast and Broadcast support.
- [X] MPEG2-TS support.
## Other related projects:
https://github.com/pedroSG94/RTSP-Server
### 3rd party projects:
Projects related with the library developed by other users.
Contact with user owner if you have any problem or question.
https://github.com/FunnyDevs/rtmp-rtsp-stream-client-java-recordcontrollers
## Real time filters:
### NOTE:
In library version 2.0.9, the filters was refactored. Check the wiki link to migrate your implementation.
https://github.com/pedroSG94/RootEncoder/wiki/Real-time-filters
## Looking for sponsors
This library need sponsors to get new devices or pay platforms to test and debug errors. Any donation or sponsor is welcome!
If you are interested. You can contact me by email or donate directly on [Github](https://github.com/sponsors/pedroSG94) or [Paypal](https://www.paypal.com/paypalme/pedroSG94)
Thank you!
## Use examples:
### Rotation example
This is the recommend way to use the library.
This example support screen rotation, stream orientation (vertical, horizontal) filters and change video/audio sources on fly:
https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/rotation
### Screen example
Example to stream using Screen as video source using a service to stream in background:
https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/screen
### From file example
Code example to stream using a video file as video/audio source:
https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/file
### Old Api example
Code example for low API devices (Android API 16+):
https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/oldapi