使用drawtext过滤器重新加载时,ffmpeg在文件使用中崩溃 [英] ffmpeg crashes as file is in use when using drawtext filter reload
问题描述
最近在FFMPEG ive中工作时,一直试图运行一个脚本,该脚本根据文本文件显示当前艺术家的身份来显示当前艺术家.加载每一帧,但是文件也被写入,因此在写入流时崩溃..
Recently whilst working inside of FFMPEG ive been trying to run a script which shows the current artist based on what a textfile says the current artist is. Loading this every frame, however the file is also being written to and thus when being written to the stream crashes with..
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写入内容的行如下.
The line im using to write the artist.txt into the content is as follows..
-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文档用于 reload
状态:
请确保以原子方式更新文件,否则可能会部分读取文件,甚至失败.
Be sure to update the file atomically, or it may be read partially, or even fail.
例如,在Linux中,每次对源文件进行更新后,使用 mv
覆盖 artist.txt
.
For example in Linux, after each update to the source file use mv
to overwrite artist.txt
.
这篇关于使用drawtext过滤器重新加载时,ffmpeg在文件使用中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!