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 8038F4C62E for ; Tue, 30 Jul 2024 21:14:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7CEE668D663; Wed, 31 Jul 2024 00:14:55 +0300 (EEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 536BD68D47C for ; Wed, 31 Jul 2024 00:14:48 +0300 (EEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-70d1c655141so3616616b3a.1 for ; Tue, 30 Jul 2024 14:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722374086; x=1722978886; 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=fISOAK91ofxPVd/CNgFeYhLqGMtSLGZMiPP2xIGpkSQ=; b=Zb2mW+G5tR6Jpz2LP0KpTtPylQuRmM21vnVOQIYW0TckOi4ms76NMi9ea4VvRSpmYA w4FJIl+equyrBFpUfyc0zSsJTfYNZ5ANm8sCKJHLiznv+XGi9cB8WlpYERlM1iROFS49 d8NtUHlszO78LDIiiOrtpacAzAjHI2d44h9o7n/79CKbZxX0/oeBd6wdQsOKuTYU2S61 /UD1RFtqDOYMROK+LG/pgcS4sCvgLFXiiBat3rXH8zOHoFfaHeKNwg1tPRy3JrRBXSml XUKOm9mP2ndcJZOrSydBF1tHf+RneC5BEB9zK901zzWcHPUbFoWyjU5prrDXxmTr4Gwe rttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722374086; x=1722978886; 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=fISOAK91ofxPVd/CNgFeYhLqGMtSLGZMiPP2xIGpkSQ=; b=XPdx4p0BWmUutzdu+1owWH0k1ltXcB4GkiXXyGY4hqVuZJ7gfPwkWtWt4aYaXC1qac 63o4R7Al+vpY+EMmGmySwwZoW3Vwbz1aEhxN4odagQ9Rn2vp81pWmE2mWbOqNboQGLh1 E+B13K+bXW5MeC9PvPjAZPuENb7f64Rx2XM/D3c5RoG3XVLSTEnqkj/0p0RqLg3/rztY b97VlO7R6xdI3lKoXkUutp68K01OfgTUhewf1b4XWW4+3xVsVewehEqzNSFz/Twd5sGV sQQ8JTegCHH+bzow4HNOtnIqeDsugAr59ToCZzMwmR+To/EP4fcWhD4h2EscD8nP6rsD 6B/w== X-Gm-Message-State: AOJu0Yyhopwygi+TNYVeTVvp9yTHiCUhOoaPlGpcq+tWg64f/TOOVa6L t5yR33kfPJGzKuPOA8k63cXAPnzW8m31AG1GayqeZA0KUTfuC9YRpRNGAg== X-Google-Smtp-Source: AGHT+IGYIcfnV/d/7OVNxib02Apn5t8lmYgVpTfO5CKzfHWuelrmNmk/B6H3N/g1cdFUUrVcX0mkJA== X-Received: by 2002:a05:6a00:6f64:b0:706:6bdc:4de5 with SMTP id d2e1a72fcca58-70ecea1dd24mr9260381b3a.7.1722374085436; Tue, 30 Jul 2024 14:14:45 -0700 (PDT) Received: from [192.168.0.12] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70ead8a33b3sm8855436b3a.211.2024.07.30.14.14.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jul 2024 14:14:44 -0700 (PDT) Message-ID: Date: Tue, 30 Jul 2024 18:15:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240730131149.210571-1-gmascellani@codeweavers.com> <20240730205452.GP4991@pb2> Content-Language: en-US From: James Almer In-Reply-To: <20240730205452.GP4991@pb2> Subject: Re: [FFmpeg-devel] [PATCH 0/2] Interpret a degenerate SAR as 1/1. 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 7/30/2024 5:54 PM, Michael Niedermayer wrote: > On Tue, Jul 30, 2024 at 03:11:47PM +0200, Giovanni Mascellani wrote: >> I came across some H.264 files in the wild whose SAR is set to >> 20480/0. The files are provided by the Ubisoft game OddBallers, and >> are seemingly accepted and played properly when the game is played on >> Windows (thus using the Microsoft Media Foundations >> implementation). >> >> When running the game with Wine the files are ultimately decoded by >> libavcodec (via GStreamer), and playback is broken. It seems that only >> a frame each second or so (maybe the key frames? I didn't check) is >> decoded and presented, the others are discarded. After dumping the >> video, I ran it with ffplay and it has the same problem, and the >> following message is emitted many times: >> >> [h264 @ 0x7fd7301ef440] ignoring invalid SAR: 20480/1 >> >> Interestingly the invalid SAR is dumped as 20480/1 (which would be >> strange, but in princple legal), while the file has 20480/0 (which >> doesn't make sense at all). Equally interestingly, the frames that are >> presented are indeed presented with SAR 1/1, like they are on Windows. >> >> The H.264 standard says that "When aspect_ratio_idc is equal to 0 or >> sar_width is equal to 0 or sar_height is equal to 0, the sample aspect >> ratio shall be considered unspecified by this Recommendation | >> International Standard". Given the behavior on Windows it seems that >> the de facto standard way to solve the missing specification is to >> assume that SAR is 1/1, which is what my patches seek to do. > > Why does playback fail ? > > 1/1 and unspecified are different things, 0/0 would be unspecified afair we use 0/1 for unspecified, since it prevents division by 0 without having to worry about extra sanity checks. > where does 20480/0 turn into 20480/1 ? or did i misunderstand this? > > thx > > [...] > > > _______________________________________________ > 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".