0

I'm trying to concatenate 3 videos, which have different encodings, and 2 lack audio. I added mute audio tracks to the ones that didn't have any using:

ffmpeg -i video1_no_audio.m4v -f lavfi -i anullsrc -c:v copy -map 0:v -map 0:a? -map 1:a -shortest video1_now_with_blank_audio.m4v

Then I tried to concatenate them with:

ffmpeg -i video1_now_with_blank_audio.m4v -i video2.mp4 -i video3_now_with_blank_audio.m4v -filter_complex "[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] concat=n=3:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" combined_vdeo.mp4

This fails with:

Parsed_concat_0 @ 0x7fba9b00fd80] Input link in1:v0 parameters (size 1920x1720, SAR 1:1) do not match the corresponding output link in0:v0 parameters (1204x1080, SAR 1:1) [Parsed_concat_0 @ 0x7fba9b00fd80] Failed to configure output pad on Parsed_concat_0 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #2:0 Conversion failed!

The 1st and 3rd videos are title and credit sequences that I made in Keynote, and exported as .mk4 videos. On screen, they have 1920x1720 aspect ratio, which matches the video I'm trying to concatenate them with. I'm not sure how to fix the 1st and 3rd videos so they match the 2nd, and then concatenate them...

2
  • Your Keynote videos should be exported with resolution 1920x1720.
    – Gyan
    Jun 23, 2018 at 19:10
  • Thanks! I just realized that. It was not clear to me that was the problem, because Quicktime still displays them in the correct aspect ratio.
    – pts2
    Jun 23, 2018 at 19:26

1 Answer 1

0

I found a workaround. The two videos that were mismatched in terms of resolution with the 3rd were created in Keynote and exported as movies (File>Export to>Movie). There is a setting for resolution, and I initially chose the 1080p option. Even though the outputs still displayed 1920x1720 in Quicktime (leading me to think they were in fact coded as 1920x1720), they apparently were not (at least as far as FFmpeg was concerned). I discovered that if I instead exported them from Keynote using "custom" resolution instead of 1080p, I was given the option to enter 1920x1720. When I used videos created this way, the FFmpeg command worked perfectly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .