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 1B7504232E for ; Sun, 10 Jul 2022 18:21:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0434668B8F4; Sun, 10 Jul 2022 21:21:05 +0300 (EEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AD6C68B468 for ; Sun, 10 Jul 2022 21:20:58 +0300 (EEST) Received: by mail-pf1-f180.google.com with SMTP id v7so1037297pfb.0 for ; Sun, 10 Jul 2022 11:20:58 -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=In+c91G9zmz/mtRrOynzwDTzPreQIb/DldqaKt1dYiQ=; b=RQsGqyjqsbqdw5CWDjKMVL3G6dANzoqQnCUuirp67gM8z/JtYH+JR9MqTK8fOp3caB sCoCTdRNn9SvvJ59QUqoW0xX7SqTj15mjJHcb/ocd2M88Uz+kJPTe6mvGRxlkUotGxMS /h8vRCZ5PiX7ValrOKgYYfuDoXNNz8YMVW+4CmEDgYocpRsLRpoNknt3XhylTJljgiLn qxv9vvDAfN9SZ/5gpjeLiZbVLWC/KqyMpfWgJcQZr31hkYBnKvXGjmJ/hZWUYNKna7N7 XQLGKTkQWSSiCtABJJNv1GkOPQLbU8rZ1NWjkw3fvItgpg5P078WIPyqpiGPrtNz7Ysv 2zlA== 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=In+c91G9zmz/mtRrOynzwDTzPreQIb/DldqaKt1dYiQ=; b=13k2cbQytIDccozoZFTlzg8p5aBnOd4oICE4sKlUvmfUdaQ9ru3nqZ8sJJs7P8wrib LkiDgQbSaO6aUkZ/RFP4lnPjW7V3U1zpgmUuOgTWO+FyqXy69SUhOsINa3DFzzVjTNGA ge7O/+xnQL7Mbldeh9crcM0Thk0X43MxdrsG1w44V2dYK8Dorj9Yzapd7M7scW4wk/T7 L8Ja5NHUizQIT4c2mVJx2M6ig0vj9Y6Q/S0O+xZmAMaQi8Wa6iduAV/v/bKPR5Q69jc8 kuqJgnTGbiouqLLN8UIwtWB12vdrOc8W5gCmRkQkPMQPCzjoAlPXuz9ZuKjYQ6P5ZQt3 eDGQ== X-Gm-Message-State: AJIora9hwQQhSSeVrHRqjv2zcBYCRytAhi9x0QbCaB5rXmlbav2MzGjx mFyW4vT/jsD9Vr6h7dPGFK3jITZArDFFAA== X-Google-Smtp-Source: AGRyM1u97ZMrYi7cCoAfmda0pMFt8FtpSzkPj72a9S8BEKgvumCnAaQ/YvwkPutOTfanDe3wUUwMOg== X-Received: by 2002:a63:210f:0:b0:40d:dd27:8361 with SMTP id h15-20020a63210f000000b0040ddd278361mr12678970pgh.306.1657477255922; Sun, 10 Jul 2022 11:20:55 -0700 (PDT) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com. [209.85.215.175]) by smtp.gmail.com with ESMTPSA id be4-20020a656e44000000b0040caab35e5bsm2741073pgb.89.2022.07.10.11.20.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jul 2022 11:20:55 -0700 (PDT) Received: by mail-pg1-f175.google.com with SMTP id 145so2990382pga.12 for ; Sun, 10 Jul 2022 11:20:54 -0700 (PDT) X-Received: by 2002:a63:5964:0:b0:411:4724:e618 with SMTP id j36-20020a635964000000b004114724e618mr12265349pgm.484.1657477252257; Sun, 10 Jul 2022 11:20:52 -0700 (PDT) MIME-Version: 1.0 References: <20220703181525.6488-1-pal@sandflow.com> In-Reply-To: From: Pierre-Anthony Lemieux Date: Sun, 10 Jul 2022 11:20:40 -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 2:13 PM Andreas Rheinhardt wrote: > > Pierre-Anthony Lemieux: > > 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(). > > > > The reason for this is that pts_wrap_bits is irrelevant for muxing. Do you have in mind: (a) a single av_stream_params_copy(), which copies all parameters (b) two separate functions av_stream_demux_params_copy() and av_stream_mux_params_copy(), which copies only relevant parameters? (c) something else? In the case of (b), should both be defined now, or only av_stream_demux_params_copy() be implemented now since avformat/imfdec would only use av_stream_demux_params_copy()? I have not seen anyone else chime in. > > >> > >>> 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". > > _______________________________________________ > 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".