[FFmpeg-user] Drawtext with PTS and creation time

Tanglor tanglor at poczta.onet.pl
Tue Dec 8 19:56:34 CET 2015


Hi,
Windows 7
ffmpeg version N-76224-ga7c5005 Copyright (c) 2000-2015 the FFmpeg 
developers

I've got multiple small files recorder by Panasonic DVR. I would like to 
print recording time. DVR display this data (using some internal player 
and logic).
I've tried
--
ffmpeg -i 
S4310001.mp4 -vf "drawtext=fontfile=arial.ttf:expansion=normal: 
text='%{metadata\:creation_time}': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000 at 1" 
-y out.mp4 4
--
without any success.  Despite that ffmpeg display this:
--
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'S4310001.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 1
     compatible_brands: mp42avc1
     creation_time   : 2015-11-25 20:15:24
   Duration: 00:00:20.16, start: 0.000000, bitrate: 5764 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), 
yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 5586 kb/s, 25 fps, 25 
tbr, 90k tbn, 50 tbc (defau
lt)
     Metadata:
       creation_time   : 2015-11-25 20:15:24
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 125 kb/s (default)
     Metadata:
       creation_time   : 2015-11-25 20:15:24
---
Honestly, none of above metadata values wasn't displayed (major_brand, 
minor_version, compatible_brands, etc).

I've succed with
ffmpeg -i 
S4310001.mp4 -vf "drawtext=fontfile=arial.ttf:expansion=normal: 
text='%{pts\:gmtime}': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000 at 1" 
-y out.mp4
but here I need some calculated offset as ffmpeg starts counting from 
1970-01-01 00:00:00.
How can I read creation time (or file creation time as most of the time 
those values are the same) and use it inside pts?


More information about the ffmpeg-user mailing list