如何使用FFMpeg -timestamp语法

rei*_*lee 3 video ffmpeg video-processing video-streaming

在此输入图像描述

大家好!

     ffMpeg -timstamp 
Run Code Online (Sandbox Code Playgroud)

选项工作喜欢上图?07:21:54 07/07/05在黑匣子容器中的白色文本.

在ubuntu 12.04中输入了这样的执行.

     ffmpeg -y -f video4linux2 -s vga -r 30 -fs 1M -i /dev/video0 -timestamp now -copyts ./USB1_Test_vga.mp4
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

显示视频录制时间还有其他选项吗?

av5*_*501 11

曾经有一个drawtext过滤器.

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
Run Code Online (Sandbox Code Playgroud)

见这里:http://ffmpeg.org/trac/ffmpeg/wiki/FilteringGuide

我相信你可以用类似sprintf的语法替换确切的时间码.

ffmpeg -f video4linux2 -i /dev/video0 -s 640x480 -r 30 -vf \
"drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf: \
text='\%T': fontcolor=white@0.8: x=7: y=460" -vcodec libx264 -vb 2000k \
-preset ultrafast -f mp4 output.mp4
Run Code Online (Sandbox Code Playgroud)

在这里看到: http://einar.slaskete.net/2011/09/05/adding-time-stamp-overlay-to-video-stream-using-ffmpeg/