ffmpeg vfilters at specific timecodes

后端 未结 1 1016
[愿得一人]
[愿得一人] 2021-01-15 04:38

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

相关标签:
1条回答
  • 2021-01-15 04:54

    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.

    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
    

    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.

    Like this: cat part1.mpg part2.mpg part3.mpg > whole.mpg

    0 讨论(0)
提交回复
热议问题