【问题标题】:FFMPEG scale, zoom, and concat filterFFMPEG 缩放、缩放和连接过滤器
【发布时间】:2018-08-02 20:14:49
【问题描述】:

我正在使用 ffmpeg for android 来制作 mp4 格式的视频。我无法让这个命令在 FFMPEG 中工作,基本上我正在尝试添加两个图像,缩放它们,添加缩放效果,最后将结果连接到一个视频文件中。我做过这样的事情:

ffmpeg 
-t 8 -i image1.png
-t 8 -i image2.png
-filter_complex
[0:v]scale=720:720[scl1]; [1:v]scale=720:720[scl2];
[scl1]zoompan=z=if(lte(zoom, 1.0), 1.55, max(1.001, zoom - 0.0010)):d=205, fade=t=out:st=7:d=1[v0];
[scl2]zoompan=z=if(lte(zoom, 1.0), 1.55, max(1.001, zoom - 0.0010)):d=205, fade=t=in:st=0:d=1,fade=t=out:st=7:d=1[v1];
[v0][v1]concat=n=2:v=1:a=0, format=yuv420p[v] -map [v] outputVideo.mp4

一直在修改这个命令,但仍然无法让它工作,我得到了错误:

Input link in1:v0 parameters (size 1280x720, SAR 0:1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 45:31)
[Parsed_concat_7 @ 0xf0d77600] Failed to configure output pad on Parsed_concat_7

【问题讨论】:

    标签: ffmpeg android-ffmpeg


    【解决方案1】:

    使用

    ffmpeg 
    -i image1.png
    -i image2.png
    -filter_complex
    [0:v]scale=720:720,setsar=1[scl1]; [1:v]scale=720:720,setsar=1[scl2];
    [scl1]zoompan=z=if(lte(zoom, 1.0), 1.55, max(1.001, zoom - 0.0010)):s=720x720:d=205, fade=t=out:st=7:d=1[v0];
    [scl2]zoompan=z=if(lte(zoom, 1.0), 1.55, max(1.001, zoom - 0.0010)):s=720x720:d=205, fade=t=in:st=0:d=1,fade=t=out:st=7:d=1[v1];
    [v0][v1]concat=n=2:v=1:a=0, format=yuv420p[v] -map [v] outputVideo.mp4
    

    在单个图像上使用缩放平移时,请在过滤器中设置持续时间(以帧为单位),而不是在输入中。

    您突出显示的问题是由于缩放过滤器调整了纵横比。 setsar 过滤器使它们相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-20
      • 2015-02-08
      • 1970-01-01
      • 2013-10-25
      • 2018-06-21
      相关资源
      最近更新 更多