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 965034BFB8 for ; Wed, 5 Feb 2025 00:47:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E4A9A68B792; Wed, 5 Feb 2025 02:47:20 +0200 (EET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 267BE68B453 for ; Wed, 5 Feb 2025 02:47:14 +0200 (EET) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2ee9a780de4so8218544a91.3 for ; Tue, 04 Feb 2025 16:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738716432; x=1739321232; darn=ffmpeg.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=ZsbYbJYIe60AY5c93blz0NLPSzdMoclWE5vGsDOleuo=; b=OQN4xpR44RKSm8URsC6sjC0yupfcMiac9WKHxYnA0aEb7hJWOL4k5DvcveoFxsUFCf rwizKHYTVud6m529yWzGkr016mYp7+VZopT7VC2c6m40PyHUWmpoMjQaWuBZ/iyKt6L6 TQCMN6+LLIz9LMzWpM5sXKpo0eu5+1z1WC3JL7wSmylJQ4o/w2LAYQtehWHvcml8U9BE RZ1K50C1geyvU6BY6fStbQOQTenxtoEmg8q94Ds1ybKencdI7mX3lJ66K4DA38fR5YLg sQJ7QvbFwwJy06ysI9YqCUUUASCzwxp3zT5t0pFhq7WhujrM6Ju9RTvSTwlZ1qTj/cA8 z7+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738716432; x=1739321232; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZsbYbJYIe60AY5c93blz0NLPSzdMoclWE5vGsDOleuo=; b=LjH+3eIxflyvArE7QfM162sySTNdQPVecncTXwpLt66r3QuFvb0A0fnFCj+AikBXjI z45o1i+JltFci1XIyz3F/GBZ8y8EtI2P0POEzcBaUHaBVrzoX7r+T+7urkNvDAZeg1Ak 9vBjhuO3lcBq8xS1hfWF+xBqmhoAGcN0S8Dl7Muvg9+krUXdlEfcRz6WWddVIlEcYvtJ RFZ9QiGGl7qn4FiM5yEhOh9Sq35860B7m5fqcfH0nYnx/3z+uizIhlOm9VROj/cqdEpF ZE1ES2C2sml2hSjd8tx6AN0GHb/5E74E1hBWOp2U4eKBUrlxTpGH6P5axTbl8DBqpICH WtDQ== X-Gm-Message-State: AOJu0Yw6w0Nykt8Ggkq6jc7dUzd1XGiU9lDO5O+XfwhqINoILcvSXGH6 aomUOSv5pBFiT0ySC065BnrWA8hWBgdfRH9Bevt/Obs+vE/YgapRzr+HJslK1oM= X-Gm-Gg: ASbGnct+CUF8CxO30/uJTAL9EYmjnnoLjPoY1h5fJxHPZYgfBzJsODgHUrMDgCi1A/l IXdivbn8DqZKSFAxqoGLtnKqT3hUffqELI7LQDl1pcsfD8g7L/058BzWZU1+SjZYnR+CW03bK6Z VFy22lhB31c/WsqfBwr8ntao2VVpNmwD3aL4u10iLsK327D263zUEHHR/BVqIadatdi7yqULbKx vEgG/OyBE3OfwRQ2UuLylIIVaC58i8zm0/1Bey9AJY6Z4Jjgjk98OidfwMv93W5+jaJhXKN9Ql9 fU0kZmjIuqtWWVVmwWT9lmzMv0E= X-Google-Smtp-Source: AGHT+IHnUp5WVAcr/UdhdGdPO6PK0B/0EtisPgu5GGGn0Zd+K6lMwX0K2RQuz3hja1l8wXX/81JidQ== X-Received: by 2002:a17:90b:3e8e:b0:2ee:e317:69ab with SMTP id 98e67ed59e1d1-2f9e069e353mr1683333a91.0.1738716431927; Tue, 04 Feb 2025 16:47:11 -0800 (PST) Received: from smtpclient.apple ([62.192.175.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21de3302e63sm102485595ad.172.2025.02.04.16.47.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2025 16:47:11 -0800 (PST) From: Jack Lau Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Message-Id: <16CE67FC-3852-41C2-8736-B60277BBF1E4@gmail.com> Date: Wed, 5 Feb 2025 08:46:58 +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] [PATCHv3] 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="===============2398889745403275654==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2398889745403275654== Content-Type: message/rfc822; x-unix-mode=0644; name="0001-examples-transcoding-Fix-time_base-handling.eml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-examples-transcoding-Fix-time_base-handling.eml =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=0AX-Unsent:=201=0ATo:=20= ffmpeg-devel@ffmpeg.org=0A=0AThe=20`dec_ctx->time_base`=20was=20= incorrectly=20default=20set=20to=200/60,=20while=20`enc_ctx->time_base`=20= was=20derived=20from=20`dec_ctx->framerate`.=20This=20mismatch=20could=20= cause=20incorrect=20video=20duration=20in=20the=20output.=0A=0AThis=20= patch=20aligns=20`enc_ctx->time_base`=20with=20`dec_ctx->time_base`=20to=20= prevent=20rescaling=20issues=20and=20ensure=20correct=20video=20= duration.=0A=0ASigned-off-by:=20JackLau1222=20<2366536135@qq.com>=0A---=0A= =20doc/examples/transcoding.c=20|=204=20++--=0A=201=20file=20changed,=20= 2=20insertions(+),=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= --===============2398889745403275654== 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". --===============2398889745403275654==--