From patchwork Mon May 11 13:34:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Khayat X-Patchwork-Id: 19623 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 D84EE449E98 for ; Mon, 11 May 2020 16:34:55 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B846B687F48; Mon, 11 May 2020 16:34:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B5C1680B6C for ; Mon, 11 May 2020 16:34:49 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id z72so9675069wmc.2 for ; Mon, 11 May 2020 06:34:49 -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=lopPgkO3MtMU/AHWI5i9TsZvPtkOSZzcg/pofQ8k+Sc=; b=RnnGdOliycDA7I1d+aFtA92bM7wdJvk9Ab0+XGcASIlugZ5ZlUTCC1vqypp+3jAag4 nXRYkg11Bl83JKDVkPMG3cnydwE7Wzlssk4UkE+a0r53L6PebUOXqrXBWSjIQMM56Nvf sSZgrCgOvwdogPgCeaWWdfq8BLcampv1wbYaFWoK4hXSoWy9agYn3kEpQ6NdrB4AGn5z 6zVlBmZIbISMbr5su6eFWxi5+tXQY7AZrTnD8A6mIZ5cU9f0hg5ZNIcvfW9mcawK3XwQ WPlJ5koNA2RU6A/i04dOLpKhc1XsomCd0x+XIua4MHlTqam99qT2zp7yMJzk0fM2wX93 zQ3A== 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=lopPgkO3MtMU/AHWI5i9TsZvPtkOSZzcg/pofQ8k+Sc=; b=ijfnaSPH55YkiI9rTyFvPTE0V9lJMKOhJlsyarzPF8iUDon0OybKTAbgk1xl0LwxCz W3iZATMcGIVNv3kaRfq8rwE82YoAK6pZgWVBbN+HAfsGxT2IO48p8Pz6I/xG4atyfnh9 bxP6weybZ2daZ3Zt3922CJ6fCl9KTwi3Lrkk6PR86P+Y7UGnfw60cjviA+ETvEoK6Te9 p1OOeEmk2T+Lmyp8e+Cosdos+QBvAznbABdCJUNNcZm8Ed3FLEvIUDazjXK3cwDH6eAw d3EJ9DrDeWL9wzRzn7fl4G4n0Nky15Nbt9M+PsDuMzXr3XfdHKZPyN81rXG1gtHpgu/W vYKg== X-Gm-Message-State: AGi0PuarKaBOK5Q+/B0sEq+HpXKBb/sHWD5sALenUFkjyCPGeZjQbbua r7jbCJ2jHMxTREywEbCTzS2oDLinDI0= X-Google-Smtp-Source: APiQypKJaemINyubt4PaAvo3FFAHUSFWDeOHt+rzYNqachl+ryQykz4e73ZPRdhG8f7UMYCVP8nb7A== X-Received: by 2002:a1c:4d17:: with SMTP id o23mr109629wmh.87.1589204088615; Mon, 11 May 2020 06:34:48 -0700 (PDT) Received: from localhost.localdomain (145-50-190-109.dsl.ovh.fr. [109.190.50.145]) by smtp.gmail.com with ESMTPSA id b23sm24264771wmb.26.2020.05.11.06.34.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 06:34:48 -0700 (PDT) From: Guillaume Khayat To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 May 2020 15:34:45 +0200 Message-Id: <20200511133445.95631-1-guillaume.kh.alt@gmail.com> X-Mailer: git-send-email 2.24.2 (Apple Git-127) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] doc/encoders: ffaacenc does not output CBR 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: Guillaume Khayat Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The documentation and wiki imply the native AAC encoder can output CBR and VBR files : >b >Set bit rate in bits/s. Setting this automatically activates constant bit rate (CBR) mode. If this option is unspecified it is set to 128kbps. > >q >Set quality for variable bit rate (VBR) mode. This option is valid only using the ffmpeg command-line tool. For library interface users, use global_quality. Sources: - https://ffmpeg.org/ffmpeg-all.html#Options-7 - https://trac.ffmpeg.org/wiki/Encode/AAC#NativeFFmpegAACEncoder But testing the CBR mode gives out unexpected results 1. `ffmpeg -f lavfi -i sine=d=10 -c:a aac -b:a 128k out.m4a` => outputs a variable bit rate file, with an average bitrate of 85kbps file, and a max bitrate of 128kbps 2. `ffmpeg -i someMusicMp3File -c:a aac -b:a 128k out.m4a` => outputs a variable bit rate file, with an average bitrate of 122kbps file, and a max bitrate of 128kbps I think the advertised "CBR" mode is instead a “constrained VBR” mode, where the provided bitrate is used as a target and/or a maximum allowed bitrate. Signed-off-by: Guillaume Khayat --- doc/encoders.texi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index aa3a6eeb66..44ff5e469b 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -30,17 +30,19 @@ follows. Advanced Audio Coding (AAC) encoder. -This encoder is the default AAC encoder, natively implemented into FFmpeg. +This encoder is the default AAC encoder, natively implemented into FFmpeg. It +supports a constrained variable bit rate mode and a true variable bit (VBR) +rate mode. @subsection Options @table @option @item b -Set bit rate in bits/s. Setting this automatically activates constant bit rate -(CBR) mode. If this option is unspecified it is set to 128kbps. +Set maxmimum bit rate in bits/s. Setting this automatically activates constrained +variable bit rate mode. If this option is unspecified it is set to 128kbps. @item q -Set quality for variable bit rate (VBR) mode. This option is valid only using +Set quality for true variable bit rate (VBR) mode. This option is valid only using the @command{ffmpeg} command-line tool. For library interface users, use @option{global_quality}.