一、推送本地视频到流媒体服务器

https://github.com/ZLMediaKit/ZLMediaKiticon-default.png?t=M276https://github.com/ZLMediaKit/ZLMediaKit        这里使用了ZLMediaKit,编译运行请参考项目WiKi.

        推流命令:

ffmpeg -re -i "D:\test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://192.168.0.110/live/test

二、使用命令行每隔一段时间分文件保存rtsp流

ffmpeg -rtsp_transport tcp -i rtsp://192.168.0.110/live/test -c copy -f segment -segment_time 60 stream_piece_%d.mp4

        注意:-segment_time 60里的60为60s,即每隔60秒分文件保存一次视频流,但稍有误差,效果如下:

 

更多推荐