Skip to content

RTSP to RTSP stream demo. using ffmpeg-mpp, mediaMTX. pull->decode->encode->push

Notifications You must be signed in to change notification settings

wuha-xt/mpp_RTSP_stream_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

RTSP Stream demo

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.

Features

  • 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.

Prerequisites

  • FFmpeg with rkmpp support ffmpeg-rockchip

    NOTE: 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.

Building the Project

  1. Clone the repository:

    git clone https://github.com/yourusername/rtsp-stream-processor.git
    cd rtsp-stream-processor
  2. Create a build directory:

    mkdir build
    cd build
  3. Run CMake:

    cmake ..
  4. Compile the project:

    make

Usage

  1. Download and run mediamtx rtsp server in localhost.

  2. 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"
  1. build code.
  2. Run the compiled executable with the desired RTSP input and output URLs:
./RTSPStreamProcessor
  1. using vlc to pull RTSP url.

Code Overview

  • main.cpp: Contains the main logic for decoding and encoding the RTSP stream.
  • CMakeLists.txt: CMake configuration file for building the project.

Troubleshooting

  • firewall in 8554 port

Reference

About

RTSP to RTSP stream demo. using ffmpeg-mpp, mediaMTX. pull->decode->encode->push

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published