React native 我无法使用ffmpeg在覆盖上应用覆盖
正如标题所说,我不能在覆盖层之上应用覆盖层。更具体地说,我有以下几层: 出身背景 视频 贴纸 我想创建第四层,大小为1和3层。所以我想要的顺序是: 白层 出身背景 视频 贴纸 根据我提供的文档:React native 我无法使用ffmpeg在覆盖上应用覆盖,react-native,ffmpeg,React Native,Ffmpeg,正如标题所说,我不能在覆盖层之上应用覆盖层。更具体地说,我有以下几层: 出身背景 视频 贴纸 我想创建第四层,大小为1和3层。所以我想要的顺序是: 白层 出身背景 视频 贴纸 根据我提供的文档: const command = [ '-y', // always overwrite file '-loop', '1', // one time '-i', dataObject['bg_src'], // bg image
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'];
但在最后一个命令失败时,我收到:
无法为“[bg2][fg_src]overlay=0:0”找到合适的输出格式
怎么了?缺少分号和过滤器末尾附近的“+”