[FFmpeg-user] Draw original timecode on the output file

Ivaylo Spasov ivaylo.pif at gmail.com
Thu Sep 26 20:39:42 CEST 2013


> Tom Horsley wrote:
>
> Here is a script I use to put timestamps in a small copy of a
> file so I can pick off the times of commercials and edit them
> out :-).
>
> http://home.comcast.net/~tomhorsley/game/files/generate-timestamps.txt
>
> It should give you an idea of how drawtext works.

Tom, this looks very nice. I compiled my ffmpeg with drawtext filter
and I created command based on your script:

ffmpeg -i input.avi -copyts -vf
"scale=480:-1,drawtext=fontsize=18:fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf:box=1:text='%{pts}':x=(w-text_w-5):y=(h-text_h-5)"
-c:v libx264 -preset ultrafast -threads 8 -crf 28 -c:a libfdk_aac -ac
2 output.mp4

I have two questions:

1. Is this the real timecode of the file. If the file has different
original timecode which not start from zero will this command drow the
same on the output.mp4 file?

2. How to format this timecode. I've got timecode like 0.0 seconds,
but I am trying to achieve 00:00:00.000 ?

Thanks in advance!


More information about the ffmpeg-user mailing list