Skip to content

Instantly share code, notes, and snippets.

@jasperf
Created April 20, 2024 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasperf/ce57e286982e13088aaf47459bd1e837 to your computer and use it in GitHub Desktop.
Save jasperf/ce57e286982e13088aaf47459bd1e837 to your computer and use it in GitHub Desktop.
ffprobe mp4 format that Apple iOS on iPhone 14 does not play. Could be AVC level issue that causes things to freeze on second chunk 206 status
ffprobe -loglevel error -show_streams ~/Desktop/img-3322-online-video-cuttercom-2.mp4
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
initial_padding=0
id=0x1
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=569287
duration=12.909002
bit_rate=127807
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=557
nb_read_frames=N/A
nb_read_packets=N/A
extradata_size=5
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:non_diegetic=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
TAG:language=und
TAG:handler_name=SoundHandler
TAG:vendor_id=[0][0][0][0]
[/STREAM]
[STREAM]
index=1
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_tag_string=avc1
codec_tag=0x31637661
width=590
height=1080
coded_width=590
coded_height=1080
closed_captions=0
film_grain=0
has_b_frames=2
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=31
color_range=tv
color_space=unknown
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=progressive
refs=1
is_avc=true
nal_length_size=4
id=0x2
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=387387
duration=12.912900
bit_rate=4792023
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=387
nb_read_frames=N/A
nb_read_packets=N/A
extradata_size=48
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:non_diegetic=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
TAG:language=und
TAG:handler_name=VideoHandler
TAG:vendor_id=[0][0][0][0]
TAG:encoder=Lavc59.37.100 libx264
[/STREAM]
@jasperf
Copy link
Author

jasperf commented Apr 20, 2024

https://stackoverflow.com/questions/21120717/h-264-video-wont-play-on-ios and

The problem was that the video used the h.264 Main Profile level 5.1, while iOS only supports AVC level 3.1 (more info here).

I confirmed this by following these instructions to change the profile and level bytes using a hex editor. Search the file for avcC in ASCII or 61 76 63 43 in hex. The first byte is usually 01 and is unimportant to this purpose, but after that should be one of the following:

42 E0 – for Baseline Profile
4D 40 – for Main Profile
58 A0 – for Extended Profile
64 00 – for High Profile
The number after that is the level (without the decimal point) in hex, e.g.:

1F (31 in dec) is level 3.1

says level 31 or level 3.1 should play.. odd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment