ffmpeg一个命令中包含多个文本(drawtext)

nis*_*ish 2 ffmpeg

如何在一幅图像上显示多行

我尝试了命令,但它给出了错误

[NULL @ 0203D780] Unable to find a suitable output format for '[in][T1]'
[in][T1]: Invalid argument
Run Code Online (Sandbox Code Playgroud)

命令:

ffmpeg -threads 8 -i D:\imagesequence\dpx\brn_055.%04d.dpx -vf "drawtext="fontsize=18:fontcolor=Green:fontfile='/Windows/Fonts/arial.ttf':text='shotcam':x=(w)/2:y=(h)-25[T1], [in][T1] "drawtext="fontsize=18:fontcolor=Green:fontfile='/Windows/Fonts/arial.ttf':text='Focal Length':x=(w)/1.2:y=(h)-25[out]" D:/imagesequence/dpx/final_with_text_mod_04.jpg
Run Code Online (Sandbox Code Playgroud)

Ben*_*Ben 5

您不需要标记每个绘图文本,只需要指定两个绘图文本都将应用到“主”源即可。[in]标记应用到主源之后发生的所有事情。如果您使用的是不同的过滤器,则只需标记标签,因为您需要指定每个过滤器发生的情况以及何时发生,然后指定与主要来源的关系。该命令应该为您工作:

ffmpeg -threads 8 -i D:\imagesequence\dpx\brn_055.%04d.dpx -vf "[in]drawtext=fontsize=18:fontcolor=Green:fontfile='/Windows/Fonts/arial.ttf':text='shotcam':x=(w)/2:y=(h)-25, drawtext=fontsize=18:fontcolor=Green:fontfile='/Windows/Fonts/arial.ttf':text='Focal Length':x=(w)/1.2:y=(h)-25[out]" D:/imagesequence/dpx/final_with_text_mod_04.jpg
Run Code Online (Sandbox Code Playgroud)

  • 谢谢。起作用了。虽然,我给了一个错误的例子。输入是一个序列,输出是单个图像。它应该是`ffmpeg -threads 8 -i D:\ imagesequence \ dpx \ brn_055。%04d.dpx -vf“ [in] drawtext = fontsize = 18:fontcolor = Green:fontfile ='/ Windows / Fonts / arial.ttf ':text ='shotcam':x =(w)/ 2:y =(h)-25,drawtext = fontsize = 18:fontcolor = Green:fontfile ='/ Windows / Fonts / arial.ttf':text ='焦距':x =(w)/1.2:y=(h)-25 [out]“ -y -r 30 -vcodec png -pix_fmt rgb32 D:\ imagesequence \ dpx \ test.mov` (2认同)