Opened 2 months ago

Last modified 7 weeks ago

#7480 new defect

HEVC codec info string

Reported by: tbucher Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


ffmpeg -f lavfi -i testsrc -t 4 -c:v libx265 -tag:v hvc1 -x265-params no-opengop=1:no-scenecut=1:keyint=100:strict-cbr=1 -b:v 3M -bufsize 1500k -vf scale=-2:1080,format=yuv420p -use_timeline 1 -use_template 1 -single_file 0 -adaptation_sets "id=0,streams=0" -seg_duration 4 -hls_playlist 1 -init_seg_name "init_$RepresentationID$.m4s" -media_seg_name "seg_$RepresentationID$_$Number%06d$.m4s" -y -f dash manifest.mpd

should insert proper codec info string for HEVC both into master.m3u8 and manifest.mpd.

However, even though the tag is forced as hvc1, the resulting codec info string is hev1 in both manifest types, which is ignoring the forced tag or generated hvc1 box and it is not complete as specified by ISO, it is missing profile, level, etc.

resulting truncated master.m3u8

resulting truncated manifest.mpd
<Representation id="0" mimeType="video/mp4" codecs="hev1" bandwidth="3000000" width="1440" height="1080" frameRate="25/1">

Especially m3u8 is now problematic since native decoder in Safari is refusing such m3u8 playlist.
Inserting CODECS tag into master.m3u8 playlist is a recently commited feature, removing this tag or replacing the hev1 value with one based on ISO makes the stream in Safari playable again.

Not including FFmpeg log as it is irrelevant.

Change History (8)

comment:1 Changed 2 months ago by tbucher

  • Keywords hls mpeg-dash hevc added

comment:2 Changed 2 months ago by cehoyos

  • Keywords mpeg-dash hevc removed

comment:3 Changed 2 months ago by j_karthic

I have just now sent a patch to include the forced tag hvc1 instead of hev1.

Will the above patch solve this playout issue? Or does it require the profile, level etc., If it requires profile, level could you please point me to relevant spec, so that I can try to implement it.

comment:4 Changed 2 months ago by tbucher

Thank you.

With regards to the rest, yes, Apple apparently requires the whole codec info based on my trial & error attempts as long as native Safari player is involved, playback via MSE in Safari is more lenient.
I've cobbled up the codec info for my succesful playback based on This page lists ISO/IEC 14496-15 as the standard the development should refer to.

comment:5 Changed 8 weeks ago by j_karthic

I have sent a patch to disable CODECS tag for HEVC streams.
I have tested that it plays in native Safari and things are back the way it was for HEVC streams.
Hope this fixes your issue.

Last edited 8 weeks ago by j_karthic (previous) (diff)

comment:6 Changed 7 weeks ago by tbucher

Appreciated. I haven't tested it yet, but if its purpose is to remove CODECS tag for HEVC from master m3u8 to make them playable again, that should be fine for the time being.

However, HLS Pantos RFC specification says that CODECS tag SHOULD be present while Apple guidelines say the it MUST be present, so using it also for HEVC should be a given in the near future.

I read your comments on that patch why it is not implemented now, should we keep the ticket open in order to track this?

comment:7 Changed 7 weeks ago by j_karthic

Sure, Let us keep this ticket open to track this issue.

comment:8 Changed 7 weeks ago by tbucher

  • Cc added
Note: See TracTickets for help on using tickets.