最近在 FFMPEG 内部工作时,我一直在尝试运行一个脚本,该脚本根据当前艺术家的文本文件显示当前艺术家。加载每一帧,但是文件也被写入,因此当被写入流时会崩溃..
The text file 'artist.txt' could not be read or is empty
Error while filtering
Failed to inject frame into filter network: Invalid argument
我用来将artist.txt写入内容的行如下..
-vf "drawtext=enable='gte(t,3)':fontfile=fonts/Dosis-Bold.ttf:textfile=artist.txt:reload=1:y=h-line_h-10:x=(W/tw)*n"
最佳答案
drawtext documentation对于 reload
状态:
Be sure to update the file atomically, or it may be read partially, or even fail.
例如在 Linux 中,每次更新源文件后使用
mv
覆盖artist.txt
.
关于使用drawtext过滤器重新加载时,ffmpeg崩溃,因为文件正在使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43908936/