This project is an RTSP stream processor that decodes and re-encodes video streams using FFmpeg and OpenCV. It is designed to handle video streams from RTSP sources, such as IP cameras, and output them to another RTSP endpoint. Tested in RK3588 debian11.
- Decode video streams using the
h264_rkmpp
decoder. - Encode video streams using the
h264_rkmpp
encoder. - Supports custom RTSP input and output URLs.
- Configurable bitrate and buffer size.
- FFmpeg with
rkmpp
support ffmpeg-rockchipNOTE: To Compilation and install libs like
avcoder.so
,please adding--enable-shared
in ffmepg configure command./configure
, like./configure --prefix=/usr --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-rkrga --enable-shared --enable-ffplay
- OpenCV
- CMake (version 3.10 or higher)
- PkgConfig
Ensure that FFmpeg is compiled with rkmpp
support and that all necessary libraries are installed on your system.
-
Clone the repository:
git clone https://github.com/yourusername/rtsp-stream-processor.git cd rtsp-stream-processor
-
Create a build directory:
mkdir build cd build
-
Run CMake:
cmake ..
-
Compile the project:
make
-
Download and run mediamtx rtsp server in localhost.
-
Edit the
main.cpp
file to set your specific RTSP input and output URLs:
const std::string input_rtsp_url = "rtsp://your_input_url";
const std::string output_rtsp_url = "rtsp://your_output_url";// mediamtx RTSP server "rtsp://127.0.0.1:8554/test"
- build code.
- Run the compiled executable with the desired RTSP input and output URLs:
./RTSPStreamProcessor
- using vlc to pull RTSP url.
- main.cpp: Contains the main logic for decoding and encoding the RTSP stream.
- CMakeLists.txt: CMake configuration file for building the project.
- firewall in 8554 port