当我使用 realod=1 的 drawtext 时,1 或 2 小时后我的 ffmpeg 停止并出现错误:
[Parsed_drawtext_7 @ 0x563aa3230f00] [FILE @ 0x7fff415ec800] Cannot read file 'myfile.txt':
Too many open files
[Parsed_drawtext_7 @ 0x563aa3230f00] The text file 'myfile.txt' could not be read or is
empty
Error while filtering: Too many open files
Failed to inject frame into filter network: Too many open files
Error while processing the decoded data for stream #5:0
我制作了一个 bash 文件,每 3 分钟更改一次文件,但我遇到了同样的问题。感谢帮助
最佳答案
来自 drawtext filter documentation :
reload
If set to1
, thetextfile
will be reloaded before each frame. Be sure to update it atomically, or it may be read partially, or even fail.
因此必须自动更新文本文件,例如使用
mv
在 Linux 或 macOS 中。
关于ffmpeg 在 1 或 2 小时后停止,错误为 : Cannot read file : Too many open files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67807369/