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 1DE5D4C6F0 for ; Thu, 1 Aug 2024 12:34:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 517CA68D851; Thu, 1 Aug 2024 15:34:52 +0300 (EEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC42D68D661 for ; Thu, 1 Aug 2024 15:34:45 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1fd9e6189d5so55344095ad.3 for ; Thu, 01 Aug 2024 05:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722515683; x=1723120483; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=8UpXUwM1xvpV/L59AudjfLUr9CytuGaZhFJR+3+Bpxg=; b=a15772wIhgc43QiuL+HDhSsOBKuUcQQbHEek0yhy/2pp4xb7H5Ym0KrJvUXNh+2jy8 dCHbnGOCd0gxFJY+MvB8TiJNO+dRAw4GViIHUTNt9VIXlZqFZYa9wMRHY3/emWdt1r35 V2Gmc9qr5Rtkw2eRw1oUnbem8JtkOwpX5enNaC23AomRcz1CECJu9BKE+Y3mi7gsovtN wnxHq2we0UDHZDyQeAqOHZjoFdos8mFA8xZRaTmRVHyHYBnibCod6ZUK+2jF3womxJk+ 9y9luLcdtuDhZkuefv3FCcKsQGe7bhedNgbBBXTY7yfY7QO/Q1Hay4199a+/RM3grhIa Xqlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722515683; x=1723120483; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8UpXUwM1xvpV/L59AudjfLUr9CytuGaZhFJR+3+Bpxg=; b=DPm7iLYjn5MfR4wQEuQsXXnO4peHyKL75T0yz8paHyjDP9SUwf86HuvudT8JhGndVO vry28bdQ2JPz1x1unjgJLjbRQVIeKx+zFgHqKg8lZrGtlv+FgvO1iSn78fC5NpdspawK 9HoFqMc0RxxWbLRmquV4kJIznLDbI31ajmrwFQAOGD15tlXV7taXNYUMmOdDcoYafS9o zNC3qNEUJn0v3CXgLoUZKLJvf2ZszpjDKBU1uv4lEzkAW20G6/K4aWrMk8FibiNaowuS 7o2KQhG8pZVz1x2dxQ7D+gjln1lAb+X0kQ71XSr658a4kd3VAqIOLA/qAe69rNx8et2T pXZg== X-Gm-Message-State: AOJu0Yy3A87anciDjWgRpc9AupOtHuyqm5WYu7yfVUvT0DsRhBCxGMX6 lf61OhQU+dyaq4OUaiB3RQa4C3t2ru0wNYbwR7PIu6oeyK7PC25YPAXP2Q== X-Google-Smtp-Source: AGHT+IHiNlfO6OxjibiBEHHqc7ic5WamPA+Nth+eiE6O4xSmD6eeRvCfCYVeWW1WGGp107PcLjCbCg== X-Received: by 2002:a17:902:e741:b0:1fa:925b:5b77 with SMTP id d9443c01a7336-1ff4d2658demr25967685ad.64.1722515682505; Thu, 01 Aug 2024 05:34:42 -0700 (PDT) Received: from [192.168.0.12] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7cc4912sm141040075ad.69.2024.08.01.05.34.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Aug 2024 05:34:42 -0700 (PDT) Message-ID: Date: Thu, 1 Aug 2024 09:35:31 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240801021410.5061-1-jamrial@gmail.com> <172250274159.21344.614194252437021946@lain.khirnov.net> Content-Language: en-US From: James Almer In-Reply-To: <172250274159.21344.614194252437021946@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: ensure the IAMF track is the first 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 8/1/2024 5:59 AM, Anton Khirnov wrote: > Quoting James Almer (2024-08-01 04:14:09) >> Fixes crashes when muxing video tracks alongside IAMF ones. >> >> Signed-off-by: James Almer >> --- >> libavformat/movenc.c | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c >> index ae49582a1a..87ec368d52 100644 >> --- a/libavformat/movenc.c >> +++ b/libavformat/movenc.c >> @@ -7536,6 +7536,7 @@ static int mov_init_iamf_track(AVFormatContext *s) >> if (!track->iamf) >> return AVERROR(ENOMEM); >> >> + track->first_iamf_idx = INT_MAX; >> for (int i = 0; i < s->nb_stream_groups; i++) { >> const AVStreamGroup *stg = s->stream_groups[i]; >> switch(stg->type) { >> @@ -7558,6 +7559,11 @@ static int mov_init_iamf_track(AVFormatContext *s) >> return ret; >> } >> >> + if (track->first_iamf_idx != 0) { >> + av_log(s, AV_LOG_ERROR, "The IMAF track must be the first track\n"); > > Why? And is this documented anywhere? Just comments in the code. The reason i wrote it this way is because i parse the stream groups first, then the remaining streams, and generate the tracks in that order, as it was the simplest, least invasive way (The muxer handled streams and tracks as separate concepts with potentially different count for each of them even before iamf). I could look into changing it, but it may require some restructuring. In the meantime the muxer should not crash when you mix video tracks with iamf tracks. More so considering we need something easy to backport to 7.0. _______________________________________________ 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".