How to drawtext colon with localtime in ffmpeg -filter_complex?

回眸只為那壹抹淺笑 提交于 2021-01-29 09:26:54

问题


ffmpeg -i in.mp4 -filter_complex "drawtext='fontfile=font.ttf : text=%{localtime\:%Y/%m/%d %H%M%S} : fontsize=24 : fontcolor=white : x=10: y=10'" out.mp4

works.

ffmpeg -i in.mp4 -filter_complex "drawtext='fontfile=font.ttf : text=%{localtime\:%Y/%m/%d %H\:%M\:%S} : fontsize=24 : fontcolor=white : x=10: y=10'" out.mp4

returns

%{localtime} requires at most 1 arguments

error.

the only difference is \:


回答1:


You can use:

%{localtime\:%Y/%m/%d %H\\\\\:%M\\\\\:%S}

It's ugly. See FFmpeg: Quoting & Escaping for some info.



来源:https://stackoverflow.com/questions/54046060/how-to-drawtext-colon-with-localtime-in-ffmpeg-filter-complex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!