【问题标题】:Display images on video at specific framerate with loop using FFmpeg使用 FFmpeg 以特定帧率循环显示视频上的图像
【发布时间】:2020-11-11 03:03:38
【问题描述】:

我有一个 mp4 视频路径和一组图像(00.png,01.png... 170.png)。这些图像具有 alpha(透明背景)。我想在特定时间(00:05-1:35)以 15 帧速率循环显示这些图像在我的视频上作为叠加层。这意味着当所有图像显示一次时,如果提到的时间没有过去,它们将重新显示。

For example, assume that I've a set of 3 images(00.png, 01.png, 02.png) with 4 framerate and I want to display them only during 00:00-00:02 so:

the images that will be displayed at 00:00-00:01 will be: 00, 01, 02, 00.

the images that will be displayed at 00:01-00:02 will be: 01, 02, 00, 01.

我尝试过使用它,但它什么也没做(只是尝试了 1 张图片作为开始)。

final String[] cmd = {"-f","-i",output_mp4,"-framerate", "15", "-loop", "1", "-i",image1,"-filter_complex","overlay=shortest=1", newOutput};

FFmpeg.execute(cmd);

有什么方法可以得到我想要的?

有一个“选择”选项可能会有所帮助:

https://video.stackexchange.com/questions/19873/extract-specific-video-frames

【问题讨论】:

    标签: android ffmpeg android-ffmpeg


    【解决方案1】:

    使用setpts 偏移图像时间戳,然后使用overlayenable option

    ffmpeg -i input -framerate 15 -loop 1 -i %d.png -filter_complex "[1]setpts=PTS+5/TB[fg];[0][fg]overlay=enable='between(t,5,95)':shortest=1" output
    

    【讨论】:

      猜你喜欢
      • 2023-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-09
      • 2013-04-16
      • 1970-01-01
      • 1970-01-01
      • 2020-06-11
      相关资源
      最近更新 更多