ffmpeg vfilters在特定的时间代码 [英] ffmpeg vfilters at specific timecodes
问题描述
我想为某些视频添加水印,但我只希望水印在视频中的某些时间码(例如开始/中间/结束)出现,并且只需几秒钟。
I want to add a watermark to some videos but I only want the watermark to appear at certain timecodes in the video (e.g. beginning / middle / end) and only for a few seconds.
我已经得到ffmpeg按照这里的说明执行水印: http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1400
I've gotten ffmpeg to do the watermarking following the directions here: http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1400
但是我可以不知道如何在不同的时间码上打开/关闭水印。
这是我用来添加水印的命令:
But I can't figure out how I can turn the watermark on/off at different timecodes. Here is the command I am using to add the watermark:
ffmpeg -i test.mpg -vf "movie=0:png:wm.png [wm];[in][wm] overlay=10:10:1 [out]" wm_test.mpg
任何建议将不胜感激!
推荐答案
仍然没有实现,听到有关计划。以前我处于这种情况,我来了一个丑陋的工作解决方案。
It's still not implemented and I haven't heard about plans for it. I was in this situation a few times before and I came with an ugly, however working solution.
只需将视频分割成几部分,例如您的视频为30秒长度不等,并且您想要每10秒部分使用不同的水印,然后将视频分为3部分,如下所示:
Simply split your video in parts, so for example your video is 30 seconds in length and you want a different watermark to each 10 seconds part, then split your video into 3 parts like this:
ffmpeg -i in.mpg -t 00:00:10 // First 10 seconds
ffmpeg -i in.mpg -ss 00:00:10 -t 00:00:10 // middle 10 seconds
ffmpeg -i in.mpg -ss 00:00:20 -t 00:00:10 // last 10 seconds.
-ss // starting position
-t // length to process
您将拥有3部分水印,您可以简单地粘贴它们。对于mpg,您可以使用一个简单的unix CAT工具,因为mpeg格式。
After you will have 3 parts watermarked, you can simply glue them. For mpg you can use a simple unix CAT tool, because of the mpeg format.
像这样: cat part1.mpg part2.mpg part3。 mpg> whole.mpg
这篇关于ffmpeg vfilters在特定的时间代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!