ffmpeg 将直播流 转化为 mp4保存


# 将流转换为 mp4, 这里的流可以是 rtp, 也可以是 rtmp
ffmpeg -y -i rtsp://192.168.100.30:554/live/test -vcodec copy -t 500  -f mp4 ttt.mp4   
# 将流转换为 mp4, 并按照2分钟就分割成多个文件 -r 设定帧速率, 一分钟分割, -segment_time 120, 两分钟 120s
ffmpeg -i rtsp://192.168.100.30:554/live/test -r 1/60 -c copy -map 0 -f segment -segment_time 120 -segment_format mp4 ".\\test\\out%03d.mp4"
# 将流转换为 mp4, 分割短视频并生成对应的缩略图 
ffmpeg -i rtsp://192.168.100.30:554/live/test -r 1/60 -f image2 ".\\test\\images%05d.png" -c copy -map 0 -f segment -segment_time 60 -segment_format mp4 ".\\test\\out%03d.mp4"