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 ESMTPS id 134D44BFC0 for ; Wed, 5 Feb 2025 00:52:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 96F5168B47F; Wed, 5 Feb 2025 02:52:19 +0200 (EET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6C7368055D for ; Wed, 5 Feb 2025 02:52:12 +0200 (EET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-21c2f1b610dso147394125ad.0 for ; Tue, 04 Feb 2025 16:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738716730; x=1739321530; darn=ffmpeg.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=tQ+iQMYPGn1K5nzjoLDyY5pw8X/ECyp9E+DT55dj5Kg=; b=mCtnZytuuCP2Es6P1AFt0G4rDOPmesPzOopuTE3Hy0QkxZHdNPifo6n+dcPNC/9K3V 9Rrba8u/+/783aJmlx5u7MjVypU41e/gQ631HV6BDBNj/101WA1L8GdJ5IhcolA1CY72 WKeLi/jbSBKWH79XNE5dZdvrSi3FCRepXe4N/olTd+G8axNW2phtpzYhGKduBtOoigqa dloT78ytgHynNqfiLlbjPEp4nMLMXe1qOiNLN0hWV+zgS7C0b5e8Xc6VxzTSr0Ypk/Xt +Nl61M2ffWK/NeWAEPRamp0ZXxTm+nFPrvzixqtgKxRAp+ZmIDO/fglhCXjQtRWkLV28 Jx6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738716730; x=1739321530; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tQ+iQMYPGn1K5nzjoLDyY5pw8X/ECyp9E+DT55dj5Kg=; b=vueCVlwDOQIYnhV/puQ+NqZV28BJc96TFRCHGKIjNvsSaoCePw3MI/cECx9t66gOz+ ng2YB19kTSBvONkJaBmrlxuX32Gzy5CuGVB+5x3mZKNGRsnG2zwi34QwlUiCQrs9kFzg j9zFpkPv5mhE0NjlwNdazwMiACJK6aWm6M6fsn32XWKJmWokUO/2PPbh/7SQLqrP9GcM HtsyzKKCawBdiFZJJbdS7KcRIJ74xU3rA2yk4z54LTDdFT7IsEndISp5x2QRZI8Gnwg9 EZlVaNTSMm6ZvHoJ834PPbxhibYmkP3TBvPUepuVZv6zDUIQbFkfPJtgQOy7kbKEaFW2 bk/w== X-Gm-Message-State: AOJu0YxfYpdy9SRp7yf9BD3FnCvq0lGv7IDwkPz3TXVLG0R66376ztyM hUdoYlNzIgvRezPSKcpNwV0TMa5pGYX75nUmYps5nVg5QTsFCjp3leVVd1U8U+0= X-Gm-Gg: ASbGncsDb/Skr8QXERPOhmI5rl0aGVq7/hCH03dULx8wE+zE96LpCt/Y97Ru4qJl/A+ U6J25FWAOODyYUISi9teUxS7AevOfBFudvMJsKZx/O0q6+t/k/OHqLW6WgTv7YqY5RUkFPdOq1r 27Zz056nro/nRoEF4thM/YUhQSGNj1E95O9ErOr0Pqy/VI+IP7krMrEtszGzzXWSyMdZtWn28De rXBD88ZZqjCIGVujEj2PfZMFAqmbprZauOrMrmOu51V/OZ6kPnsPGUnNIFRqySaPne21DsnfUre AFtMnt+kzsI/P5K80KirYa/Nvg== X-Google-Smtp-Source: AGHT+IHxXM0zr+PCkZBpBSQjPchPWqMMlCbljMCdNEdSTw1da2/8OOsSpnIRsIlwVW0IkLY2r14J1A== X-Received: by 2002:a17:902:f708:b0:215:6e01:ad19 with SMTP id d9443c01a7336-21f17e29deamr14523415ad.29.1738716730672; Tue, 04 Feb 2025 16:52:10 -0800 (PST) Received: from smtpclient.apple ([62.192.175.76]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21f0b643720sm16145425ad.137.2025.02.04.16.52.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2025 16:52:10 -0800 (PST) From: Jack Lau Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Message-Id: <3BDA9A34-64A0-4DBC-A47E-BBDCBE33EED6@gmail.com> Date: Wed, 5 Feb 2025 08:51:56 +0800 To: ffmpeg-devel@ffmpeg.org X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] examples/transcoding: Fix time_base handling 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: multipart/mixed; boundary="===============0033152451365072476==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0033152451365072476== Content-Type: application/octet-stream; x-unix-mode=0644; name="fix-time-base-handling.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=fix-time-base-handling.patch =46rom=20bfd5500a5448ad468d32994816e8a55c0d4a2428=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Jack=20Lau=20=0ADate:=20= Tue,=204=20Feb=202025=2021:39:20=20+0800=0ASubject:=20[PATCH]=20= examples/transcoding:=20Fix=20time_base=20handling=0A=0AThe=20= `dec_ctx->time_base`=20was=20incorrectly=20default=20set=20to=200/60,=20= while=20`enc_ctx->time_base`=20was=20derived=20from=20= `dec_ctx->framerate`.=20This=20mismatch=20could=20cause=20incorrect=20= video=20duration=20in=20the=20output.=0A=0AThis=20patch=20aligns=20= `enc_ctx->time_base`=20with=20`dec_ctx->time_base`=20to=20prevent=20= rescaling=20issues=20and=20ensure=20correct=20video=20duration.=0A---=0A=20= doc/examples/transcoding.c=20|=204=20++--=0A=201=20file=20changed,=202=20= insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20= a/doc/examples/transcoding.c=20b/doc/examples/transcoding.c=0Aindex=20= 013f89fc7d..847bdb7e1a=20100644=0A---=20a/doc/examples/transcoding.c=0A= +++=20b/doc/examples/transcoding.c=0A@@=20-172,7=20+172,7=20@@=20static=20= int=20open_output_file(const=20char=20*filename)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20enc_ctx->pix_fmt=20=3D=20dec_ctx->pix_fmt;=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20video=20time_base=20= can=20be=20set=20to=20whatever=20is=20handy=20and=20supported=20by=20= encoder=20*/=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= enc_ctx->time_base=20=3D=20av_inv_q(dec_ctx->framerate);=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20enc_ctx->time_base=20=3D=20= dec_ctx->time_base;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=20else=20= {=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= enc_ctx->sample_rate=20=3D=20dec_ctx->sample_rate;=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20ret=20=3D=20= av_channel_layout_copy(&enc_ctx->ch_layout,=20&dec_ctx->ch_layout);=0A@@=20= -180,7=20+180,7=20@@=20static=20int=20open_output_file(const=20char=20= *filename)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20return=20ret;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20= take=20first=20format=20from=20list=20of=20supported=20formats=20*/=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20enc_ctx->sample_fmt=20=3D=20= encoder->sample_fmts[0];=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20enc_ctx->time_base=20=3D=20(AVRational){1,=20enc_ctx->sample_rate};=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20enc_ctx->time_base=20=3D=20= dec_ctx->time_base;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20if=20(ofmt_ctx->oformat->flags=20&=20= AVFMT_GLOBALHEADER)=0A--=20=0A2.45.2=0A=0A= --===============0033152451365072476== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============0033152451365072476==--