一、RTSP转RTMP
海康摄像头:抓取 rtsp 流然后转换成 rtmp 推流出去
主码流
ffmpeg -i “rtsp://[用户名]:[密码]@192.168.1.100/h265/ch1/main/av_stream” -f flv -r 25 -s 1920x1080 -an rtmp://localhost/live/a
ffmpeg -i “rtsp://[用户名]:[密码]@192.168.1.100:554/h265/ch1/main/av_stream” -f flv -r 25 -s 1920x1080 -an rtmp://localhost:1935/live/a
子码流
ffmpeg -i “rtsp://[用户名]:[密码]@192.168.1.100/h265/ch1/sub/av_stream” -f flv -r 25 -s 640x360 -an rtmp://localhost/live/a
ffmpeg -i “rtsp://[用户名]:[密码]@192.168.1.100:554/h265/ch1/sub/av_stream” -f flv -r 25 -s 640x360 -an rtmp://localhost:1935/live/a
二、码率bit_rate设置建议大小
视频大小 | 分辨率 | 建议码率 |
---|---|---|
480P | 720X480 | 1800Kbps |
720P | 1280X720 | 3500Kbps |
1080P | 1920X1080 | 8500Kbps |