I am trying to make a video with FFMPEG, and I am concat'ing several videos together. However, the last two are generated from a PNG image using the -loop
option.
ffmpeg -loop 1 -i img001.png -filter crop=768:432:128:72 -c:v libxvid -q 1 -t 5 -s 360x288 -aspect 16:9 out1.mp4
ffmpeg -loop 1 -i img002.png -filter crop=768:432:128:72 -c:v libxvid -q 1 -t 5 -s 360x288 -aspect 16:9 out2.mp4
Then I add silence to it using a wav file.
ffmpeg -i out1.mp4 -i silence.wav -shortest -c:v copy -c:a ac3 out11.mp4
ffmpeg -i out2.mp4 -i silence.wav -shortest -c:v copy -c:a ac3 out21.mp4
After that I expect that it is ready, so I run the concat filter.
ffmpeg -f concat -i full.txt -c copy "Q1-Full.mp4"
full.txt
contains
file 'Likoonl-Q1-Intro.mp4'
file 'Likoonl-Q1-All.mp4'
file 'Likoonl-Q1-X2.mp4'
file 'out11.mp4'
file 'out21.mp4'
And right at the end of the run, I get this output.
[mp4 @ 049e6a80] st:0 PTS: 98240188 DTS: 98240188 < 689858768 invalid, clipping
When I play Q1-Full.mp4
, it has the correct duration, but stops playing at the end of 'Likoonl-Q1-X2.mp4'.
ffmpeg -i Likoonl-Q1-Intro.mp4
? Note that when you do a-c copy
and concatenate files of different origin, problems are quite expected. It could be possible to re-encode and/or throw away the original timestamps…