4

enter image description here

Hi, All!

     ffMpeg -timstamp 

option works likes upper image? 07:21:54 07/07/05 white text in black box container.

in ubuntu 12.04 typed the excute like this.

     ffmpeg -y -f video4linux2 -s vga -r 30 -fs 1M -i /dev/video0 -timestamp now -copyts ./USB1_Test_vga.mp4

but it doesn't work.

is there any other option for display video recorded time?

1
  • 1
    The ffmpeg -timestamp option takes a date, which it stores in the output file. It is not related to the timecode and does not cause any text to be rendered. Commented Sep 6, 2012 at 6:59

1 Answer 1

15

There used to be a drawtext filter.

ffmpeg -i in.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timecode='09\:57\:00\:00': r=25: \
x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y out.mp4

See here: http://ffmpeg.org/trac/ffmpeg/wiki/FilteringGuide

I believe you can replace the exact time code with a sprintf like syntax.

ffmpeg -f video4linux2 -i /dev/video0 -s 640x480 -r 30 -vf \
"drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf: \
text='%{localtime\:%T}': [email protected]: x=7: y=460" -vcodec libx264 -vb 2000k \
-preset ultrafast -f mp4 output.mp4

See here: http://einar.slaskete.net/2011/09/05/adding-time-stamp-overlay-to-video-stream-using-ffmpeg/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.