VideoToolbox H264 decoder on iOS does not deal with bitstream errors (but VT+macOS works fine)

Number:rdar://35979205 Date Originated:
Status: Resolved:
Product:iOS + SDK Product Version:
Classification:Serious Bug Reproducible:Always


H264 bitstreams can sometimes contain minor errors. Most video players detect and recover from these errors automatically, so playback is not affected.

I've attached one such sample file, h264-error.mp4. I'm using VideoToolbox to decode/play this video on macOS and iOS. On macOS it plays back without issue. On iOS/tvOS, VideoToolbox throws errors when the bitstream error is encountered.

Steps to Reproduce:

1. Download h264-error.mp4 (via attachment, or

2. Play it in Quicktime on macOS. It will playback as expected.

3. Play it on iOS or tvOS, for instance via Safari using the URL above. After three seconds of playback, the video will freeze momentarily until the next key frame is encountered.


iOS 11.2
macOS 10.13.1


iPhone X
iMac (Retina 5K, 27-inch, 2017)


Using any ffmpeg-based video player (for instance VLC) to view the same file also works as expected, with no visible problems during playback. Looking at ffmpeg's log, you can see it detects the bitstream errors and corrects them automatically:

[ffmpeg/video] h264: error while decoding MB 74 44, bytestream -10
[ffmpeg/video] h264: concealing 55 DC, 55 AC, 55 MV errors in P frame

Similarly VideoToolbox on macOS (presumably inside the Intel H264 decoder) also detects and corrects these errors automatically, with no error messages surfacing out of the VTDecompressionSession.


Resolution: Investigation complete - Works as currently designed

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!