avformat/dashenc: Disable writing CODECS tag for HEVC streams
authorkjeyapal@akamai.com <kjeyapal@akamai.com>
Sun, 21 Oct 2018 08:40:48 +0000 (14:10 +0530)
committerKarthick J <kjeyapal@akamai.com>
Fri, 2 Nov 2018 01:57:47 +0000 (07:27 +0530)
For HEVC streams, only the FourCC tag is written without profile, level etc.,
This is breaking playout support in native Safari.
Native Safari playout expects the full info in CODECS tag or None at all.

libavformat/dashenc.c

index 4e2ea2ebf2ca72ca0c7dbe5f60a46ed66e46aefa..f8b3d106d5cfe41d64a9428683952ca60dc2cc73 100644 (file)
@@ -915,6 +915,7 @@ static int write_manifest(AVFormatContext *s, int final)
             AVStream *st = s->streams[i];
             OutputStream *os = &c->streams[i];
             char *agroup = NULL;
             AVStream *st = s->streams[i];
             OutputStream *os = &c->streams[i];
             char *agroup = NULL;
+            char *codec_str_ptr = NULL;
             int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
             if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
                 continue;
             int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
             if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
                 continue;
@@ -925,10 +926,13 @@ static int write_manifest(AVFormatContext *s, int final)
                 av_strlcat(codec_str, ",", sizeof(codec_str));
                 av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
             }
                 av_strlcat(codec_str, ",", sizeof(codec_str));
                 av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
             }
+            if (st->codecpar->codec_id != AV_CODEC_ID_HEVC) {
+                codec_str_ptr = codec_str;
+            }
             get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i);
             ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate,
                                      playlist_file, agroup,
             get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i);
             ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate,
                                      playlist_file, agroup,
-                                     codec_str, NULL);
+                                     codec_str_ptr, NULL);
         }
         dashenc_io_close(s, &c->m3u8_out, temp_filename);
         if (use_rename)
         }
         dashenc_io_close(s, &c->m3u8_out, temp_filename);
         if (use_rename)