From patchwork Mon Jul 8 12:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 13857 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 133CF449C13 for ; Mon, 8 Jul 2019 15:05:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E322568B04C; Mon, 8 Jul 2019 15:05:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7614368B02A for ; Mon, 8 Jul 2019 15:05:27 +0300 (EEST) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id D12E250BBE for ; Mon, 8 Jul 2019 14:05:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 92u1YAdWcAAH for ; Mon, 8 Jul 2019 14:05:22 +0200 (CEST) To: ffmpeg-devel@ffmpeg.org References: <04890aa9-5cee-85c5-8127-f5b9987e0a08@gyani.pro> <41DFAD96-AD63-4631-8855-10797103FC79@gmail.com> <4ce92dab-6fa0-2461-fb35-339c05332144@gyani.pro> <34d9535a-8c20-aec7-554a-6bc5c12a5348@gyani.pro> From: Gyan Message-ID: <89a2a366-de1c-8dd6-116c-f16a990fd907@gyani.pro> Date: Mon, 8 Jul 2019 17:35:20 +0530 MIME-Version: 1.0 In-Reply-To: <34d9535a-8c20-aec7-554a-6bc5c12a5348@gyani.pro> Content-Language: en-US Subject: Re: [FFmpeg-devel] [PATCH] avformat/mpegenc - reject unsupported audio streams 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 25-04-2019 01:48 PM, Gyan wrote: > > > On 25-04-2019 01:23 PM, Ali KIZIL wrote: >> >> There are also Dolby Codecs (ac3 & eac3). Will it also throw error for >> these codecs ? > > AC3   is      supported before and after this patch. > EAC3 is unsupported before and after this patch. > > But it's sent to the same decoder, so support could be added. I'll check. Attached patch allows muxing EAC3 in MPEG-PS.  Stock ffmpeg can demux and decode such streams fine. Gyan From 4558eab851efc252fc6cac4aff4f557b5768004a Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Mon, 8 Jul 2019 17:04:21 +0530 Subject: [PATCH] avformat/mpegenc: allow muxing eac3 streams --- libavformat/mpegenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 43ebc46e0e..15b191bc9d 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -352,6 +352,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) case AVMEDIA_TYPE_AUDIO: if (!s->is_mpeg2 && (st->codecpar->codec_id == AV_CODEC_ID_AC3 || + st->codecpar->codec_id == AV_CODEC_ID_EAC3 || st->codecpar->codec_id == AV_CODEC_ID_DTS || st->codecpar->codec_id == AV_CODEC_ID_PCM_S16BE || st->codecpar->codec_id == AV_CODEC_ID_PCM_DVD)) @@ -360,7 +361,8 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) "consider using the vob or the dvd muxer " "to force a MPEG-2 program stream.\n", avcodec_get_name(st->codecpar->codec_id)); - if (st->codecpar->codec_id == AV_CODEC_ID_AC3) { + if (st->codecpar->codec_id == AV_CODEC_ID_AC3 || + st->codecpar->codec_id == AV_CODEC_ID_EAC3) { stream->id = ac3_id++; } else if (st->codecpar->codec_id == AV_CODEC_ID_DTS) { stream->id = dts_id++; @@ -415,7 +417,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) } else if (st->codecpar->codec_id != AV_CODEC_ID_MP1 && st->codecpar->codec_id != AV_CODEC_ID_MP2 && st->codecpar->codec_id != AV_CODEC_ID_MP3) { - av_log(ctx, AV_LOG_ERROR, "Unsupported audio codec. Must be one of mp1, mp2, mp3, 16-bit pcm_dvd, pcm_s16be, ac3 or dts.\n"); + av_log(ctx, AV_LOG_ERROR, "Unsupported audio codec. Must be one of mp1, mp2, mp3, 16-bit pcm_dvd, pcm_s16be, ac3, eac3 or dts.\n"); goto fail; } else { stream->id = mpa_id++;