Hi Bernard,
It turns out that the problem is a mixture of a broken mpeg4-visual stream and a too strict decoder in AVBlocks.
There are errors in frame #9 (1-based counting, an I frame): the last 3 macroblocks are invalid, they cannot be decoded and this stops the transcoding.
This particular error in the stream is not critical and we can make the decoding process more robust.
What we can do:
1. Drop the whole frame where such error occurs. I've tested this and we successfully decode 10 out of the 11 frames from the attached stream (frame #9 is missing). This is easy to do but it's not optimal.
2. Ignore the bad macroblocks and produce a decoded frame with artefacts. I've tested this as well and I have 11 frames decoded with frame #9 having artefacts.
The artefacts are acceptable and I guess this is better than dropping the whole frame. However this solution needs more testing especially with longer streams. We'd like to know if this defect occurs only on I frames, if it can be in the middle of the frame or always at the end and similar things.
3. Of course the best would be to conceal the defect by reusing previous macroblocks but currently I have not worked on this so far.
So please tell us if 1) or/and 2) are good enough for you. For 2) it would be very helpful if you provide us with longer test streams so that we can investigate the defect pattern and test more thoroughly the error recovery.
It's also interesting to know how this defect is produced: is it a camera firmware bug, is it a network problem?
Best Regards,
Svilen