[FFmpeg-user] Drawtext with PTS and creation time
nathan at nathanbeach.com
Sat Dec 12 10:52:20 CET 2015
Hi Tanglor again,
I finally figured out a hackish way to do this with a script, using
ffprobe. I'm not really a shell programmer, so forgive me if something
here is really dumb. I've just pieced it together from dozens of
stackoverflow posts, and it works to overlay a formatted creation_date in
the bottom right corner of the video between seconds 2 and 7.
The creation_date in my files seemed to be GMT, so I had to convert them to
CDT as well... maybe this will help you. This works on Mac OSX 10.10.5,
and you might have to tweak some stuff on other platforms:
for CURRENT_FILE in *.mov; do
CREATION_TIME=`ffprobe -v quiet "$CURRENT_FILE" -print_format compact
# in the format like: "format|tag:creation_time=2015-12-08 16:13:13"
SECONDS=`TZ="Europe/London" date -j -f "%Y-%m-%d %T" "$CDATE" +%s`
MY_TIME=`TZ="America/Chicago" date -r $SECONDS +"%Y-%m-%d %I:%M %p"`
ffmpeg -i "$CURRENT_FILE" -vf
-acodec copy -y "../output/$CURRENT_FILE"
I finally got this to work, but I try to assemble the videos using concat
and the audio is off and the video plays back too slowly. I've been
messing with this all day, and I pretty much give up. Video processing is
just too hard for my cro-magnon brain.
More information about the ffmpeg-user