[FFmpeg-user] timestamp overlay
jessekoegler at gmail.com
Tue Aug 30 23:51:25 EEST 2016
On Tue, Aug 30, 2016 at 1:47 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
> 2016-08-30 14:14 GMT+02:00 franck all <all.franck007 at gmail.com>:
> > I would like to add timestamp overlay with format
> > "hours:mintues:seconds:millseconds" on a video. I have tried to do it
> > ffmpeg and the best I have managed to do is "hours:minutes:seconds:frames
> > number"
> Please provide your command line and the complete, uncut console output.
> Carl Eugen
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
I am not sure what platform you are on but I recently had this problem on
Windows. I would love a command-line only solution but wasn`t able to
figure one out. In the interest of time I ended up doing the following as a
workaround (Note: steps 2-4 involve some scripting or programming. I used
C# and would be happy to share the algorithm/code I used if you are
1. force the video to a fixed frame rate, in my case 30 fps; i.e. ffmpeg -i
myVideo.mp4 -r 30 myNewVideo.mp4
2. ffprobe the video for duration, parse stderr for the duration
3. convert the duration to total seconds, then multiply that by your fps.
This gives you total frames.
4. Create an .srt file, loop through the number of frames, and write a
timestamp for each frame.
5. Write the subtitles to the video; something like: ffmpeg -y -i
If anyone knows an easier way to do this on Windows I`d love to know.
P.S: Apologies in advance for top-posting or any formatting errors.
More information about the ffmpeg-user