The ZLMediaKit project link
ubuntu18.04
system environment is used to ZLMediaKit
build RTSP
the server.
- Pull the project code first
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit.git
Enter ZLMediaKit
the directory, and you can get a glimpse of the door by viewing the project directory
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 .gitmodules
the file , very useful in repositories dealing with dependencies
ZLMediaKit
Third-party modules used:
- 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
The process of installing dependent libraries will be quite long. It is recommended to play a king first and then come back~~
3. Then build and compile, go back to ZLMediaKit
the directory first, create a build
directory, enter this directory to executecmake ..
mkdir build
cd build/
cmake ..
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
will be generated in the build directory. After the file is generated , the command can be executed to modify the project. compiledMakefile
Makefile
make
- 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/
MediaServer
is an executable file
To test the effect, the server starts first
sudo ./MediaServer -d &
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