Commit 83c7357f authored by Stefano Pettini's avatar Stefano Pettini
Browse files

Fixed transcoding to AAC format by switching to the latest 'aac' ffmpeg encoder

BUG: 374670
REVIEW: 130142
parent 4c8ba5e8
......@@ -27,43 +27,33 @@ 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.<br>The <b>AAC</b> encoder used by Amarok supports a <a href="
"http://en.wikipedia.org/wiki/Variable_bitrate#Advantages_and_disadvantages_of_VBR"
">variable bitrate (VBR)</a> 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.<br>"
"For this reason, the bitrate measure in this slider is just an estimate "
"of the <a href=http://www.ffmpeg.org/faq.html#SEC21>average bitrate</a> of "
"the encoded track.<br>"
"<b>150kb/s</b> is a good choice for music listening on a portable player.<br/>"
"Anything below <b>120kb/s</b> might be unsatisfactory for music and anything above "
"<b>200kb/s</b> is probably overkill." );
i18n( "The bitrate is a measure of the quantity of data used to represent a "
"second of the audio track.<br>"
"The encoder used by Amarok operates better with a constant bitrate.<br>"
"VBR is experimental and likely to get even worse results than the CBR.<br>"
"For this reason, the bitrate measure in this slider is a pretty accurate estimate "
"of the bitrate of the encoded track.<br>"
"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
......@@ -74,9 +64,7 @@ AacFormat::description() const
"<a href=http://en.wikipedia.org/wiki/Advanced_Audio_Coding>Advanced Audio "
"Coding</a> (AAC) is a patented lossy codec for digital audio.<br>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
......@@ -89,21 +77,16 @@ 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);
}
}
}
......@@ -113,5 +96,5 @@ AacFormat::ffmpegParameters( const Configuration &configuration ) const
bool
AacFormat::verifyAvailability( const QString &ffmpegOutput ) const
{
return ffmpegOutput.contains( QRegExp( "^ .EA....*libfaac" ) );
return ffmpegOutput.contains( QRegExp( "^ .EA... aac +" ) );
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment