A minimal example of an RTSP player for Android, developed with Qt and libVLC to provide low-latency video streaming (0.5 - 1 second without buffer accumulation).
- Real-time RTSP stream playback with minimal latency
- Optimized for low-latency transmission
- Built on Qt 6.x and libVLC
- Full Android ARM64 support
- Clean and educational codebase
- Qt 6.x (minimum 6.6)
- CMake 3.16+
- Android SDK
- Android NDK
- libVLC for Android
The project requires specific libVLC components that must be placed in the correct Android directories.
git clone https://github.com/JulSCode/RTSPStream.git
cd RTSPSreamDownload the required libVLC files from Maven Repository and place them in the following directory structure:
RTSPStream/
├── android/
│ ├── libs/
│ │ └── libvlc-all-4.0.0-eap23.aar ← Download from Maven
│ ├── jniLibs/
│ │ └── arm64-v8a/
│ │ ├── libc++_shared.so ← Download from Maven
│ │ ├── libvlc.so ← Download from Maven
│ │ └── libvlcjni.so ← Download from Maven
│ ├── src/
│ │ └── org/qtproject/example/
│ │ ├── SystemUIHelper.java
│ │ └── ... (other Java files)
│ └── AndroidManifest.xml
├── include/
│ ├── androidhelper.h
│ └── vlcbridge.h
├── src/
│ ├── main.cpp
│ ├── androidhelper.cpp
│ └── ... (other C++ files)
├── res/
│ ├── icons/
│ │ ├── icon1.png
│ │ ├── icon2.png
│ │ ├── pause.png
│ │ ├── play.png
│ │ └── stop.png
│ └── resources.qrc
├── CMakeLists.txt
└── README.md
The file libvlc-all-4.0.0-eap23.aar is a compressed archive (ZIP format). To extract the native libraries:
-
Unpack the AAR file:
# On Windows (PowerShell) Expand-Archive android/libs/libvlc-all-4.0.0-eap23.aar -DestinationPath libvlc_temp # On Linux/macOS unzip android/libs/libvlc-all-4.0.0-eap23.aar -d libvlc_temp
-
Copy the required files:
# On Windows (PowerShell) Copy-Item libvlc_temp/jni/arm64-v8a/libc++_shared.so android/jniLibs/arm64-v8a/ Copy-Item libvlc_temp/jni/arm64-v8a/libvlc.so android/jniLibs/arm64-v8a/ Copy-Item libvlc_temp/jni/arm64-v8a/libvlcjni.so android/jniLibs/arm64-v8a/ # On Linux/macOS cp libvlc_temp/jni/arm64-v8a/*.so android/jniLibs/arm64-v8a/
-
Clean up the temporary directory:
rm -r libvlc_temp
mkdir build
cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=<path_to_NDK>/build/cmake/android.cmake \
-DANDROID_PLATFORM=android-28 \
-DANDROID_ABI=arm64-v8a ..
cmake --build .Or use Qt Creator:
- Open
CMakeLists.txtin Qt Creator - Select the Android profile
- Choose the ARM64 configuration
- Click "Build"
After successful build, install the application on an Android device:
# If built with CMake
cmake --install . --config Release
# Or using adb
adb install app.apkRun the application and enter the RTSP stream URL for playback.
src/- C++ source codeinclude/- Header filesandroid/- Android-specific files and resourcesres/- Application resources (icons, QML files)CMakeLists.txt- Build configuration
To achieve minimum latency (0.5 - 1 second):
- Uses libVLC 4.0.0 EAP23 with streaming optimizations
- ARM64 devices are recommended for better performance
- Ensure stable network connectivity
- Depending on the RTSP source, additional buffer configuration may be required
MIT License
JulSCode
Pull requests and issues are welcome. For major changes, please open an issue first to discuss the proposed changes.