[ubuntu][技术杂谈]ffmpeg将视频转成rtsp报错Could not write header for output file #0

Posted FL1623863129

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[ubuntu][技术杂谈]ffmpeg将视频转成rtsp报错Could not write header for output file #0相关的知识,希望对你有一定的参考价值。

我使用命令:

ffmpeg -re -stream_loop -1 -i person1080.mp4 -c copy -f rtsp rtsp://localhost:80/test

结果总是报错:

Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input

查了好多资料都没解决开始我以为是依赖有问题或者ffmpeg没安装好,但是卸载后情况依然存在,正在绝望之际看到说不需要写端口,于是我改成

ffmpeg -re -stream_loop -1 -i person1080.mp4 -c copy -f rtsp rtsp://localhost/test

结果可以正常运行了,这个错误太难发现了。特此记录,希望遇到类似情况的可以顺利解决。

以上是关于[ubuntu][技术杂谈]ffmpeg将视频转成rtsp报错Could not write header for output file #0的主要内容,如果未能解决你的问题,请参考以下文章