From patchwork Mon May 14 08:23:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Krzciuk?= X-Patchwork-Id: 8945 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp3780711jad; Mon, 14 May 2018 01:31:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqBmemdFsqkYKYOVfd4SkdyBsm22RSEQy/oZUYxcX2+Lin4ieOyiAJED0XR+ZZFWyZ85kAF X-Received: by 2002:adf:8323:: with SMTP id 32-v6mr6638225wrd.174.1526286663457; Mon, 14 May 2018 01:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526286663; cv=none; d=google.com; s=arc-20160816; b=STp6sx5uq3JmNdgwDGeno0S6tZKVsUlZh1O3ZOVTDP3EZzOcW7ix6QgdmYffKwwAwW UCDJCIGSF28HfZwouetCKzkqyvQBTCg39A0hYLjO5lySHuyyQveILeWulGBmT7b6VzAd hAo7WF/E6T6qJaP9D17nT7EnDploiZOi5SC3poohjWbZPOyOfGFSBIbiGYuSt1iNiC8j EKck5icediQ6oyZztF/9pHDnD/2owwofe1N9nxl7bJV80Ick68ZI6ss4TEG26DwoNAcg B/jX6D3TWrLFtO7K8dUackh0V11vJ1VB4JKLkK9UYbVbDYsp0bip21iXkKl/bzXUmCJh 849w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=1jMYnulN5R9ysvPdm2UW5R1rIMntn20obTiReeU8PK8=; b=xQFlm09bPelRudkXbsW1t/LSLEDHaw4g793h9Z7ZLj8f7AJPodQuHhBSD+EYtM9zYb aSaZX17L+72HdpbU7nOdQfWqKEHzay6kHz/4qeo0QomIRN0ub7kZPg6se1eIGOYCPJoD d7e9JK+GvGZURONhlkXvGt+5zesrzLINKkrUVMHWSNtzLPAtx3QsIScL8qTA0pUuHDIS ecFhfC5/XBaZyObvTHhhgjEV5F4aOdYTm8hvG4OpL7prHTjsb9oNqyp/7t3vy4NK6u/F 6XrcskAt43exTyq7hj4lGt++pPV2D0JoRQt2Y9TeechZGlf38NDOws//ShvGf4b0PkQc ofkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@vewd-com.20150623.gappssmtp.com header.s=20150623 header.b=XxEu/8gk; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 90-v6si7765405wro.441.2018.05.14.01.31.03; Mon, 14 May 2018 01:31:03 -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=@vewd-com.20150623.gappssmtp.com header.s=20150623 header.b=XxEu/8gk; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8563689D63; Mon, 14 May 2018 11:30:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B0717689AED for ; Mon, 14 May 2018 11:30:17 +0300 (EEST) Received: by mail-wm0-f54.google.com with SMTP id a8-v6so11872591wmg.5 for ; Mon, 14 May 2018 01:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vewd-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=JkQMcu2gIMqOEOLmFa/eob9g/NX9/YFArtRvqQbPLRg=; b=XxEu/8gk3XkaoxhfvHv8H0qJn6+VTJcJNKoiKEjlHvb0tyhLC5FG7ioOHZ2/4LKBLs k/ZKeOKZToSfTmryGuq/o0PpekIHjDhqeyMrKMVWt5Sv9c6JvMiFld2ndqT4iBpJAdtc gmO+Ofg0kcasBekqY76Vw040ZcXmmTlXqOK0yZD4HLaMw1OZAoGPTh+JTMcnWxA+HkyU IIfXothJ3AlLyEka3JNSMTpa4VWtiKbCKwa2NDAtAZdxVaqbFNIX110XblgcQ5C5bMP6 n334MXUJnVVePqPnu4BVVNSaKbrTZM8Fxa57t9zmMXGbmqo+Sd8uRc8H9HlAE/Zt/HYI skzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=JkQMcu2gIMqOEOLmFa/eob9g/NX9/YFArtRvqQbPLRg=; b=Tz0lDpX9Aph1AwUVJA9BSMiYcJmgSpzK4QsX6rhxU1+5V9psddm5xba3FmefyH6fZq cqAtFCMutI3Qo7eu1/R9TeYJdocE120HeBnbfjsJNAH0eRO/Z3Y+tL5IkCu3Ht+3bz3p diY4sqVWLceRAFN8MHGxzqfBJ5RV7BeOO9kckEy9tSIXC9+CcyKBFq1lxr3NqEpG0rm/ ydIQaBDHckaTnI3Jmq4nZjsaYcB/+oeOvGVbadMnXCZLemNu4HYbXZYpjHaeEtg+8UkG HlwAHubiWxCdYv8ReZOamuDTf2Z9uIuRkBnUwOqrg+SbVQIzY8BjGy7fkIX3uNz8FCp8 LU4w== X-Gm-Message-State: ALKqPwcyWsreOva8+dbs8eYAoVLUzHlY7w+NFM2zdnCDnUwYuTxGrT9C ybv5apA2KEF/UysE/BZ97GqWwkLgn+q70Nf+n+W4VDI8 X-Received: by 2002:a1c:b595:: with SMTP id e143-v6mr4237308wmf.66.1526286240218; Mon, 14 May 2018 01:24:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.55.133 with HTTP; Mon, 14 May 2018 01:23:59 -0700 (PDT) In-Reply-To: References: <20180413155020.GV20131@michaelspb> <20180418210319.GA20131@michaelspb> <20180425000934.GP20131@michaelspb> <20180426000546.GD20131@michaelspb> <20180510010922.GH20131@michaelspb> From: =?UTF-8?Q?=C5=81ukasz_Krzciuk?= Date: Mon, 14 May 2018 10:23:59 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases 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" I have prepared a testcase. PMT data comes from org.hbbtv_HTML50420. Please review. Regards, *Łukasz Krzciuk* Developer Vewd ul. Grabarska 2, Pegaz 2A, 50-079 Wrocław, Polska On Thu, May 10, 2018 at 8:54 PM, Aman Gupta wrote: > On Thu, May 10, 2018 at 1:46 AM Łukasz Krzciuk wrote: > > > Lets skip a testcase. It will be not easy to me to prepare it. > > > It should be simple to extract a small sample containing the PMT. If you > link some larger samples I can help extract the relevant bytes for test > case. > > Aman > > > > > > Regards, > > > > *Łukasz Krzciuk* > > Developer > > > > Vewd > > ul. Grabarska 2 > > , Pegaz 2A, > > 50-079 Wrocław, Polska > > > > > > On Thu, May 10, 2018 at 3:09 AM, Michael Niedermayer > > > > wrote: > > > > > On Wed, May 09, 2018 at 10:19:26AM +0200, Łukasz Krzciuk wrote: > > > > Any updates on this issue? > > > > > > about adding a testcase ? > > > adding a huge sample file is not possible. > > > It either has to be made smaller or generated by a muxer > > > or last resort, no test > > > > > > [...] > > > -- > > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC7 > 87040B0FAB > > > > > > The worst form of inequality is to try to make unequal things equal. > > > -- Aristotle > > > > > > _______________________________________________ > > > ffmpeg-devel mailing list > > > ffmpeg-devel@ffmpeg.org > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > > > > > > _______________________________________________ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > From fc2e281eb0e0e526fee52944205d6bb3729a17f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krzciuk?= Date: Fri, 13 Apr 2018 14:57:57 +0200 Subject: [PATCH] avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases 1. an audio component with an ISO_639_language_descriptor in the PMT with the audio_type field set to 0x03 2. a supplementary_audio_descriptor with the editorial_classification field set to 0x01 3. an ac-3_descriptor or an enhanced_ac-3_descriptor with a component_type field with the service_type flags set to Visually Impaired --- libavformat/mpegts.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 37a6aa8..629631f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1835,6 +1835,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type break; case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; break; } } @@ -1910,6 +1911,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type switch ((flags >> 2) & 0x1F) { /* editorial_classification */ case 0x01: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; break; case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; @@ -1934,6 +1936,34 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } } break; + case 0x6a: /* ac-3_descriptor */ + { + int component_type_flag = get8(pp, desc_end) & (1 << 7); + if (component_type_flag) { + int component_type = get8(pp, desc_end); + int service_type_mask = 0x38; // 0b00111000 + int service_type = ((component_type & service_type_mask) >> 3); + if (service_type == 0x02 /* 0b010 */) { + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; + av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + } + } + } + break; + case 0x7a: /* enhanced_ac-3_descriptor */ + { + int component_type_flag = get8(pp, desc_end) & (1 << 7); + if (component_type_flag) { + int component_type = get8(pp, desc_end); + int service_type_mask = 0x38; // 0b00111000 + int service_type = ((component_type & service_type_mask) >> 3); + if (service_type == 0x02 /* 0b010 */) { + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; + av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + } + } + } + break; default: break; } -- 2.8.3