1.简单录制脚本
#!/bin/bash STREAM_URL="rtsp://172.22.22.216:8080/h264_opus.sdp" OUTPUT_DIR="/media/recordings" mkdir -p "$OUTPUT_DIR" cd "$OUTPUT_DIR" || exit while true; do # 关键修改:使用中文日期时间格式 FILENAME="dfdf_$(date +%Y年%m月%d日%H时%M分%S秒).mp4" ffmpeg -rtsp_transport tcp -i "$STREAM_URL" -c:v copy -c:a aac -strict -2 -t 3600 "$FILENAME" sleep 2 done
2.go2rtc,全能流媒体转换神器,统一管理所有摄像头协议
go2rtc项目地址:https://github.com/AlexxIT/go2rtc
参考教程:https://webrtc.link/zh/articles/go2rtc-ultimate-streaming-solution/
3.安装.Net6运行环境
apt install .Net6