[FFmpeg-user] when concatenating video segments ffmpeg shows error: "Media type mismatch between the parsed_overlay_20"

Lou Logan lou at lrcd.com
Sun Jan 28 01:28:58 EET 2018


On Sat, Jan 27, 2018, at 1:07 PM, Igor Cabrera wrote:
[...]
> When I execute the resulting command it gives me the error
> 
> the command is this:
> 
> 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"
> 
> when I execute it ffmpeg says:
> 
> [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

You are telling the concat filter to output an audio stream but you did not provide any audio inputs.

1. Add atrim and asetpts filters:

[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];

Adjust the start and duration values to your needs. Refer to the atrim docs for more options.

2. Then reference the audio streams in the concat filter:

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



More information about the ffmpeg-user mailing list