0

I really don't get this; I use ffmpeg concat one 2 files and the audio is concated well, but the videos aren't. The second video causes freeze/flicker/green screen instead.

'ffmpeg -y -f concat -i concat.txt -c:v libx264 -pix_fmt yuv420p -c:a copy output.mkv

Comparing the files, I have made them as identical as possible:

  • input.mkv1
    Video: MPEG4 Video (H264) 1280x720 60fps [V: h264 main L4.1, yuv420p, 1280x720 [default]] Audio: AAC 48000Hz stereo [A: aac, 48000 Hz, stereo [default]]
  • input2.mkv
    Video: MPEG4 Video (H264) 1280x720 60fps [V: English [eng] (h264 main L4.1, yuv420p, 1280x720) [default]] Audio: AAC 48000Hz stereo [A: English [eng] (aac, 48000 Hz, stereo) [default]]

What could cause this behavior?

Flicker

4
  • How did you generate the 2nd file (command)?
    – Gyan
    Apr 3, 2016 at 5:17
  • 1st file was generated through OBS as .flv and made into .mkv. 2nd file was generated through Premiere Pro and made into .mkv. If I define 2nd file first, the 1st file's video gets messed up Apr 3, 2016 at 10:21
  • Any console warnings/errors during encoding/playback?
    – aergistal
    Apr 4, 2016 at 10:02
  • I ended up switching method. There were warnings which I missed because I was also looking for errors, but I didn't manage to troubleshoot the warnings either. Apr 4, 2016 at 13:34

1 Answer 1

0

I ended up using this solution instead: https://trac.ffmpeg.org/wiki/Concatenate#protocol

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

Converting into .ts allowed me to concat without weird flickering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.