From patchwork Fri Mar 12 17:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donough Liu X-Patchwork-Id: 26360 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id EEE8E449451 for ; Fri, 12 Mar 2021 20:17:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BB7EA68B0DF; Fri, 12 Mar 2021 20:17:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 76BDC68A853 for ; Fri, 12 Mar 2021 20:17:08 +0200 (EET) Received: by mail-oi1-f179.google.com with SMTP id y131so24876380oia.8 for ; Fri, 12 Mar 2021 10:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e5usJ92Yd/t8UKDVpllygzzzdxi0gDSc4vsdRpGCDac=; b=KfmYR32tg6alIS576ell7U5tj6jdjYtpUM/w7LJkZuKn0gVziIAfFibs0OZ3in6WrO PGc5ekMvu1CK7w8rlsetMXPtA/HyrEwUtZlsSSgCh4o8REkr+bCFcLdnNFV1hOPnSfn7 niL1Il+o/NYC2qwZ453w56EaSguK/ajTw1csBTcK7U9hrLENPckD1j1wqp0UNdeS7vOF hNnvzkFO+OaaREYW/eGOhhwOjvTIQsdL5gspsmUDlQGyXjYp9R3MA9I8AZ4ybtURu7Jm cYjGZrgjo6IKn/loVh4N6yUKuiJyvYhfSnvpsc5vkT52pGcSX7E4yYuHZkYmudviBOZe TdAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e5usJ92Yd/t8UKDVpllygzzzdxi0gDSc4vsdRpGCDac=; b=EujHmiv+bBExa2ZoXDvH5ikckzAsLt+ASkr4necYVkRQjOqMCy6RJ23rh5LvlwXp1f iGqiHVpkBZrWSgzLvXMazi4BTdmymOaE2hbJYQOm6poaLMvEahvoJiGjUhxBG7ZeoS0R WqNWvYrtp1E7y2SmKecTHdY6Id5jLvey5rw4OBsgn2GIoYXoJrZkGHT37XKGOF/6R9zJ AQIe+GKzuWSRhV80PVvO+CDrS5/Av18w6RgCorxkvvqCz8LytiRwuru39RuTpSY/BJEB xImmfqm0h8wbn/ZHQnqYXvoG8nx/O0PWuXZbu629QZIiMuyvEGDQG24hlPq+3thy3owr K9AA== X-Gm-Message-State: AOAM533DqV2VDSdqdeVBc5lqoA6/dFwessxzcM6dnWUG2CAoxgc1fC8i JV9fsFT/Kl7Ss5mAearpNMgyVrmnDQ== X-Google-Smtp-Source: ABdhPJxC64P/u2Xf6T8tyDCOcE0TQMByqvu2J8EAHUUMYXWWOyjfaQhbbYYv1Rcr8+pcVQeRqdBqUg== X-Received: by 2002:a17:90a:2e0d:: with SMTP id q13mr15764123pjd.225.1615571242247; Fri, 12 Mar 2021 09:47:22 -0800 (PST) Received: from localhost.localdomain ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id a144sm6476842pfd.200.2021.03.12.09.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:47:21 -0800 (PST) From: Donough Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 12 Mar 2021 17:47:09 +0000 Message-Id: <20210312174709.406672-1-donoughliu@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Fix wrong time_base bug X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Donough Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Set time_base to inv of frame rate is only valid when input video have fixed frame rate. Signed-off-by: Donough Liu --- doc/examples/transcoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c index 5aff08c135..d6fed63421 100644 --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -170,7 +170,7 @@ static int open_output_file(const char *filename) else enc_ctx->pix_fmt = dec_ctx->pix_fmt; /* video time_base can be set to whatever is handy and supported by encoder */ - enc_ctx->time_base = av_inv_q(dec_ctx->framerate); + enc_ctx->time_base = dec_ctx->time_base; } else { enc_ctx->sample_rate = dec_ctx->sample_rate; enc_ctx->channel_layout = dec_ctx->channel_layout;