From patchwork Tue Sep 4 08:15:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 10229 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp3591291jap; Tue, 4 Sep 2018 01:16:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb37onCWlo1l/mDn7HimH5rLIP+KgFQGJK39RYSSAiGV3f0nmB08e4nHXoo63K6ItSAovD9 X-Received: by 2002:a5d:4512:: with SMTP id s18-v6mr22538152wrq.82.1536048980659; Tue, 04 Sep 2018 01:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536048980; cv=none; d=google.com; s=arc-20160816; b=mrxyCIHi3spU82FHgcFXtC/GT4s9j+VHW83tN1a/+7sBLtqQwWEW/kgyLY1UENr9+G wfoT0DKJyww6M3QbAGcAY+tYKWkZE8ATuU302SZtat32KB4mlzkKO8JooyMP/IPaFhd/ 4AW7RZtPIktj2LcyLMU7CChHfFEDlYkmxvt4x1WBXlamMmHKquTJ219OD0F+0mWR5Jcv 9ff7zYw62Qzsl+5LVxioRZhlOktE9hGO2HPPa7K1Jo4wRVm2BlcICpXV9LdKj+1jUJM6 2kfOVsOUKAaFo3z6wVq0r4qf/Tqy/r/eUg4mnXoV6rZFAQJhVilTWE9mP6Vk9J+UOfmf BERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=JFkBgLw+EztjcLS5Y/6GF84t3Ep5fUJ8Q1HwqH0S8AU=; b=qJz9aMLzSqRrqhwy3kEhTGIfs6h9JoQxgu5CjaBZu9qQK4HHB/CSDzCUVboWaQ73bi 5H7XCJetID7v5dFKYfVsgvQHh7vqlo6dOCcy4R9NG1BigHASkneOrzUHzXexQyU3yrRi sgXPRC/SWXK1ZJZy4oPBEQXjzdB7J9iziqbxDjEqeZfb6GcGknXlSXfi2TO4W1uth5ZY t2VqbrHOkP4c+Kj6CNYjk7ajAfrGDVo0txjFxcgJq7dPTf8RRX0ai2jaBK85Mr50Mjfe cIAhTNo6sRibCeRfEFAFtXjFhPGIi0PirvUEG9aSIGaFoEm78z/aWiipHFPj52DEQO+2 dc2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b="BevO/1Gm"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c12-v6si19095147wrn.202.2018.09.04.01.16.20; Tue, 04 Sep 2018 01:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b="BevO/1Gm"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5ED04689ECC; Tue, 4 Sep 2018 11:16:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a1i318.smtp2go.com (a1i318.smtp2go.com [43.228.185.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8392F689CEA for ; Tue, 4 Sep 2018 11:15:56 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1536049868; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=+Tn3Lhz+WcJQ4ZqTvyDRkZQSBnu3gOwj9Z1nwzs83qs=; b=BevO/1Gm Yt5GsWqj0OoG2hwJ/QegtxkMLK10/FLnIsj4COA714B8E4a0O2BFp4KrU2FX+sVFGYcLsoEbFLZuk 6HcCtKAh5nkqJdaC//KLt3i8LnQm/QsGqFQTwp1Wp/UccfeC1OFd+0sYWczXZPC/FBxVO4Dhlvrqb wgP6nlolat41q32WGzMTW3ldt/VAL4T/jqhG3/fkvQYy7urh8MQuBKcjsL4fP+NLn5o4y3Gyh2hX+ Chn2U2huQcDUqoUe2N0Ltgm2EuXJLhsQdFWwv1XIFPUKlRwDDbZ/sic4tq0Lmj3D0KTKt8445TAB1 BrEKNs1dJQpKBfItAE+L7Ivqfw==; Received: from [10.45.63.29] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1fx6VE-Itk9Ka-MP; Tue, 04 Sep 2018 08:16:00 +0000 Received: from [10.125.17.166] (helo=gmail.com) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1fx6VC-RyuNeF-5f; Tue, 04 Sep 2018 08:15:58 +0000 Received: from gmail.com (localhost [127.0.0.1]) by gmail.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w848FoeN027406; Tue, 4 Sep 2018 13:45:50 +0530 Received: (from akamai@localhost) by gmail.com (8.14.4/8.14.4/Submit) id w848FnHS027399; Tue, 4 Sep 2018 13:45:49 +0530 From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Sep 2018 13:45:47 +0530 Message-Id: <1536048948-27353-1-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 X-Smtpcorp-Track: 1fx6VCRyIN-F5f.Mn8BvlPei Feedback-ID: 337386m:337386asVRLGB:337386skJOixtcLJ:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH v2 1/2] avformat/dashenc: Add CODECS tag to HLS master playlist X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Karthick Jeyapal MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Karthick Jeyapal --- libavformat/dashenc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index ae57fd5..c36ab12 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -864,6 +864,7 @@ static int write_manifest(AVFormatContext *s, int final) if (c->hls_playlist && !c->master_playlist_created) { char filename_hls[1024]; const char *audio_group = "A1"; + const char audio_codec_str[128] = "\0"; int is_default = 1; int max_audio_bitrate = 0; @@ -895,21 +896,31 @@ static int write_manifest(AVFormatContext *s, int final) playlist_file, i, is_default); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); + if (!av_strnstr(audio_codec_str, os->codec_str, sizeof(audio_codec_str))) { + if (strlen(audio_codec_str)) + av_strlcat(audio_codec_str, ",", sizeof(audio_codec_str)); + av_strlcat(audio_codec_str, os->codec_str, sizeof(audio_codec_str)); + } is_default = 0; } for (i = 0; i < s->nb_streams; i++) { char playlist_file[64]; + char codec_str[128]; AVStream *st = s->streams[i]; OutputStream *os = &c->streams[i]; char *agroup = NULL; int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead; + av_strlcpy(codec_str, os->codec_str, sizeof(codec_str)); if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && max_audio_bitrate) { agroup = (char *)audio_group; stream_bitrate += max_audio_bitrate; + av_strlcat(codec_str, ",", sizeof(codec_str)); + av_strlcat(codec_str, audio_codec_str, sizeof(codec_str)); } get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); - ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, NULL, NULL); + ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, + codec_str, NULL); } avio_close(out); if (use_rename)