admin管理员组文章数量:1221319
I use ffmpeg to save rtsp stream from my wi-fi camera. It works fine but when connection dies, I don't get any notice or it doesn't reconnect automatically. Here's my command:
screen -S garage ffmpeg -hide_banner -y -loglevel error -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i rtsp://user:[email protected]:XXX/stream1 -vcodec copy -acodec copy -f segment -reset_timestamps 1 -segment_time 14400 -segment_format mkv -segment_atclocktime 1 -strftime 1 garage%Y%m%dT%H%M%S.mkv
I found this code from this site (if I remember correctly), tinkered a little (added screen -S) and got it working fine. Now I check my stream every morning by looking saved files and are they in realtime. If yes, then I know that stream is working. Needless to say that this is quite cumbersome technique.
So what I need is that the stream reconnects if it fails to connect. This would be best. Second best option would be that it kills screen. Now it just seems do its job even if its not recording anything. I think the connection breaks from time to time because wi-fi is what it is. For that I can't do anything.
本文标签: How to set ffmpeg reconnect or quit when rtsp stream connection breaksStack Overflow
版权声明:本文标题:How to set ffmpeg reconnect or quit when rtsp stream connection breaks - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739274247a2155950.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论