I have an mp4 video file that I want to play it in iOS using avfoundation. Unfortunately, the file is not being played and save into the default gallery (photos) even it has h264 video codec and aac audio codec. And it is only playable when I reencode it using ffmpeg. I want to know why the file only becomes playable after reencoding the video?

Not Playable(originalFile.mp4) vs Playable File(outputFile.mp4) Information Comparison

enter image description here

File is playable with avfoundation when these commands are being applied:

  1. ffmpeg -y -hide_banner -i originalFile.mp4 -f mp4 -vcodec h264 -vf scale=out_color_matrix=bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -b:v 5703k -acodec aac -b:a 249k outputFile.mp4

  2. ffmpeg -y -hide_banner -i originalFile.mp4 -f mp4 -vcodec h264 -acodec aac outputFile.mp4

File is not playable with avfoundation when this command is being applied:

  1. ffmpeg -y -hide_banner -i originalFile.mp4 -f mp4 -vcodec copy -acodec aac outputFile.mp4

originalFile.mp4 file link: https://drive.google.com/file/d/1-yZFL0EsLztMIfwU79Al6dv8gdwJyGAD/view?usp=sharing

ffprobe streams of both files are here https://www.diffchecker.com/VgZL66QB

  • NOTE: I can't comment to Jason Conrad so I am posting it as an answer and will delete it. How do we understand if a video is interlaced from the information FFMPEG provides us? In the above answer Jason Conrad mentions that "smpte170m/bt470bg/bt709." means its interlaced video. But this is just color space information. How does it mean interlace or progressive? Is it possible to share anymore details or URL to read further? Thanks very much for your answer.
    – Tahlil
    Jun 28, 2020 at 4:33
  • Share the full output of ffprobe -show_streams for both original file and outputfile.
    – Gyan
    Jun 28, 2020 at 18:45
  • @Gyan I've modified the question and now you can get the outputs of ffprobe streams from there. Thanks. Jun 29, 2020 at 5:00
  • Only the colorimetry appears to be different. But that shouldn't stop playback. Nevertheless, try ffmpeg -i originalFile.mp4 -c copy -color_primaries bt709 -color_trc bt709 -colorspace bt709 -movflags +faststart outputFile.mp4
    – Gyan
    Jun 29, 2020 at 5:22
  • @Gyan I've applied your suggested command but nothing has changed in the outputFile's information and the video isn't playable on iOS either. Can you suggest any special reads on colorimetry, please? Thanks. Jun 29, 2020 at 11:09

1 Answer 1


The original video is an old, interlaced format. At least, according to the line that says, "smpte170m/bt470bg/bt709." The SMPTE standard is available for purchase here, but you can tell from the summary that it's interlaced.

The second ffmpeg command is copying the format without re-encoding, or handling the interlacing, which isn’t supported on iOS. The first set of commands work because the video is being re-encoded. Whether or not the video is automatically being de-interlaced, I can’t say without seeing, but I doubt it. See my answer to this question to judge for yourself.

  • smpte170m/bt470bg/bt709 only indicates colorimetry and nothing about scan.
    – Gyan
    Jun 28, 2020 at 17:16
  • The incompatibility -- regardless of its nature -- is present in the original file. The blue highlighting in the "Information Comparison" graphic illustrates the only differences between the files of which we know. Of those differences, only the SMPTE spec is salient. Sure, it's an educated guess, but there's really not much else to go on. Jun 28, 2020 at 18:04
  • The first string smpte170m refers to the colorspace, the 2nd bt470bg refers to the color primaries and the 3rd bt709 to the transfer function (gamma). Interlacing, when detected, will be indicated by printing of the field order e.g. top first, after colorimetry.
    – Gyan
    Jun 28, 2020 at 18:39
  • So you're saying the original file follows the smpte170m color standard, but isn't interlaced. I accept that. But still, whatever incompatibility exists, is in the original file, which is why the -copy argument produces an incompatible file, and why re-encoding doesn't. Jun 28, 2020 at 19:31

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.