gpt4 book ai didi

react-native - 我无法使用 ffmpeg 在叠加层之上应用叠加层

转载 作者:行者123 更新时间:2023-12-04 23:32:34 25 4
gpt4 key购买 nike

正如标题所说,我不能在叠加层之上应用叠加层。更具体地说,我有这些层:

  • 背景
  • 视频
  • 贴纸

  • 我想在第一层和第三层的大小上创建第四层。所以我想要的顺序是:
  • 白层
  • 背景
  • 视频
  • 贴纸

  • 按照我提出的文档:
    const command = [
    '-y', // always overwrite file
    '-loop', '1', // one time
    '-i', dataObject['bg_src'], // bg image
    '-i', dataObject['videos']['main']['src'], // video
    '-i', dataObject['fg_src'], // sticker image
    '-i', dataObject['fg_src'], // bg image2
    '-preset', 'veryfast', // fast encoding
    '-crf', '23', // quality
    '-vcodec','libx264', // codec
    '-t', '3', // time threshold
    '-loglevel', '24', // verbose level
    '-filter_complex',
    '[0:v]pad=ceil(iw/2)*2:ceil(ih/2)*2[bg_src];' + // bg_src: to make width even, export it as [bg_src]
    '[2:v]pad=ceil(iw/2)*2:ceil(ih/2)*2[fg_src];' + // fg_src: to make width even, export it as [fg_src]
    '[3:v]pad=ceil(iw/2)*2:ceil(ih/2)*2[fg_src2];' + // bg_src: to make width even, export it as [fg_src2]
    'color=white,format=rgb24[white_canvas];' + // create white background
    '[white_canvas][fg_src2]scale2ref[b][a];' + // make white background same size as [fg_src2]
    '[a][b]overlay=0:0[white_canvas_scaled];' + // export it as white_canvas_scaled
    '[1:v]scale=%s:-1[video_scaled];' + // video: scale it (width is injected here)
    '[white_canvas_scaled][video_scaled]overlay=%s:%s:shortest=1[bg];' + // white background & scaled video
    '[bg][bg_src]overlay=0:0[bg2]', // bg_src overlay here
    '[bg2][fg_src]overlay=0:0', // fg_src overlay here
    FileService.photoPath + '/output.mp4'];

    但在最后一个命令失败,我收到:

    Unable to find a suitable output format for '[bg2][fg_src]overlay=0:0'



    怎么了?

    最佳答案

    过滤器末尾缺少分号(和“+”)?

    关于react-native - 我无法使用 ffmpeg 在叠加层之上应用叠加层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58102347/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com