From patchwork Fri Nov 26 21:52:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John-Paul Stewart X-Patchwork-Id: 31756 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp2830815iob; Fri, 26 Nov 2021 13:52:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ7NLI6YsuQBYhbQ7kPnDHsL+WWQUsUtpq1qvzzoaNNRZOyfUCuRdKyAt+6+2oug8ERLBZ X-Received: by 2002:a05:6402:447:: with SMTP id p7mr50204318edw.261.1637963542024; Fri, 26 Nov 2021 13:52:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637963542; cv=none; d=google.com; s=arc-20160816; b=apo1yZvVL1APDkKoODCgjGiuGzlWPmbiet6xD96ZKquGSu8B3ec0RSpK0YWwpPmjm3 U3rnCZsyEjZJ3FBqEScKdkfh2ngNEKnuKsE43+PO4c/f783xMK5JnuV3Ryz0nDK0as/6 K3wxv+4hrIVQyNoFEc08BVv13yc0yg/rqJMDI/FyxzWu3vkmzdVsCQZgSGmoFXtyePoQ qpekG3iawtsMavnRJ6/BlgsYjDT/5QhQzH76Rl7F2bI+lKpKQw9tsksz9Ci9/zc4X6CE 4D/zzih0dJ9KoAjpAIIJ3IzA+iAiyudMlsStiDMOZKS88pgEC6lFx9ss63xb+dL2d4+n sd6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=wCImAby0MgcAQGPcopxGKk7RcfS2Z16CpZ3SPmTMBy8=; b=uIwUuHryX4tVU97lXoeZ6UnbVZjJIW/jUmec/vkw7tOBPM8I3TdeKsW9t8sPyGFniu StPBGgurjfbHmkDCK4AbPdywuq9vuesVjilDLup4A435LebC9cfnK0MNaxMxbRl+0d8t EealD1NMwv1choBkdzHljla+EW3pZok9WmnZSaiZ4V/FGyL5pTHe/kdoJqGtBduNfnyF yiOREBup21B2a57i7gQkpyxTG6U8QOSFdZjCaI/A87/QIylnDOThE+TFmIr4+ok2AR+F eEM3el3d2hv/8FphgHjy+jNZNouN4aKzK71RQ9h/HIJ/Sn2x2gn/76xtaM9o9iO3epDe pH1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@personalprojects.net header.s=20210601 header.b=MJVoqlLC; 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; dmarc=fail (p=QUARANTINE sp=REJECT dis=NONE) header.from=personalprojects.net Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w26si10820698edl.90.2021.11.26.13.52.21; Fri, 26 Nov 2021 13:52:22 -0800 (PST) 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=@personalprojects.net header.s=20210601 header.b=MJVoqlLC; 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; dmarc=fail (p=QUARANTINE sp=REJECT dis=NONE) header.from=personalprojects.net Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F41F68A636; Fri, 26 Nov 2021 23:52:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.personalprojects.net (mail.personalprojects.net [51.79.67.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E8F0F68008D for ; Fri, 26 Nov 2021 23:52:10 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=personalprojects.net; s=20210601; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:To:Subject:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yf9/b0hF5qqYVxDrUAlhRlzPsmC/3wqE4OO+ENKuB4Q=; b=MJVoqlLCbO4G/N/NBs7XOHT3X6 qnYkqyTDMcsceDilqlLkQJtqzaGfpXw2nIQXc2uGszhR04WgbeB3ibgO1LvKVHOUs2lcV6C+aaMl8 dMoAi9JK4uYHvRvvAlbAIzgb8StS942sU2Ckd15z2oGp2kBJYktzsRekb2pB5TPwp+8I=; Received: from bras-base-simcon3012w-grc-05-64-231-188-105.dsl.bell.ca ([64.231.188.105] helo=[192.168.10.2]) by mail.personalprojects.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mqj8b-0006lb-5w for ffmpeg-devel@ffmpeg.org; Fri, 26 Nov 2021 16:52:09 -0500 From: John-Paul Stewart To: ffmpeg-devel@ffmpeg.org Message-ID: <10e9aa9b-5e34-9895-ba2f-2a04caacebb5@personalprojects.net> Date: Fri, 26 Nov 2021 16:52:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-CA Subject: [FFmpeg-devel] [PATCH 0/2] 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: qmtyGjqhL4H5 Hi folks. Let me preface this by saying that I'm a first-time contributor, so please bear with me while I figure out proper procedures. (I've been reading the list for a while to try to familiarize myself with how things are done.) A recent project to convert some old videos in SGI .movie format revealed that libavformat is mis-reading some of the metadata about audio within those files. Specifically, the value the library was using for the number of audio channels is actually the sample size (in bytes) and the code was skipping over the actual number of audio channels. All of the existing examples at samples.ffmpeg.org/sgi are either 16 bit stereo or silent. There were no single channel examples and no 8 bit examples. I have created four clips with SGI's original 'moviemaker' utility (so they are guaranteed to be correctly formatted) to reverse engineer those two pieces of metadata since the format is largely undocumented. They are under 1MB each and available at: http://www.personalprojects.net/ffmpeg/mono8bit.movie http://www.personalprojects.net/ffmpeg/mono16bit.movie http://www.personalprojects.net/ffmpeg/stereo8bit.movie http://www.personalprojects.net/ffmpeg/stereo16bit.movie They'll only be available for a few weeks; I don't want to have to host them forever. There are also corresponding text files (change .movie to .txt in the URLs) with a bit of a description of what each one is and how it is mis-interpreted. There are three things in the patches that I need guidance on: 1) I added blank lines in a couple of places (before or after my changes) to separate the processing of different pieces of data from each other or from calls to avio_skip(). To me it is more readable that way, but I realize it may not be appropriate to add those blank lines. 2) In patch 2/2 (last changed line) the original code was dividing by channels * 2 which I changed to channels * bytes_per_sample on the assumption that the original "2" was due to all samples being treated as 2 bytes (16 bits). But I'm not really clear on that hard-coded "2" so I may be wrong. 3) Patch 1/2 adds a call to avio_skip() which is then removed in patch 2/2. This could be avoided by making it all one patch. I'm not sure whether it is better to fix the handling of the number of channels in one patch and add support for sample size in the second, or to do it all in one patch to avoid adding and removing that call to avio_skip(). If anyone has feedback on those (or any other part of the patch set), let me know.