admin管理员组文章数量:1365889
I want to loop push a part of video, such as the start 5 senonds, by cmd:
ffmpeg -re -stream_loop -1 -ss 0 -t 5 -i xxx.mp4 -c copy -f flv rtmp://xxx
Run the command, after 5 senonds error raise:
[flv @ 000001c7b4a0f040] Failed to update header with correct duration.4.7kbits/s speed= 1x
[flv @ 000001c7b4a0f040] Failed to update header with correct filesize.
It works fine if first using ffmpeg cut the video then pushing with out -t
. Is there a way to do this together? Because the input file may be a file or a network stream.
I want to loop push a part of video, such as the start 5 senonds, by cmd:
ffmpeg -re -stream_loop -1 -ss 0 -t 5 -i xxx.mp4 -c copy -f flv rtmp://xxx
Run the command, after 5 senonds error raise:
[flv @ 000001c7b4a0f040] Failed to update header with correct duration.4.7kbits/s speed= 1x
[flv @ 000001c7b4a0f040] Failed to update header with correct filesize.
It works fine if first using ffmpeg cut the video then pushing with out -t
. Is there a way to do this together? Because the input file may be a file or a network stream.
1 Answer
Reset to default -1Try this:
ffmpeg -i xxx.mp4 -t 5 -c copy first5s.mp4
ffmpeg -re -stream_loop -1 -i first5s.mp4 -c copy -f flv rtmp://xxx
The "-t" has been applied to the input and is causing problems with FLV streaming. The FLV format expects a known duration and looping a segment on the fly might not work correctly.
本文标签: ffmpeg loop push rtmp error with when using arg tStack Overflow
版权声明:本文标题:ffmpeg loop push rtmp error with when using arg -t - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743802145a2541515.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论