Unable to decode mp4 video using AVFoundation on iPhone 11 Pro

Basic Information
Please
provide a descriptive title for your feedback:
Unable to decode mp4 video using AVFoundation on iPhone 11 Pro

Which area are you seeing an issue with?
AVFoundation


What type of feedback are you reporting?
Incorrect/Unexpected Behavior
Description

Please describe the issue and what steps we can take to reproduce it:
Receiving decoderNotFound -11833 when trying to decode a 1 second mp4 video using iPhone 11 Pro currently on iOS14 beta 5. On other devices it works without a problem. It happens specifically on iPhone 11 Pro and iPhone XR.
  1. Have 1 second mp4 video

  2. use copyNextSampleBuffer

  3. check the status of assetReader; it will be .failed

  4. Expected to see images on screen

The image is not displayed. Everything is grey

More details
Code Block
Error Domain=AVFoundationErrorDomain Code=-11833 "Cannot Decode" UserInfo={NSUnderlyingError=0x280c94510 {Error Domain=NSOSStatusErrorDomain Code=-12906 "(null)"}, NSLocalizedFailureReason=The decoder required for this media was not found., AVErrorMediaTypeKey=vide, NSLocalizedDescription=Cannot Decode}

What is the format of the video within the MPEG-4 container?
Hope that helps:

Code Block LMUCM693642:~ q372725$ mdls /Users/<XXXXX>/Downloads/ri.mp4.decrypted.mp4 
kMDItemCodecs           = (
  "MPEG-4 Video"
)
kMDItemContentCreationDate     = 2020-08-26 14:18:29 +0000
kMDItemContentCreationDate_Ranking = 2020-08-26 00:00:00 +0000
kMDItemContentModificationDate   = 2020-08-26 14:18:30 +0000
kMDItemContentType         = "public.mpeg-4"
kMDItemContentTypeTree       = (
  "public.mpeg-4",
  "public.item",
  "public.movie",
  "public.audiovisual-content",
  "public.mpeg-4",
  "public.data",
  "public.content"
)
kMDItemDateAdded          = 2020-08-26 14:18:29 +0000
kMDItemDateAdded_Ranking      = 2020-08-26 00:00:00 +0000
kMDItemDisplayName         = "ri.mp4.decrypted.mp4"
kMDItemDurationSeconds       = 0.033
kMDItemFSContentChangeDate     = 2020-08-26 14:18:30 +0000
kMDItemFSCreationDate       = 2020-08-26 14:18:29 +0000
kMDItemFSCreatorCode        = ""
kMDItemFSFinderFlags        = 0
kMDItemFSHasCustomIcon       = (null)
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery       = (null)
kMDItemFSLabel           = 0
kMDItemFSName           = "ri.mp4.decrypted.mp4"
kMDItemFSNodeCount         = (null)
kMDItemFSOwnerGroupID       = 20
kMDItemFSOwnerUserID        = 501
kMDItemFSSize           = 226117
kMDItemFSTypeCode         = ""
kMDItemInterestingDate_Ranking   = 2020-08-26 00:00:00 +0000
kMDItemKind            = "MPEG-4 movie"
kMDItemLastUsedDate        = 2020-08-26 14:20:56 +0000
kMDItemLastUsedDate_Ranking    = 2020-08-26 00:00:00 +0000
kMDItemLogicalSize         = 226117
kMDItemMediaTypes         = (
  Video
)
kMDItemPhysicalSize        = 229376
kMDItemPixelHeight         = 960
kMDItemPixelWidth         = 1280
kMDItemStreamable         = 0
kMDItemTotalBitRate        = 54098
kMDItemUseCount          = 3
kMDItemUsedDates          = (
  "2020-08-25 22:00:00 +0000"
)
kMDItemVideoBitRate        = 54098
kMDItemWhereFroms         = (
  "https://store-028.blobstore.apple.com/v01/FFU/4744/7330/0000/15250875/ri.mp4.decrypted.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=MKIA0879Y5FEZQ0RYD6Z%2F20200826%2Fstore-028%2Fs3%2Faws4_request&X-Amz-Date=20200826T141828Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host&X-Amz-Signature=fcfa21a912f213d7edb36b95179589dbcd43581092de878286dc13c8aa6a969e",
  "https://feedbackassistant.apple.com/feedback/8477280"
)


Unfortunately that does not show the relevant information. I'm wondering what format the actual video is in (e.g. H.264, HEVC, etc).
It is MPEG-4 Video. Can be the problem that the "video" is super short 0.3sec. If we are using a extended video e.g 6 seconds we don't have a problem.
That sounds unexpected to me. Please file a report via feedback assistant and include the video file that works on some devices but not others.
I'm using command line to give more information about this video:

Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41/isom/iso2)
File size : 200 KiB
Duration : 33 ms
Overall bit rate mode : Constant
Overall bit rate : 49.7 Mb/s
Encoded date : UTC 1970-01-01 00:00:09
Tagged date : UTC 1970-01-01 00:00:09

Video
ID : 1
Format : MPEG-4 Visual
Format profile : Simple@L4a
Format settings : BVOP
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : mp4v-20
Duration : 33 ms
Bit rate mode : Constant
Bit rate : 49.0 Mb/s
Width : 1 280 pixels
Height : 960 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 FPS
Color space : YUV
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 1.330
Stream size : 200 KiB (100%)
Language : English
Encoded date : UTC 1970-01-01 00:00:09
Tagged date : UTC 1970-01-01 00:00:09
We noticed that the length is not the problem per se.
It could be the MPEG-4 container, codecs etc.

I experience the same error message with iPhone 11 Pro and other selected few models. It happens with extremely short assets encoded with MPEG-4 Part 2, using ffmpeg's -c:v mpeg4 option.

Unable to decode mp4 video using AVFoundation on iPhone 11 Pro
 
 
Q