types - 连接视频片段时 ffmpeg 显示错误 : "Media type mismatch between the parsed_overlay_20"

标签 types ffmpeg concatenation mismatch

773/5000 我正在尝试对视频的不同片段应用缩放和色键效果,然后将这些片段再次组合成一个。

为了缩短时间并提高性能,我开发了一个程序,可以在单个命令中创建所有过滤器。

计划很简单,我有一个用绿屏和背景*.jpg录制的视频*.mov,

  1. 我首先从 JPG 图像中准备几个具有模糊效果的背景
  2. 然后我应用色度键使视频的绿色部分变得透明
  3. 我对在多个时间段中应用了色度键的视频进行了修剪,并对每个片段应用了比例和裁剪,并将其叠加到步骤 1 中准备的背景之一
  4. 连接所有已处理的段。

当我执行结果命令时,它给出了错误

命令是这样的:

ffmpeg -i "C:\ffmpeg\pruebas\FFBlue_ProjectsFiles\chroma\green1.mov" -i C:\ffmpeg\pruebas\FFBlue_ProjectsFiles\fondos\sc.jpg -filter_complex " [1:v]scale=iw*3:-1,crop=w=iw/3:h=ih/3:y=(ih-oh)/3:x=((iw-ow)/2)+(ow/2-ow/3),boxblur=7:2[fondo_3IZQ] ; [1:v]scale=iw*4:-1,crop=w=iw/4:h=ih/4:y=(ih-oh)/3:x=(in_w-out_w)/2,boxblur=6:2[fondo_4CEN] ; [1:v]scale=iw*5:-1,crop=w=iw/5:h=ih/5:y=(ih-oh)/3:x=((iw-ow)/2)+(ow/2-ow/3),boxblur=5:2[fondo_5IZQ]  ; [0]chromakey=color=#83BD46:similarity = 0.1 : blend = 0.05,selectivecolor=reds=0 0 0 -1:yellows=0 0.1 0 -0.5:greens=0 0 -1 0:whites=0 0 0 -0.7 [vid]  ;  [vid] trim=start=0:duration=0,setpts=PTS-STARTPTS,scale=iw*4:-1,crop=w=iw/4:h=ih/4:y=(ih-oh)/3:x=((iw-ow)/2)+(ow/2-ow/3)[vid_0] ; [fondo_4CEN][vid_0]overlay[toma_0] ; [vid] trim=start=0:duration=3.41933,setpts=PTS-STARTPTS,scale=iw*3:-1,crop=w=iw/3:h=ih/3:y=(ih-oh)/3:x=(in_w-out_w)/2[vid_1] ; [fondo_3IZQ][vid_1]overlay[toma_1] ; [vid] trim=start=3.41932988166809:duration=2.85067,setpts=PTS-STARTPTS,scale=iw*5:-1,crop=w=iw/5:h=ih/5:y=(ih-oh)/3:x=(in_w-out_w)/2[vid_2] ; [fondo_5IZQ][vid_2]overlay[toma_2]  ; [toma_0] [toma_1] [toma_2] concat=n=3:v=1:a=1:unsafe=1 [v_concatenado][a_concatenado]" -map [v_concatenado]  -map [a_concatenado] "C:\ffmpeg\pruebas\FFBlue_ProjectsFiles\chroma\green1_FINAL.mov"

当我执行它时 ffmpeg 说:

[Parsed_overlay_20 @ 0000000000404100] Media type mismatch between the 'Parsed_o
verlay_20' filter output pad 0 (video) and the 'Parsed_concat_26' filter input p
ad 1 (audio)
[AVFilterGraph @ 0000000003527a00] Cannot create the link overlay:0 -> concat:1
Error initializing complex filters.
Invalid argument

最佳答案

您告诉 concat 过滤器输出音频流,但您没有提供任何音频输入。

1。添加 atrim 过滤器:

[0:a]trim=start=1:duration=3,asetpts=PTS-STARTPTS[a0];[1:a]trim=start=10:duration=2,asetpts=PTS-STARTPTS[a1];[2:a]trim=start=100:duration=6,asetpts=PTS-STARTPTS[a2];

根据您的需要调整开始持续时间值。

2。然后在 concat 过滤器中引用它们:

[toma_0][a0][toma_1][a1][toma_2][a2]concat=n=3:v=1:a=1:unsafe=1 [v_concatenado][a_concatenado]

关于types - 连接视频片段时 ffmpeg 显示错误 : "Media type mismatch between the parsed_overlay_20",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48478595/

相关文章:

java - Collection<?> 和 Collection<T> 有什么区别

FFMPEG - x265 (libx265) 的一些推荐参数是什么?

ffmpeg - 什么 ffmpeg 命令行会列出关键帧?

python - 为什么使用索引匹配列将 Series 连接到 DataFrame 不起作用?

Scala:如何在编译时不知道类型的情况下调用具有类型参数和 list 的方法?

generics - 为什么我收到此代码的 'receiver type mismatch' 错误

Oracle JDBC 和 Oracle CHAR 数据类型

c - FFmpeg:使用自定义上下文打开视频时未指定像素格式

c++ - 如何连接 2 个 LPOLESTR

python - 根据第一列中的字母数将行与上一行连接起来