简体   繁体   中英

How to add timestamp to video with different date & time format provided by android?

I am making android app to add timestamp to video using FFMPEG library and also it works fine but it add timestamp using by default date time format provided by FFMPEG.

视频截图

it's uses YYYY-MM-DD HH:MM:SS format for timestamp

where android provide different date & time format Click here for examples

ex: I want to use "EEE, MMM d, ''yy" date format for timestamp.

How to do that?

I an using this FFMPEG Command:

ffmpeg -y -i input.mp4 -vf "drawtext=fontfile=roboto.ttf:fontsize=36:fontcolor=yellow:text='%{pts\\:gmtime\\:1456007118}'" -preset ultrafast -f mp4 output.mp4

ffmpeg calls strftime from the system's linked C library to generate the formatted string, so what's possible will depend on what your available strftime function can do.

That said, this is the closest I can get, using MinGW strftime

text='%{pts\:gmtime\:1456007118\:%a, %b %d, %y}'

which produces

Sat, Feb 20, 16

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM