2

I've always joined my MOV recordings with

ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/%s'\n" ./*.mov) -c copy o.mov

however, due to a small glitch in one particular file, I get h264_mp4toannexb filter failed to receive output packet. I may discard the part with the glitch, which is around 01m40s into the file. Copying the problematic input file with -c copy works, but using the new output for joining still fails.

Things I tried without success:

  • -fflags discardcorrupt
  • -err_detect ignore_err
  • -ignore_unknown
  • -copy_unknown
  • -ss 00:03:00

A Google search for the error above only returns the source code itself for the concat option: ftp://opensource.tambov.ru/ffmpeg/ffmpeg/libavformat/concatdec.c

2

One easy workaround I found while writing this question is simply discarding the broken piece of the input file before trying to concatenate the files, in a separate command, since -f concat and -ss 00:03:00 don't work together when "h264_mp4toannexb filter failed to receive output packet" is present.

For example, to discard the first 3 minutes of the file, then concatenate separately:

$ ffmpeg -i broken.mov -c copy -ss 00:03:00 fixed.mov
$ mv broken.mov broken.mov.ignore
$ ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/%s'\n" ./*.mov) -c copy o.mov

I still can't understand why concatenating is the only operation that fails with that error, but the source code linked above might give some hint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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