简体   繁体   English

使用ffmpeg在Android上为捕获的视频加水印

[英]Using ffmpeg to watermark a capturing video on Android

I'm now researching on a project which utilizes ffmpeg to watermark captured video on Android. 我现在正在研究一个项目,该项目利用ffmpeg在Android上为捕获的视频加水印。 At the moment I can capture a video from the camera firstly and then use ffmpeg to watermark it. 目前,我可以先从摄像机捕获视频,然后使用ffmpeg对其进行水印处理。 I don't know if it is possible to operate the video while it is being captured? 我不知道在拍摄视频时是否可以对其进行操作?

Here is an example, how to capture a webcam video on my Windows system and draw a counting timestamp. 这是一个示例,说明如何在Windows系统上捕获网络摄像头视频并绘制计数时间戳。

To list all devices that can be used as input : 列出所有可用作输入的设备:

ffmpeg -list_devices true -f dshow -i dummy

To use my webcam as input and draw the timestamp (with -t 00:01:00 1 minute is recorded): 要将我的网络摄像头用作输入并绘制时间戳(记录了-t 00:01:00 1分钟):

ffmpeg -f dshow -i video="1.3M HD WebCam" -t 00:01:00 -vf "drawtext=fontfile=Arial.ttf: timecode='00\:00\:00\:00': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y output.mp4

The font-file Arial.ttf was located in the folder I was with the terminal in. 字体文件Arial.ttf位于终端所在的文件夹中。

(Source : http://trac.ffmpeg.org/wiki/How%20to%20capture%20a%20webcam%20input and http://trac.ffmpeg.org/wiki/FilteringGuide ) (来源: http : //trac.ffmpeg.org/wiki/How%20to%20capture%20a%20webcam%20inputhttp://trac.ffmpeg.org/wiki/FilteringGuide

I hope it may help. 希望对您有所帮助。

Have a nice day ;) 祝你今天愉快 ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM