0

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'.

6
  • Please provide the full, uncut console output of your ffmpeg commands. Either in the post or with Pastebin. How did you generate the first three files?
    – slhck
    Oct 17, 2014 at 18:22
  • The first 3 files are generated in another program called Handbrake. Oct 17, 2014 at 18:35
  • 1
    Then I would assume that they use different encoding settings than the two you generate. What did you set in Handbrake? Perhaps you can show us the output of 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…
    – slhck
    Oct 17, 2014 at 18:39
  • I ended up using the concat with a complex filtergraph. I guess it's a filter. Will add an answer. Oct 18, 2014 at 2:01
  • 1
    Would still be good to see the info about your files, in addition to having an answer on how you fixed it.
    – slhck
    Oct 19, 2014 at 18:30

1 Answer 1

0
ffmpeg -i Q1-Full.mp4 -i Q1-Contact.mp4 -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]"

You must log in to answer this question.

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