Build RTSP server [entry level]

The ZLMediaKit project link
ubuntu18.04 system environment is used to ZLMediaKitbuild RTSPthe server.

  1. Pull the project code first
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit.git

insert image description here
Enter ZLMediaKitthe directory, and you can get a glimpse of the door by viewing the project directory
insert image description here
Enter the directory and execute the following command

git submodule update --init

This command will clone the submodule repository and check out the appropriate commit or branch specified in .gitmodulesthe file , very useful in repositories dealing with dependencies
insert image description here

insert image description here

ZLMediaKitThird-party modules used:insert image description here

  1. The next step is to install the compiler, cmake, and dependent library information, and execute the following commands in sequence
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libssl-dev libsdl-dev libavcodec-dev libavutil-dev ffmpeg -y

insert image description here
insert image description here
The process of installing dependent libraries will be quite long. It is recommended to play a king first and then come back~~
insert image description here
3. Then build and compile, go back to ZLMediaKitthe directory first, create a builddirectory, enter this directory to executecmake ..

mkdir build
cd build/
cmake ..

insert image description here
The above execution cmake ..means to find the file in the upper level directory CMakeLists.txt, and use the file to configure and build the project. After execution , the files required by other build tools
insert image description here
will be generated in the build directory. After the file is generated , the command can be executed to modify the project. compiledMakefile
insert image description here
Makefilemake
insert image description here

  1. The last thing is to get the executable file and run it directly. The directory of the executable file is below
cd release/linux/Debug/

insert image description here
MediaServeris an executable file
insert image description here

To test the effect, the server starts first

sudo ./MediaServer -d &

insert image description here
The local push command, the local needs to be installed firstffmpeg

.\ffmpeg.exe -re -i "test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://192.168.203.131/live/test

insert image description here

Guess you like

Origin blog.csdn.net/Stephen8848/article/details/129539672