我正在尝试将一些aac文件转换为flac文件,因为我使用的另一个设备不支持aac。经过多次尝试寻找解决方案,在互联网上搜索,我终于读到,ffmpeg被avconv取代,avconv是ffmpeg的分叉。因此,我搜索了如何使用avconv转换为flac,并找到了以下行:
avconv -i (input file) -f flac (output file path)
但是,我在该命令中没有看到任何flac压缩级别,而且由于目标设备上的cpu资源,我需要有2或更低的压缩级别。我检查了手册页的avconv,但它似乎没有提到火焰压缩级别。
因此,我的问题是:当使用avconv从任何输入格式转换为flac时,如何指定flac压缩级别?
发布于 2014-11-09 22:48:46
有一个-compression_level
属性。手册页将其格式设置为
-compression_level[:stream_specifier] integer (output,audio,video)
您可能不需要指定流,因为文件中只有一个流,所以-compression_level 2
是您的朋友。
将来,您可能希望检查手册页中的工具。
man (name of program)
型例如,man avconv
。发布于 2016-04-17 10:18:33
该选项是-compression_level
,可以用avconv
或FFmpeg
设置:
ffmpeg -i input.wav -c:a flac -compression_level 12 output.flac
有趣的是,命令行flac编码器提供0-8的压缩级别,而FFmpeg / avconv提供0-12。这些文件可以在以下三个地方看到:
在flacenc.c
中可以看到flac压缩的选项:
/* set compression option defaults based on avctx->compression_level */
if (avctx->compression_level < 0) <-------------
s->options.compression_level = 5; <-------------
else
s->options.compression_level = avctx->compression_level;
level = s->options.compression_level;
if (level > 12) { <-------------
av_log(avctx, AV_LOG_ERROR, "invalid compression level: %d\n",
s->options.compression_level);
return AVERROR(EINVAL);
}
我已经在相关的章节中“射箭”了!
压缩选项也可以在man ffmpeg-all
(而不是man ffmpeg
:)中看到。该手册页显示:
compression_level
Sets the compression level, which chooses defaults for many other options
if they are not set explicitly. Valid values are from 0 to 12, 5 is the default.
FFmpeg现在可以使用多个手册页,这有点让人困惑!
正如“Miso”所指出的,还有一些文件可在网上查阅用于更深层次的flac编码选项,包括压缩选项:
compression_level
Sets the compression level, which chooses defaults for many
other options if they are not set explicitly. Valid values
are from 0 to 12, 5 is the default.
与手册页相同,但对一些人来说,查找和阅读可能要容易一些!
https://askubuntu.com/questions/544651
复制相似问题