From patchwork Tue May 5 14:45:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vectronic X-Patchwork-Id: 19510 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 6C456448588 for ; Tue, 5 May 2020 17:45:29 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3CD8668BF4C; Tue, 5 May 2020 17:45:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7676C68BB55 for ; Tue, 5 May 2020 17:45:22 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id k1so3089454wrx.4 for ; Tue, 05 May 2020 07:45:22 -0700 (PDT) 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=6naVR5JjUeaKb/LnZ0t6gAw7oHpxT7GKr49KDCJ9DBc=; b=NUPNifKRFjw5rYLXl07zHVjLO4I7F5d6DD6G9jYzVbDedKWW5kASuY1x9eQ91uLFhk OeHgfiUPmtHi298A5oUUSZbqhdaaAazBH7+lJlZiOKWZaYrlZITrfLHwqmq0vWrV4yGu mDAuk2C1Kgvy3oD+Rb42HYAfkpX2dNrWSKsPDQ7JF86fvcXNor91qZEoIQ34FbA/KGHk DdRRUSs+W5dSfk9vR+E1jlY3Ao1GtDegmQ/bBxsjoZY83S5KT/3flOEyno/JDBap561V w3nw+W2nvjInVtdPpaQNexyHn4KuWPwWkWIvgqMtevjuBmowot2P8minjsXhAJ1rEb9v 635w== 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=6naVR5JjUeaKb/LnZ0t6gAw7oHpxT7GKr49KDCJ9DBc=; b=bX1G08JfLmBuYSSLkJU3pzvWSH8UQdezsQnfxI3eTyDOvdGyeKfnO8rtlKR8b8I/nm aXi/9Kk7rpku5b7t0YEfXyf7SpLvbtz6vows6VvdOCuVJOptj2PK6+ZY9hdoIpgrgvAc YTmNiHfoUjzruVuLkvNEtZOhCtV7vvlyzQH3HvU+rnnGO5HlFRR8KjfcyFyyPr1qST7+ y6VzI4/NzL1OSZ7rSvx0Gu2wXJ6prxULwiuLftMmlqCd0bHSXdpL9cqlUUxHhn9lXeEe wqdGnX9lw9G2lXhXUjWJwCPS+lmItVnxe1pYuRRZpVtCgGfafNnpVlF7dlk7bziwBq7/ GxKQ== X-Gm-Message-State: AGi0PuZluqhkqmN33bIUmB84G4ZWbC/G0P9qTRE5FbaX3koFrTCO2RXr n1E8dxsfjMjJt4uOPmbGJNgUpjoR3bk= X-Google-Smtp-Source: APiQypLBG4dc3WbheWmc42XyfWWdBxYlmOtFu3xiLKAsXKLOwE2bXJyxWkI2x59ue7UdoGtxx53G7g== X-Received: by 2002:a5d:54c4:: with SMTP id x4mr4420061wrv.73.1588689921599; Tue, 05 May 2020 07:45:21 -0700 (PDT) Received: from mechagodzilla.chapatronic.net (cpc76904-dals22-2-0-cust471.20-2.cable.virginm.net. [81.106.45.216]) by smtp.gmail.com with ESMTPSA id h6sm4289016wmf.31.2020.05.05.07.45.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2020 07:45:20 -0700 (PDT) From: vectronic To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 May 2020 15:45:14 +0100 Message-Id: <20200505144516.6458-1-hello.vectronic@gmail.com> X-Mailer: git-send-email 2.24.2 (Apple Git-127) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 0/2] avformat movenc extend video_track_timescale flag to allow use of video stream timescale for track 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: vectronic Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Revised patch based on feedback. Instead of introducing a new flag, this extend the range of video_track_timescale down to -1 which indicates to use the video stream timescale for video the track. Still providing a debug message in default case if video timescale specified has been clamped to above 10000. The example scenario is where the input mov file has a video track timebase of e.g. 600. Currently, if the following is run, the output file has a modified video track timebase of 19200: ffmpeg -i in.mov -c:v copy out.mov With this patch, if you run: ffmpeg -loglevel debug -i in.mov -c:v copy out.mov you will see in the output: Stream timescale was low (600), the track timescale has been forced to 19200. And if you run the following, you will get an output file with the same video track timebase as the input e.g. 600: ffmpeg -i in.mov -c:v copy -video_track_timescale -1 out.mov The previous would be the same behaviour as the following, but it does not rely on the user knowing and specifying the input timebase: ffmpeg -i in.mov -c:v copy -video_track_timescale 600 out.mov vectronic (2): avformat movenc extend video_track_timescale flag range to allow use of video stream timescale for track avformat movenc extend video_track_timescale flag range to allow use of video stream timescale for track libavformat/movenc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)