首页 > 编程知识 正文

ffmpeg如何指定编码用哪个,ffmpeg音频采样率参数

时间:2023-05-03 15:47:17 阅读:250677 作者:4343

ffmpeg 比特率

If you are new to the process of converting audio files, then many of the details and how they work can be a bit confusing when you get unexpected results. So what do you do to fix the problem? Today’s SuperUser Q&A post has the answer to a confused reader’s question.

如果您不熟悉转换音频文件的过程,那么在获得意外结果时,许多细节及其工作方式可能会有些混乱。 那么,您如何解决该问题? 今天的“超级用户问答”帖子回答了一个困惑的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Photo courtesy of Warein (Flickr).

图片由Warein(Flickr)提供 。

问题 (The Question)

SuperUser reader Arlen Beiler wants to know why using different bitrate settings when converting an audio stream produced files that were all the same exact size:

超级用户阅读器Arlen Beiler想要知道为什么在转换音频流产生的文件时都使用完全相同的大小时为何使用不同的比特率设置:

I converted an audio stream into three different bitrate settings using what is essentially the same format. They ended up being exactly the same size. Why is this?

我使用基本相同的格式将音频流转换为三种不同的比特率设置。 他们最终是完全一样的大小。 为什么是这样?

ffmpeg -i “Likoonl-Q1-All.mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 192k “Q1-All-192k.mp4”

ffmpeg -i“ Likoonl-Q1-All.mp4” -c:v复制-c:a libmp3lame -q:a 1 -b:a 192k“ Q1-All-192k.mp4” ffmpeg -i “Likoonl-Q1-All.mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 160k “Q1-All-160k.mp4”

ffmpeg -i“ Likoonl-Q1-All.mp4” -c:v复制-c:a libmp3lame -q:a 1 -b:a 160k“ Q1-All-160k.mp4” ffmpeg -i “Likoonl-Q1-All.mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 128k “Q1-All-128k.mp4”

ffmpeg -i“ Likoonl-Q1-All.mp4” -c:v复制-c:a libmp3lame -q:a 1 -b:a 128k“ Q1-All-128k.mp4”

How did using different bitrate settings produce files of the same exact size?

使用不同的比特率设置如何产生相同大小的文件?

答案 (The Answer)

SuperUser contributor slhck has the answer for us:

超级用户贡献者slhck为我们提供了答案:

Because you are setting -q:a (which is LAME’s VBR setting). When you use -q:a, the CBR setting -b:a will have no effect. If you look into the MP3 encoding guide from the FFmpeg Wiki, you will find the possible values for -q:a with their corresponding average bitrate.

因为您正在设置-q:a (这是LAME的VBR设置)。 使用-q:a时 ,CBR设置-b:a将无效。 如果您从FFmpeg Wiki查看MP3编码指南,则会发现-q:a的可能值及其相应的平均比特率。

For the sake of completeness, here is the relevant part of libmp3lame.c (qscale is the long name of q):

为了完整起见,这是libmp3lame.c的相关部分( qscale是q的长名称):

Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程 。

翻译自: https://www.howtogeek.com/204340/why-are-my-mp3-files-the-same-size-even-when-i-change-the-bitrate-with-ffmpeg/

ffmpeg 比特率

怎么用JS实现图片懒加载

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。