loading...

How to drawtext colon with pts gmtime using ffmpeg?

github logo ・1 min read

I am adding timestamp to video using FFMPEG where i am using below command:

ffmpeg -y -i input.mp4 -vf "drawtext=fontfile=roboto.ttf:fontsize=36:fontcolor=yellow:text='%{pts:gmtime:1575526882:%d/%m/%y %H:%M}'" -preset ultrafast -f mp4 output.mp4

in this command i am using : between %H and %M in text attribute of drawtext

like this:
text='%{pts:gmtime:1575526882:%d/%m/%y %H:%M}'

because i want to print time like this 06:25

it show me this error: Unterminated %{} near '{pts:gmtime:1575526882:%d/%m/%y %H'

how can i print : between %H and %M where %H is for hours and %M is for minutes?

twitter logo DISCUSS (1)
markdown guide
 

Looks like the colon (:) is used for seperating params there. Therefore, you may want to use text='%{pts:gmtime:1575526882:%d/%m/%y %H}:%{pts:gmtime:1575526882:%M}'

Classic DEV Post from Jun 19 '19

Is GraphQL the future of APIs?

Graphs are everywhere! What are the main benefits of the data graph structure? Is GraphQL the future of APIs?

Milan Tejani profile image
I Love Code I am Android Developer and Python enthusiast