I am using ffmpeg to encode raw pixels data (bgr32) into a video file.
Pixels data is being sent from java application to ffmpeg stdin pipe.
I am looking for a way to add a timestamp overlay to each frame in the encoded video file.
It looks like there is a way to add a timestamp of current time.
The instructions could be found here: http://einar.slaskete.net/2011/09/05/adding-time-stamp-overlay-to-video-stream-using-ffmpeg/
Examples of code from that site are this:
ffmpeg -f video4linux2 -i /dev/video0 -s 640x480 -r 30 -vf \
"drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf: \
text='\%T': [email protected]: x=7: y=460" -vcodec libx264 -vb 2000k \
-preset ultrafast -f mp4 output.mp4
And this:
ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 \
-vf "drawtext=fontfile=/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: \
text='%{localtime\:%T}': [email protected]: x=7: y=700" -vcodec libx264 \
-preset veryfast -f mp4 -pix_fmt yuv420p -y output.mp4
Video files that I am encoding were captured few days ago and I need to add a custom time to each frame. For example 12/12/2013 11:11:45 and not the current time.
Is it possible to do something like it using ffmpeg?