Rtsp client android
Lightweight RTSP client library for Android.
Features
- Android min API 21.
- RTSP/RTSPS over TCP.
- Video H.264 only.
- Audio AAC LC only.
- Basic/Digest authentication.
- Supports majority of RTSP IP cameras.
Permissions
<uses-permission android:name="android.permission.INTERNET" />
Installation
To use this library in your project add this to your build.gradle:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.am3n:rtsp-client-android:NEWEST-VERSION'
}
Usage
- Easiest way is just to use
SurfaceView
class for showing video stream in UI.
<SurfaceView
android:id="@+id/svVideo"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Then in code use:
val url = "rtsps://10.0.1.3/test.sdp"
val username = "admin"
val password = "secret"
val rtsp = Rtsp()
rtsp.init(uri, username, password)
rtsp.setSurfaceView(binding.svVideo)
rtsp.start()
// ...
rtsp.stop()
- Credits