From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 58E134395D for ; Sun, 3 Jul 2022 20:40:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D72668B986; Sun, 3 Jul 2022 23:40:16 +0300 (EEST) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D01E168B922 for ; Sun, 3 Jul 2022 23:40:09 +0300 (EEST) Received: by mail-pg1-f172.google.com with SMTP id 23so7196678pgc.8 for ; Sun, 03 Jul 2022 13:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9jYftG/1LUSRXA11rHetbimBIzkmGuLNbKni8T3o4sc=; b=cjFmXRXaUnnFZ/7xjlZTOl26G6xJCyJ7ryCisk5xSSzQshnSBBYuUJ6aLUdLrteA9u 3/YgBbJ0LXQvvc+XC0XrCtWFNHR1FpiVIewuTOgGp+o7fX26nHaRAq0OoEuO4jAXAB7X cYCavo2fKUmjOoHOUYRAC5IB1xgaTTe4mTWyp5ep2UpTsu26FUl8LLax/oUEcYvu4knK +MRLyAV7Ersnp7Zd3kvqC0mtjvd1z6MoK2AFCZXCCOaUI4Ulctn7RvYHAspQM5dm5YW6 2n5QND2OP3rR77Wh04DH2GCvAdJeTbDhmqxOnsSXFt7NXAmbb+zMsbFtW0SNhGUlhPzV 8hNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9jYftG/1LUSRXA11rHetbimBIzkmGuLNbKni8T3o4sc=; b=bd/7DBpKkAYgT0EK7h+DlZ0SVZIzGvxci5AZ/XkA8hPrV9RRk7d2Xaowd5LrRdEwKg PPN97SRxhezomHgB8ftzXbFQ8sNRFBSUeIlB9SwMdoc+GktGg/X2/UctaFjNfWGiCgcS fZCKJPqpsQeWmUt383fX4aCUEAYaAdpkgg817sRkAZKLDJHzxErscFbOQTFDq2XLvXYN 4pIDh3szpXKJ25Up9A15PCBSQ+0Nptt3CZQbwjxuijeRH4ewNreGWpH7aijXMiO30RjV xKHtfMfLlmvgCWsDyXU3XWoep8Rwu8xUFIW9ihbinsAPIFFFjdxBH0Ns5dAJjsOnWQm9 Gc1A== X-Gm-Message-State: AJIora/JDYR0o/fppdJObA1C9xdqaE5lv9IfbqaEgMoqkEUv7GHuknLU Z21XnRIkiwiKzsLRq4gTULhjj7zkyOKHYw== X-Google-Smtp-Source: AGRyM1vT7/+Go1isjJLZok9/BOrghqjkKYvg2x7nxPm1XLjm+DHdCk1/O6NToUjQ4RXhHpM8utHdDw== X-Received: by 2002:aa7:8883:0:b0:525:6b0a:b23d with SMTP id z3-20020aa78883000000b005256b0ab23dmr32074543pfe.82.1656880807388; Sun, 03 Jul 2022 13:40:07 -0700 (PDT) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com. [209.85.215.171]) by smtp.gmail.com with ESMTPSA id n2-20020a056a0007c200b0051c758a3957sm20004640pfu.149.2022.07.03.13.40.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Jul 2022 13:40:06 -0700 (PDT) Received: by mail-pg1-f171.google.com with SMTP id o18so6027273pgu.9 for ; Sun, 03 Jul 2022 13:40:06 -0700 (PDT) X-Received: by 2002:a63:371a:0:b0:40c:9a2e:7799 with SMTP id e26-20020a63371a000000b0040c9a2e7799mr23064746pga.113.1656880805528; Sun, 03 Jul 2022 13:40:05 -0700 (PDT) MIME-Version: 1.0 References: <20220703181525.6488-1-pal@sandflow.com> In-Reply-To: From: Pierre-Anthony Lemieux Date: Sun, 3 Jul 2022 13:39:52 -0700 X-Gmail-Original-Message-ID: Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH v1] avformat/imfdec: preserve stream information X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, Jul 3, 2022 at 12:15 PM Andreas Rheinhardt wrote: > > Pierre-Anthony Lemieux: > > On Sun, Jul 3, 2022 at 11:28 AM Andreas Rheinhardt > > wrote: > >> > >> pal@sandflow.com: > >>> From: Pierre-Anthony Lemieux > >>> > >>> As discussed at https://trac.ffmpeg.org/ticket/9818, the IMF demuxer does not > >>> currently preserve stream information such as language in the case of audio > >>> streams. This patch is modeled on copy_stream_props() at avformat/concatdec.c. > >>> > >>> --- > >>> libavformat/imfdec.c | 5 +++++ > >>> 1 file changed, 5 insertions(+) > >>> > >>> diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c > >>> index 71dfb26958..7aa66a06bf 100644 > >>> --- a/libavformat/imfdec.c > >>> +++ b/libavformat/imfdec.c > >>> @@ -580,11 +580,16 @@ static int set_context_streams_from_tracks(AVFormatContext *s) > >>> return AVERROR(ENOMEM); > >>> } > >>> asset_stream->id = i; > >>> + asset_stream->r_frame_rate = first_resource_stream->r_frame_rate; > >>> + asset_stream->avg_frame_rate = first_resource_stream->avg_frame_rate; > >>> + asset_stream->sample_aspect_ratio = first_resource_stream->sample_aspect_ratio; > >>> ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar); > >>> if (ret < 0) { > >>> av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n"); > >>> return ret; > >>> } > >>> + av_dict_copy(&asset_stream->metadata, first_resource_stream->metadata, 0); > >>> + ff_stream_side_data_copy(asset_stream, first_resource_stream); > >>> avpriv_set_pts_info(asset_stream, > >>> first_resource_stream->pts_wrap_bits, > >>> first_resource_stream->time_base.num, > >> > >> Seems to me like one should use ff_stream_encode_params_copy here. Of > >> course, it would have to be renamed and moved if used in a demuxer. > > > > Would copy_stream_props() in concatdec.c need to be refactored as well? > > > > I often wondered about this. The problem with copy_stream_props is that > it is not only called during read_header, but lateron as well, but e.g. > the documentation of AVStream.side_data says that it is populated when > the stream is created and not later. > This issue does of course not exist in your case. ff_stream_encode_params_copy() does not seem to set pts_wrap_bits, i.e. it does not call avpriv_set_pts_info(). > > > Note that, in the case of avformat/imfdec.c, AVStream::id is not > > copied across, so ff_stream_encode_params_copy() would need to be > > followed by asset_stream->id = i; > > > > Yeah, I know. > > - Andreas > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".