diff --git a/src/core/transcoding/formats/TranscodingAacFormat.cpp b/src/core/transcoding/formats/TranscodingAacFormat.cpp index 7dcd4cf8dc..59af738cfd 100644 --- a/src/core/transcoding/formats/TranscodingAacFormat.cpp +++ b/src/core/transcoding/formats/TranscodingAacFormat.cpp @@ -1,117 +1,100 @@ /**************************************************************************************** * Copyright (c) 2010 Téo Mrnjavac * * * * This program is free software; you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free Software * * Foundation; either version 2 of the License, or (at your option) any later * * version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License along with * * this program. If not, see . * ****************************************************************************************/ #include "TranscodingAacFormat.h" #include #include using namespace Transcoding; AacFormat::AacFormat() { m_encoder = AAC; m_fileExtension = "m4a"; QString description1 = - i18n( "The bitrate is a measure of the quantity of data used to represent a second " - "of the audio track.
The AAC encoder used by Amarok supports a variable bitrate (VBR) setting, which means that the bitrate value " - "fluctuates along the track based on the complexity of the audio content. " - "More complex intervals of data are encoded with a higher bitrate than less " - "complex ones; this approach yields overall better quality and a smaller file " - "than having a constant bitrate throughout the track.
" - "For this reason, the bitrate measure in this slider is just an estimate " - "of the average bitrate of " - "the encoded track.
" - "150kb/s is a good choice for music listening on a portable player.
" - "Anything below 120kb/s might be unsatisfactory for music and anything above " - "200kb/s is probably overkill." ); + i18n( "The bitrate is a measure of the quantity of data used to represent a " + "second of the audio track.
" + "The encoder used by Amarok operates better with a constant bitrate.
" + "VBR is experimental and likely to get even worse results than the CBR.
" + "For this reason, the bitrate measure in this slider is a pretty accurate estimate " + "of the bitrate of the encoded track.
" + "The encoder is transparent at 128kbps for most samples tested with artifacts only appearing in extreme cases."); QStringList valueLabels; - QByteArray vbr = "VBR ~%1kb/s"; + QByteArray cbr = "CBR %1kb/s"; valueLabels - << i18n( vbr, 25 ) - << i18n( vbr, 50 ) - << i18n( vbr, 70 ) - << i18n( vbr, 90 ) - << i18n( vbr, 120 ) - << i18n( vbr, 150 ) - << i18n( vbr, 170 ) - << i18n( vbr, 180 ) - << i18n( vbr, 190 ) - << i18n( vbr, 200 ) - << i18n( vbr, 210 ); - m_propertyList << Property::Tradeoff( "quality", i18n( "Expected average bitrate for variable bitrate encoding" ), description1, + << i18n( cbr, 32 ) + << i18n( cbr, 64 ) + << i18n( cbr, 96 ) + << i18n( cbr, 128 ) + << i18n( cbr, 160 ) + << i18n( cbr, 192 ) + << i18n( cbr, 224 ) + << i18n( cbr, 256 ); + m_propertyList << Property::Tradeoff( "bitrate", i18n( "Bitrate target for constant bitrate encoding" ), description1, i18n( "Smaller file" ), i18n( "Better sound quality"), - valueLabels, 6 ); + valueLabels, 3 ); } QString AacFormat::prettyName() const { - return i18n( "AAC (Non-Free)" ); + return i18n( "AAC" ); } QString AacFormat::description() const { return i18nc( "Feel free to redirect the english Wikipedia link to a local version, if " "it exists.", "Advanced Audio " "Coding (AAC) is a patented lossy codec for digital audio.
AAC " "generally achieves better sound quality than MP3 at similar bit rates. " - "It is a reasonable choice for the iPod and some other portable music " - "players. Non-Free implementation." ); - + "It is a reasonable choice for the iPod and some other portable music players." ); } KIcon AacFormat::icon() const { return KIcon( "audio-ac3" ); //TODO: get a *real* icon! } QStringList AacFormat::ffmpegParameters( const Configuration &configuration ) const { QStringList parameters; - parameters << "-acodec" << "libfaac"; /* libfaac seems to be the only decent AAC encoder - for GNU/Linux and it's a proprietary freeware - with LGPL portions. Hopefully in the future - FFmpeg's native aac implementation should get - better so libfaac won't be necessary any more. - -- Teo 5/aug/2010 */ + parameters << "-acodec" << "aac" << "-strict" << "-2"; foreach( const Property &property, m_propertyList ) { if( !configuration.property( property.name() ).isNull() && configuration.property( property.name() ).type() == property.variantType() ) { - if( property.name() == "quality" ) + if( property.name() == "bitrate" ) { - parameters << "-aq" - << QString::number( configuration.property( "quality" ).toInt() * 25 + 5 ); + parameters << "-b:a" + << QString::number( ( configuration.property( "bitrate" ).toInt() + 1 ) * 32000); } } } return parameters; } bool AacFormat::verifyAvailability( const QString &ffmpegOutput ) const { - return ffmpegOutput.contains( QRegExp( "^ .EA....*libfaac" ) ); + return ffmpegOutput.contains( QRegExp( "^ .EA... aac +" ) ); }