一体机推流方案
建议使用ZlmediaKit:
参考: 快速开始 · ZLMediaKit/ZLMediaKit Wiki · GitHub
关闭ssl验证
git config --global http.sslVerify false
其中遇见CMAKE安装,
参考如下:
Centos安装最新版本cmake-腾讯云开发者社区-腾讯云
docker方式:
Docker 简单部署 ZLMediaKit 超详细图文步骤_zlmediakit docker部署-CSDN博客
docker run -d -v /home/winkas/appendix/input:/input -p 1937:1935 -p 1080:80 -p 8554:554 \
-p 9007:10000 -p 9007:10000/udp -p 8004:8000/udp \
--name zlmkt \
-v /home/docker/zlmediakit/media/bin:/opt/media/bin \
-v /home/docker/zlmediakit/media/conf:/opt/media/conf \
zlmediakit/zlmediakit:master
docker exec -it zlmkt /bin/bash
ffmpeg -re -i "/home/sycv/workspace/dev/winkas/appendix/input/test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
可使用网络串流
rtsp://10.201.13.58:554/live/test
ps -ef | grep ffmpeg | grep -v grep | cut -c 9-15 | xargs kill -9
cd /home/sycv/workspace/projects/ZLMediaKit/release/linux/Debug
nohup ./MediaServer -d &
ulimit -n 102400
nohup ffmpeg -stream_loop -1 -re -i "/home/sycv/workspace/dev/winkas/appendix/input/test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test &
rtsp://10.201.14.3/live/test
nohup ./Debug/test_bench_push -i rtsp://127.0.0.1/live/test -c 200 -o rtsp://10.201.14.3/live/push &
流地址:
/home/sycv/workspace/projects/ZLMediaKit/release/linux/Debug/www/live
卸载旧版本:
sudo apt-get --purge remove ffmpeg
sudo apt-get --purge autoremove
ffmpeg -stream_loop -1 -re -i "test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
ffmpeg -re -i test.mp4 -vcodec copy -acodec copy -f rtsp rtsp://127.0.0.1:8554/live.sdp
ffmpeg -re -i 222.mp4 -vcodec h264 -acodec aac -strict -2 -f rtsp -rtsp_transport tcp rtsp://192.168.0.139/live/test1
url="https://github.com/aler9/rtsp-simple-server/releases/download/v0.18.2/rtsp-simple-server_v0.18.2_linux_amd64.tar.gz"
curl -L $url -O
tar -xzf rtsp-simple-server_v0.18.2_linux_amd64.tar.gz
./rtsp-simple-server
ffmpeg -re -i test.mp4 -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live
ffmpeg -stream_loop -1 -re -i "test.mp4" -vcodec h264 -acodec copy -f rtsp -rtsp_transport tcp rtsp://10.201.14.6:8554/live/test
Ubuntu出现Failed to Fetch的解决办法
(11条消息) Ubuntu出现Failed to Fetch的解决办法_可可嘉德珠的博客-CSDN博客_: failed to fetch
d7eb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
ffmpeg -stream_loop -1 -re -i "/home/sycv/workspace/dev/deploy/appendix/input/test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://10.201.14.11:8554/live/test
云能单张图片推流
人群聚集:
ffmpeg -r 25 -loop 1 -i "/home/sycv/yunneng/TPCrowd.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 2500 -r 25 -t 200 /home/sycv/yunneng/TPCrowd.avi
单张图片推流:
ffmpeg -r 25 -loop 1 -i "/home/sycv/workspace/dev/winkas/appendix/input/test5.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 25000 -r 25 -t 200 ~/a.mp4
单张图片明火检测视频:
ffmpeg -r 25 -loop 1 -i "/home/sda/cyl/Zhongke/test_img/1/2F37_D_O_S.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 25000 -r 25 -t 200 ~/fire.avi
单张图片安全带流:
ffmpeg -r 25 -loop 1 -i "/home/sycv/belt.png" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 25000 -r 25 -t 200 ~/belt.avi
单张图片吸烟视频:
ffmpeg -r 25 -loop 1 -i "/home/sycv/cyl/data/orig/20230705_test/192.168.8.142_01_20230131131346711_1000.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 25000 -r 25 -t 200 ~/smoking.avi
ffmpeg -stream_loop -1 -re -i "/home/sycv/a.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://10.201.14.3:8554/live/test
ffmpeg -r 25 -loop 1 -i "/home/sycv/yunneng/TPfanqiang.png" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 500 -r 25 -t 200 ./TPfanqiang.avi
2023.2.24更新:
服务容器启动指令:
sudo docker run -id -p 1935:1935 -p 1080:80 -p 8554:554 -p 10000:10000 -p 10000:10000/udp --name zlmkt --restart=always panjjo/zlmediakit
推流:
ffmpeg -stream_loop -1 -re -i "/home/sycv/workspace/dev/winkas/appendix/input/test.mp4" -vcodec h264 -acodec aac -f rtsp rtsp://127.0.0.1:8554/live/test
h265推流:
ffmpeg -stream_loop -1 -re -i "/home/sycv/workspace/dev/winkas/appendix/input/test.mp4" -vcodec libx265 -acodec aac -f rtsp rtsp://127.0.0.1:8554/live/test
RTMP:
ffmpeg -stream_loop -1 -re -i "/home/sycv/workspace/dev/winkas/appendix/input/test.mp4" -vcodec h264 -acodec aac -f flv rtmp://127.0.0.1:8554/live/test
明火视频流:
ffmpeg -r 25 -loop 1 -i "/home/sycv/workspace/dev/winkas/appendix/input/96.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1920x1080 -vframes 25000 -r 25 -t 1000 ~/fire.mp4
ffmpeg -stream_loop -1 -re -i "/home/sycv/fire.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://10.201.14.3:8554/live/test
反光衣视频流:
ffmpeg -r 25 -loop 1 -i "/home/sycv/workspace/dev/winkas/appendix/input/rf.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1280x720 -vframes 5000 -t 200 ~/rf.mp4
ffmpeg -stream_loop -1 -re -i "/home/sycv/rf.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://10.201.14.3:8554/live/test
车牌视频流:
ffmpeg -r 25 -loop 1 -i "/home/sycv/workspace/dev/winkas/appendix/input/6.jpg" -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1280x720 -vframes 5000 -t 200 ~/pldt.mp4
ffmpeg -stream_loop -1 -re -i "/home/sycv/pldt.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://10.201.14.3:8554/live/test1
OBS推流服务:
多张图片一体机推流:
ffmpeg -framerate 0.06 -y -pattern_type glob -i '/home/sycv/workspace/projects/TransferFrameIntoVideo/一般违规/*.jpg' -r 30 -s 1280x720 -c:v libx264 -pix_fmt yuv420p -r 25 -t 500 /home/sycv/workspace/projects/TransferFrameIntoVideo/output.mp4
参考:
使用ffmpeg命令把单张或多张图片生成固定时长的视频 - DoubleLi - 博客园