[FFmpeg-user] Drawtext with PTS and creation time

Tanglor tanglor at poczta.onet.pl
Sat Dec 12 12:04:08 CET 2015


Hi,
I've read code for drawtext. In function func_metadata It simply finds 
given metadata key in internal dictionary and print it.
The question is which metadata? This what print ffprobe or ffmpeg -f 
metadata aren't displayed - simple test runs proves it.
I don't know HOW to extract frames metadata.

On the other hand - as I wrote in previous mail and as you wrote - it 
has to be done with handmade script. Like get file creation time, 
convert it to second since epoch and use it as offset for PTS.
Thank you for your solution - its something. I will work on converting 
it to windows batch.

Nevertheless - this should be fixed in code, so we - as users - 
shouldn't be forced to this kind of hacks.
Thank you, Nathan.

On 2015-12-12 10:52, Nathan Beach wrote:
> 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:
>
> #!/bin/bash
>
> for CURRENT_FILE in *.mov; do
>      CREATION_TIME=`ffprobe -v quiet "$CURRENT_FILE" -print_format compact
> -show_entries format_tags=creation_time`
>
>      # in the format like: "format|tag:creation_time=2015-12-08 16:13:13"
>      CDATE=${CREATION_TIME:(25)}
>
>      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
> "drawtext=enable='between(t,2,7)':fontfile=/Library/Fonts/Microsoft/Arial.ttf:fontcolor=white:fontsize=64:text=\'${MY_TIME}\':x=main_w-(text_w+64):y=main_h-(text_h*2)"
> -acodec copy -y "../output/$CURRENT_FILE"
>
> done
>
> 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.
>
> NBB
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list