使用编译mkfs.ext4命令命令时为什么提示volume id must be a hexadecimal

扫一扫体验手机阅读
4.文件系统——格式化分区(mkfs,mke2fs,tune2fs,blkid,e2label,bc )
<span type="1" blog_id="1438647" userid='
分享到朋友圈
关注作者,不错过每一篇精彩初探oVirt-使用小结FAQ
时间: 01:28:32
&&&& 阅读:1211
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&&&&&&&初探oVirt-使用小结FAQ time 18:52【Q1】:执行virsh命令时,会提示需要用户验证(Please&enter&your&authentication&name),看错误提示似乎和配置vdsm服务后,使用了SASL有关系,怎么解决?
A:使用工具“saslpasswd2&-&set&a&user’s&sasl&password”来创建用户。
问题发生时是这样的:
#&virsh&list
Please&enter&your&authentication&name:&
Please&enter&your&password:&
error:&Failed&to&reconnect&to&the&hypervisor
error:&no&valid&connection
error:&authentication&failed:&Failed&to&step&SASL&negotiation:&-1&(SASL(-1):&generic&failure:&All-whitespace&username.)
我们来创建一个用户:
#&saslpasswd2&-a&libvirt&mYusernAme&&&&
Password:&mYpasswOrd
Again&(for&verification):&mYpasswOrd
其中,-a&参数跟着&appname,这里我们需要指定的是libvirt服务
原因是:vdsm在加入ovirt时会使用sasl再次加密libvirt
再次测试:
#&virsh&list
Please&enter&your&authentication&name:&mYusernAme
Please&enter&your&password:&
&Id&&&&Name&&&&&&&&&&&&&&&&&&&&&&&&&&&State
----------------------------------------------------
&1&&&&&tvm-test-template&&&&&&&&&&&&&&running
&2&&&&&tvm-test-clone&&&&&&&&&&&&&&&&&running
&3&&&&&tvm-test-clone-from-snapshot&&&running
&4&&&&&testpool001&&&&&&&&&&&&&&&&&&&&running
&5&&&&&testpool007&&&&&&&&&&&&&&&&&&&&running
&6&&&&&testpool006&&&&&&&&&&&&&&&&&&&&running
符合预期。&
【Q2】:执行ovirt界面上的针对vm的重启操作,ovirt的web界面有提示状态的变更,,但vm的console看并未重启,这是怎么回事?
A:vm里面没有安装agent,在linux下面是:ovirt-guest-agent
安装&ovirt-guest-agent
在vm上先安装ovirt-release35.rpm这个yum源。
#&yum&-y&install&http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
#&yum&-y&install&ovirt-guest-agent
#&service&ovirt-guest-agent&start
#&chkconfig&ovirt-guest-agent&on
【Q3】:克隆VM时,磁盘等待很久还没准备就绪
A:状态:被克隆对象,附加了一个大容量磁盘(2T)。
检查所在host上运行的进程,找到qemu-img,检查是否卡死,手动结束。
【Q4】:cloud-init是怎么使用的?
A:cloud-init用来设置vm启动后的主机名,时区,验证,网络和自定义脚本。
1)在vm上安装cloud-init
#&yum&-y&install&cloud-init
检查开机启动
#&chkconfig&--list&|grep&cloud
关闭vm,选择菜单“只运行一次”-“初始运行”-“使用&cloud-init”,设置hostname等信息。
单击“确定”,vm开始启动,引导过程中将使用cloud-init这个服务来自动设置vm的基础信息。
看日志(/var/log/cloud-init-output.log&)显示:
Cloud-init&v.&0.7.5&running&‘init-local‘
结合之前在网络中找的文章中提及:
cloud-init&on&RHEV&searches&for&a&floppy&drive
containing&a&user-data.txt&file
http://people.redhat.com/mskinner/rhug/q3.2014/cloud-init.pdf
我的理解是:
1)通常我们创建vm时,会使用“只运行一次”,来启用引导选项,类似的,个人猜测也cloud-init功能也是在这个时候以类似软驱的形式注入到vm中(vm中的ovirt-guest-agent在启动时临时挂载的?),然后vm在启动过程中读取了user-data这类数据。
2)观察目录&/var/lib/cloud/instance
3)查看文件&datasource
#&cat&datasource&
DataSourceConfigDrive:&DataSourceConfigDrive&[local,ver=2][source=/dev/sr1]
#&ll&/dev/cd*
lrwxrwxrwx.&1&root&root&3&Sep&16&&2015&/dev/cdrom&-&&sr0
lrwxrwxrwx.&1&root&root&3&Sep&16&&2015&/dev/cdrom1&-&&sr1
由此可以判断,出现了一个新设备:cdrom1,我们挂载看一下里面的内容:
#&mount&/dev/sr1&/mnt
mount:&block&device&/dev/sr1&is&write-protected,&mounting&read-only
#&tree&/mnt/
└──&openstack
&&&&├──&content
&&&&│&&&└──&0000
&&&&└──&latest
&&&&&&&&├──&meta_data.json
&&&&&&&&└──&user_data
3&directories,&3&files
#&cat&/mnt/openstack/latest/user_data&
#cloud-config
ssh_pwauth:&true
timezone:&Asia/Shanghai
disable_root:&0
&&all:&‘&&&/var/log/cloud-init-output.log‘
user:&root
password:&yourpasswd
&&expire:&false
-&‘sed&-i&‘‘/^datasource_list:&/d‘‘&/etc/cloud/cloud.&echo&‘‘datasource_list:
&&["NoCloud",&"ConfigDrive"]‘‘&&&&/etc/cloud/cloud.cfg‘
#&cat&/mnt/openstack/latest/meta_data.json&
&&"launch_index"&:&"0",
&&"availability_zone"&:&"nova",
&&"network-interfaces"&:&"auto&eth0\niface&eth0&inet&static\n&&address&10.0.200.101\n&&netmask&255.255.255.0\n&&gateway&10.0.200.254\n&&dns-nameservers&10.0.200.253\nauto&eth1\niface&eth1&inet&static\n&&address&10.0.201.101\n&&netmask&255.255.255.0\n&&dns-nameservers&10.0.200.253\n",
&&"name"&:&"cloud-init",
&&"network_config"&:&{
&&&&"content_path"&:&"/content/0000",
&&&&"path"&:&"/etc/network/interfaces"
&&"hostname"&:&"cloud-init",
&&"uuid"&:&"72be0e3f-10a7-433e-b6b3-a9daded7948f",
&&"meta"&:&{
&&&&"essential"&:&"false",
&&&&"role"&:&"server",
&&&&"dsmode"&:&"local"
上述2个文件中,实例名,主机名,网络等信息,都是我们在ovirt的web界面中配置的内容。
结合&cloud-init&的&doc来看【No&cloud】这一段:
http://cloudinit.readthedocs.org/en/latest/topics/datasources.html#no-cloud
简单翻译下:
NoCloud&和&NoCloudNet&这类数据源,允许用户不需要运行网络服务(甚至不用激活网络)即可提供文件:&user-data&和&meta-data&给&实例(instance)
你可以通过vfat&or&iso9660文件系统提供文件:&meta-data&和&user-data&给一个本地&vm&在启动是使用。
【Q5】:使用glusterfs服务时,报错&“glusterfs:&failed&to&get&the&‘volume&file‘&from&server”
A:先检查gluster版本,保持一致。host启用gluster服务后安装的版本,根据ovirt的源来分析,可能是官网最新的版本。
默认ovirt在安装时,使用的是:ovirt-3.5-dependencies.repo,,当前会下载glusterfs/3.7
客户端手动安装官网的新版本:
#&wget&http://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/CentOS/epel-6/x86_64/glusterfs-3.7.4-2.el6.x86_64.rpm
#&wget&http://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/CentOS/epel-6/x86_64/glusterfs-libs-3.7.4-2.el6.x86_64.rpm
#&wget&http://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/CentOS/epel-6/x86_64/glusterfs-client-xlators-3.7.4-2.el6.x86_64.rpm
#&wget&http://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/CentOS/epel-6/x86_64/glusterfs-fuse-3.7.4-2.el6.x86_64.rpm
#&rpm&-ivh&*.rpm
【Q6】:不使用ovirt管理glusterfs,自己配置glusterfs,怎么做?数据域如何挂载,做了哪些优化工作?
首先,ovirt的优化做了如下工作:
优化后,配置将做如下调整:
Options&Reconfigured:
diagnostics.count-fop-hits:&on
diagnostics.latency-measurement:&on
storage.owner-gid:&36
storage.owner-uid:&36
cluster.server-quorum-type:&server
cluster.quorum-type:&auto
network.remote-dio:&enable
cluster.eager-lock:&enable
performance.stat-prefetch:&off
performance.io-cache:&off
performance.read-ahead:&off
performance.quick-read:&off
auth.allow:&*
user.cifs:&enable
nfs.disable:&off
performance.readdir-ahead:&on
其次,集群内每个主机需要能正常解析gluster的节点名称-&IP的映射(不仅是“新建域”时指定的那台主机需要配置hosts或者dns服务器的A记录)
再次,防火墙
示例为在ovirt中启用&gluster&服务后的防火墙配置:
#&rpc.statd
-A&INPUT&-p&tcp&--dport&111&-j&ACCEPT
-A&INPUT&-p&udp&--dport&111&-j&ACCEPT
#&glusterd
-A&INPUT&-p&tcp&-m&tcp&--dport&24007&-j&ACCEPT
#&gluster&swift
-A&INPUT&-p&tcp&-m&tcp&--dport&8080&&-j&ACCEPT
#&portmapper
-A&INPUT&-p&tcp&-m&tcp&--dport&38465&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&38466&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&38467&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&2049&&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&38469&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&39543&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&55863&-j&ACCEPT
#&nlockmgr
-A&INPUT&-p&tcp&-m&tcp&--dport&38468&-j&ACCEPT
-A&INPUT&-p&udp&-m&udp&--dport&963&&&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&965&&&-j&ACCEPT
#&Ports&for&gluster&volume&bricks&(default&100&ports)
-A&INPUT&-p&tcp&-m&tcp&--dport&&-j&ACCEPT
-A&INPUT&-p&tcp&-m&tcp&--dport&&-j&ACCEPT
【示例】配置存储域-glusterfs集群:node72,node73,node86(示例提供3副本作为数据域)
【数据盘分区】
如果分区所在设备已经挂载,要先卸载并删掉现有系统。
[&~]#&yum&install&lvm2&xfsprogs&-y&&&
[&~]#&pvcreate&/dev/sdb
[&~]#&vgcreate&vg0&/dev/sdb&
[&~]#&lvcreate&-l&100%FREE&-n&lv01&vg0
[&~]#&mkfs.xfs&-f&-i&size=512&/dev/vg0/lv01&
[&~]#&blkid&/dev/vg0/lv01
/dev/vg0/lv01:&UUID="58a-45ab-b6fdd68"&TYPE="xfs"&
[&~]#&mkdir&/data
[&~]#&cat&&&‘_EOF‘&&&/etc/fstab
UUID=58a-45ab-b6fdd68&/data&&&&&&&&&&&&&&&&&&&xfs&&&&&defaults&&&&&&&&0&0
[&~]#&mount&-a
[&~]#&df&-h&|grep&data
/dev/mapper/vg0-lv01&&16T&&&33M&&16T&&&1%&/data
【准备工作】
[&~]#&yum&install&glusterfs-server
[&~]#&service&glusterd&start
[&~]#&chkconfig&glusterd&on
调整防火墙:
-A&INPUT&-s&192.168.25.0/24&-j&ACCEPT
配置集群:
[&~]#&gluster&peer&probe&192.168.25.72
[&~]#&gluster&peer&probe&192.168.25.73
每台集群节点上建立目录
[&~]#&mkdir&/data/gv1/brick1&-p
【提供data域】
创建卷gv0作为主数据域:
[&~]#&gluster&volume&create&gv1&replica&3&transport&tcp&192.168.25.86:/data/gv1/brick1&192.168.25.72:/data/gv1/brick1&192.168.25.73:/data/gv1/brick1&
[&~]#&gluster&volume&start&gv1
【查看现状】
[&~]#&gluster&volume&info
Volume&Name:&gv1
Type:&Replicate
Volume&ID:&32b-4dd9-9429-6ecfdfa168a2
Status:&Started
Number&of&Bricks:&1&x&3&=&3
Transport-type:&tcp
Brick1:&192.168.25.86:/data/gv1/brick1
Brick2:&192.168.25.72:/data/gv1/brick1
Brick3:&192.168.25.73:/data/gv1/brick1
---配置卷,以gv1为例:
gluster&volume&set&gv1&diagnostics.count-fop-hits&on
gluster&volume&set&gv1&diagnostics.latency-measurement&on
gluster&volume&set&gv1&storage.owner-gid&36
gluster&volume&set&gv1&storage.owner-uid&36&
gluster&volume&set&gv1&cluster.server-quorum-type&server
gluster&volume&set&gv1&cluster.quorum-type&auto
gluster&volume&set&gv1&network.remote-dio&enable
gluster&volume&set&gv1&cluster.eager-lock&enable
gluster&volume&set&gv1&performance.stat-prefetch&off
gluster&volume&set&gv1&performance.io-cache&off
gluster&volume&set&gv1&performance.read-ahead&off
gluster&volume&set&gv1&performance.quick-read&off
gluster&volume&set&gv1&auth.allow&\*
gluster&volume&set&gv1&user.cifs&enable
gluster&volume&set&gv1&nfs.disable&off
在1台节点上挂载卷gv1测试
[&~]#&mount.glusterfs&192.168.25.86:/gv1&/mnt
[&~]#&df&-h&/mnt
Filesystem&&&&&&&&&&Size&&Used&Avail&Use%&Mounted&on
192.168.25.72:/gv1&&&16T&&&39M&&&16T&&&1%&/mnt
【Q7】:提示“执行动作&添加存储连接&时出错:&试图挂载目标时出现问题”
A:注意:填写“路径”时,注意末尾不要出现空格,否则会失败,通过查看挂载节点上/var/log/vdsm.log,可以分析原因,例如,日志显示:
Storage.StorageServer.MountConnection::(connect)&Mount&failed:&(32,&‘;mount.nfs:&access&denied&by&server&while&mounting&192.168.20.
93:/data/ovirt/iso&\n‘)
路径:192.168.20.93:/data/ovirt/iso&[iso后边跟着一个空格]
路径:192.168.20.93:/data/ovirt/iso[iso后边没空格]
假设已经挂载完毕ISO,我们需要增加OS进来,这里有个小技巧:
查看iso所在的NFS服务器(192.168.20.93)的路径
/data/ovirt/iso/62a1b5e0-730f-47db-fda7b83a/images/1-
我们可以直接cd到这个目录下,将OS文件上传到这里,修改权限
#&chown&-R&36:36&.&
回到web端,查看iso域的映像即可。标签:&&&&&&&&&&&&原文地址:http://nosmoking.blog.51cto.com/8911
&&国之画&&&& &&&&chrome插件&&
版权所有 京ICP备号-2
迷上了代码!This document describes filters, sources, and sinks provided by the
libavfilter library.
Filtering in FFmpeg is enabled through the libavfilter library.
In libavfilter, a filter can have multiple inputs and multiple
To illustrate the sorts of things that are possible, we consider the
following filtergraph.
input --& split ---------------------& overlay --& output
+-----& crop --& vflip -------+
This filtergraph splits the input stream in two streams, then sends one
stream through the crop filter and the vflip filter, before merging it
back with the other stream by overlaying it on top. You can use the
following command to achieve this:
ffmpeg -i INPUT -vf &split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2& OUTPUT
The result will be that the top half of the video is mirrored
onto the bottom half of the output video.
Filters in the same linear chain are separated by commas, and distinct
linear chains of filters are separated by semicolons. In our example,
crop,vflip are in one linear chain, split and
overlay are separately in another. The points where the linear
chains join are labelled by names enclosed in square brackets. In the
example, the split filter generates two outputs that are associated to
the labels [main] and [tmp].
The stream sent to the second output of split, labelled as
[tmp], is processed through the crop filter, which crops
away the lower half part of the video, and then vertically flipped. The
overlay filter takes in input the first unchanged output of the
split filter (which was labelled as [main]), and overlay on its
lower half the output generated by the crop,vflip filterchain.
Some filters take in input a list of parameters: they are specified
after the filter name and an equal sign, and are separated from each other
by a colon.
There exist so-called source filters that do not have an
audio/video input, and sink filters that will not have audio/video
The graph2dot program included in the FFmpeg tools
directory can be used to parse a filtergraph description and issue a
corresponding textual representation in the dot language.
Invoke the command:
graph2dot -h
to see how to use graph2dot.
You can then pass the dot description to the dot program (from
the graphviz suite of programs) and obtain a graphical representation
of the filtergraph.
For example the sequence of commands:
echo GRAPH_DESCRIPTION | \
tools/graph2dot -o graph.tmp && \
dot -Tpng graph.tmp -o graph.png && \
display graph.png
can be used to create and display an image representing the graph
described by the GRAPH_DESCRIPTION string. Note that this string must be
a complete self-contained graph, with its inputs and outputs explicitly defined.
For example if your command line is of the form:
ffmpeg -i infile -vf scale=640:360 outfile
your GRAPH_DESCRIPTION string will need to be of the form:
nullsrc,scale=640:360,nullsink
you may also need to set the nullsrc parameters and add a format
filter in order to simulate a specific input file.
A filtergraph is a directed graph of connected filters. It can contain
cycles, and there can be multiple links between a pair of
filters. Each link has one input pad on one side connecting it to one
filter from which it takes its input, and one output pad on the other
side connecting it to one filter accepting its output.
Each filter in a filtergraph is an instance of a filter class
registered in the application, which defines the features and the
number of input and output pads of the filter.
A filter with no input pads is called a &source&, and a filter with no
output pads is called a &sink&.
A filtergraph has a textual representation, which is recognized by the
-filter/-vf/-af and
-filter_complex options in ffmpeg and
-vf/-af in ffplay, and by the
avfilter_graph_parse_ptr() function defined in
libavfilter/avfilter.h.
A filterchain consists of a sequence of connected filters, each one
connected to the previous one in the sequence. A filterchain is
represented by a list of &,&-separated filter descriptions.
A filtergraph consists of a sequence of filterchains. A sequence of
filterchains is represented by a list of &;&-separated filterchain
descriptions.
A filter is represented by a string of the form:
[in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M]
filter_name is the name of the filter class of which the
described filter is an instance of, and has to be the name of one of
the filter classes registered in the program optionally followed by &@id&.
The name of the filter class is optionally followed by a string
&=arguments&.
arguments is a string which contains the parameters used to
initialize the filter instance. It may have one of two forms:
A &:&-separated list of key=value pairs.
A &:&-separated list of value. In this case, the keys are assumed to be
the option names in the order they are declared. E.g. the fade filter
declares three options in this order & type, start_frame and
nb_frames. Then the parameter list in:0:30 means that the value
in is assigned to the option type, 0 to
start_frame and 30 to nb_frames.
A &:&-separated list of mixed direct value and long key=value
pairs. The direct value must precede the key=value pairs, and
follow the same constraints order of the previous point. The following
key=value pairs can be set in any preferred order.
If the option value itself is a list of items (e.g. the format filter
takes a list of pixel formats), the items in the list are usually separated by
The list of arguments can be quoted using the character &'& as initial
and ending mark, and the character &\& for escaping the characters
wi otherwise the argument string is considered
terminated when the next special character (belonging to the set
&[]=;,&) is encountered.
The name and arguments of the filter are optionally preceded and
followed by a list of link labels.
A link label allows one to name a link and associate it to a filter output
or input pad. The preceding labels in_link_1
... in_link_N, are associated to the filter input pads,
the following labels out_link_1 ... out_link_M, are
associated to the output pads.
When two link labels with the same name are found in the
filtergraph, a link between the corresponding input and output pad is
If an output pad is not labelled, it is linked by default to the first
unlabelled input pad of the next filter in the filterchain.
For example in the filterchain
nullsrc, split[L1], [L2]overlay, nullsink
the split filter instance has two output pads, and the overlay filter
instance two input pads. The first output pad of split is labelled
&L1&, the first input pad of overlay is labelled &L2&, and the second
output pad of split is linked to the second input pad of overlay,
which are both unlabelled.
In a filter description, if the input label of the first filter is not
specified, &in& if the output label of the last filter is not
specified, &out& is assumed.
In a complete filterchain all the unlabelled filter input and output
pads must be connected. A filtergraph is considered valid if all the
filter input and output pads of all the filterchains are connected.
Libavfilter will automatically insert
filters where format
conversion is required. It is possible to specify swscale flags
for those automatically inserted scalers by prepending
sws_flags=flags;
to the filtergraph description.
Here is a BNF description of the filtergraph syntax:
::= sequence of alphanumeric characters and '_'
FILTER_NAME
::= NAME[&@&NAME]
::= &[& NAME &]&
LINKLABELS
::= LINKLABEL [LINKLABELS]
FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
::= [LINKLABELS] FILTER_NAME [&=& FILTER_ARGUMENTS] [LINKLABELS]
FILTERCHAIN
::= FILTER [,FILTERCHAIN]
FILTERGRAPH
::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]
Filtergraph description composition entails several levels of
escaping. See
information about the employed escaping procedure.
A first level escaping affects the content of each filter option
value, which may contain the special character : used to
separate values, or one of the escaping characters \'.
A second level escaping affects the whole filter description, which
may contain the escaping characters \' or the special
characters [],; used by the filtergraph description.
Finally, when you specify a filtergraph on a shell commandline, you
need to perform a third level escaping for the shell special
characters contained within it.
For example, consider the following string to be embedded in
filter description text value:
this is a 'string': may contain one, or more, special characters
This string contains the ' special escaping character, and the
: special character, so it needs to be escaped in this way:
text=this is a \'string\'\: may contain one, or more, special characters
A second level of escaping is required when embedding the filter
description in a filtergraph description, in order to escape all the
filtergraph special characters. Thus the example above becomes:
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
(note that in addition to the \' escaping special characters,
also , needs to be escaped).
Finally an additional level of escaping is needed when writing the
filtergraph description in a shell command, which depends on the
escaping rules of the adopted shell. For example, assuming that
\ is special and needs to be escaped with another \, the
previous string will finally result in:
-vf &drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&
Some filters support a generic enable option. For the filters
supporting timeline editing, this option can be set to an expression which is
evaluated before sending a frame to the filter. If the evaluation is non-zero,
the filter will be enabled, otherwise the frame will be sent unchanged to the
next filter in the filtergraph.
The expression accepts the following values:
timestamp expressed in seconds, NAN if the input timestamp is unknown
sequential number of the input frame, starting from 0
the position in the file of the input frame, NAN if unknown
width and height of the input frame if video
Additionally, these filters support an enable command that can be used
to re-define the expression.
Like any other filtering option, the enable option follows the same
For example, to enable a blur filter () from 10 seconds to 3
minutes, and a
filter starting at 3 seconds:
smartblur = enable='between(t,10,3*60)',
= enable='gte(t,3)' : preset=cross_process
See ffmpeg -filters to view which filters have timeline support.
Some filters with several inputs support a common set of options.
These options can only be set by name, not with the short notation.
eof_action
The action to take when EOF is encountered on it accepts
one of the following values:
Repeat the last frame (the default).
End both streams.
Pass the main input through.
If set to 1, force the output to terminate when the shortest input
terminates. Default value is 0.
repeatlast
If set to 1, force the filter to extend the last frame of secondary streams
until the end of the primary stream. A value of 0 disables this behavior.
Default value is 1.
When you configure your FFmpeg build, you can disable any of the
existing filters using --disable-filters.
The configure output will show the audio filters included in your
Below is a description of the currently available audio filters.
A compressor is mainly used to reduce the dynamic range of a signal.
Especially modern music is mostly compressed at a high ratio to
improve the overall loudness. It&s done to get the highest attention
of a listener, &fatten& the sound and bring more &power& to the track.
If a signal is compressed too much it may sound dull or &dead&
afterwards or it may start to &pump& (which could be a powerful effect
but can also destroy a track completely).
The right compression is the key to reach a professional sound and is
the high art of mixing and mastering. Because of its complex settings
it may take a long time to get the right feeling for this kind of effect.
Compression is done by detecting the volume above a chosen level
threshold and dividing it by the factor set with ratio.
So if you set the threshold to -12dB and your signal reaches -6dB a ratio
of 2:1 will result in a signal at -9dB. Because an exact manipulation of
the signal would cause distortion of the waveform the reduction can be
levelled over the time. This is done by setting &Attack& and &Release&.
attack determines how long the signal has to rise above the threshold
before any reduction will occur and release sets the time the signal
has to fall below the threshold to reduce the reduction again. Shorter signals
than the chosen attack time will be left untouched.
The overall reduction of the signal can be made up afterwards with the
makeup setting. So compressing the peaks of a signal about 6dB and
raising the makeup to this level results in a signal twice as loud than the
source. To gain a softer entry in the compression the knee flattens the
hard edge at the threshold in the range of the chosen decibels.
The filter accepts the following options:
Set input gain. Default is 1. Range is between 0.015625 and 64.
If a signal of stream rises above this level it will affect the gain
reduction.
By default it is 0.125. Range is between 0. and 1.
Set a ratio by which the signal is reduced. 1:2 means that if the level
rose 4dB above the threshold, it will be only 2dB above after the reduction.
Default is 2. Range is between 1 and 20.
Amount of milliseconds the signal has to rise above the threshold before gain
reduction starts. Default is 20. Range is between 0.01 and 2000.
Amount of milliseconds the signal has to fall below the threshold before
reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
Set the amount by how much signal will be amplified after processing.
Default is 1. Range is from 1 to 64.
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.82843. Range is between 1 and 8.
Choose if the average level between all channels of input stream
or the louder(maximum) channel of input stream affects the
reduction. Default is average.
Should the exact signal be taken in case of peak or an RMS one in case
of rms. Default is rms which is mostly smoother.
How much to use compressed signal in output. Default is 1.
Range is between 0 and 1.
Simple audio dynamic range commpression/expansion filter.
The filter accepts the following options:
Set contrast. Default is 33. Allowed range is between 0 and 100.
Copy the input audio source unchanged to the output. This is mainly useful for
testing purposes.
Apply cross fade from one input audio stream to another input audio stream.
The cross fade is applied for specified duration near the end of first stream.
The filter accepts the following options:
nb_samples, ns
Specify the number of samples for which the cross fade effect has to last.
At the end of the cross fade effect the first input audio will be completely
silent. Default is 44100.
duration, d
Specify the duration of the cross fade effect. See
for the accepted syntax.
By default the duration is determined by nb_samples.
If set this option is used instead of nb_samples.
overlap, o
Should first stream end overlap with second stream start. Default is enabled.
Set curve for cross fade transition for first stream.
Set curve for cross fade transition for second stream.
For description of available curve types see
filter description.
Cross fade from one input to another:
ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
Cross fade from one input to another but without overlapping:
ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
Reduce audio bit resolution.
This filter is bit crusher with enhanced functionality. A bit crusher
is used to audibly reduce number of bits an audio signal is sampled
with. This doesn&t change the bit depth at all, it just produces the
effect. Material reduced in bit depth sounds more harsh and &digital&.
This filter is able to even round to continuous values instead of discrete
bit depths.
Additionally it has a D/C offset which results in different crushing of
the lower and the upper half of the signal.
An Anti-Aliasing setting is able to produce &softer& crushing sounds.
Another feature of this filter is the logarithmic mode.
This setting switches from linear distances between bits to logarithmic ones.
The result is a much more &natural& sounding crusher which doesn&t gate low
signals for example. The human ear has a logarithmic perception,
so this kind of crushing is much more pleasant.
Logarithmic crushing is also able to get anti-aliased.
The filter accepts the following options:
Set level in.
Set level out.
Set bit reduction.
Set mixing amount.
Can be linear: lin or logarithmic: log.
Set anti-aliasing.
Set sample reduction.
Enable LFO. By default disabled.
Set LFO range.
Set LFO rate.
Delay one or more audio channels.
Samples in delayed channel are filled with silence.
The filter accepts the following option:
Set list of delays in milliseconds for each channel separated by &|&.
Unused delays will be silently ignored. If number of given delays is
smaller than number of channels all remaining channels will not be delayed.
If you want to delay exact number of samples, append &S& to number.
Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
the second channel (and any other channels that may be present) unchanged.
Delay second channel by 500 samples, the third channel by 700 samples and leave
the first channel (and any other channels that may be present) unchanged.
adelay=0|500S|700S
Apply echoing to the input audio.
Echoes are reflected sound and can occur naturally amongst mountains
(and sometimes large buildings) when digital echo
effects emulate this behaviour and are often used to help fill out the
sound of a single instrument or vocal. The time difference between the
original signal and the reflection is the delay, and the
loudness of the reflected signal is the decay.
Multiple echoes can have different delays and decays.
A description of the accepted parameters follows.
Set input gain of reflected signal. Default is 0.6.
Set output gain of reflected signal. Default is 0.3.
Set list of time intervals in milliseconds between original signal and reflections
separated by &|&. Allowed range for each delay is (0 - 90000.0].
Default is 1000.
Set list of loudness of reflected signals separated by &|&.
Allowed range for each decay is (0 - 1.0].
Default is 0.5.
Make it sound as if there are twice as many instruments as are actually playing:
aecho=0.8:0.88:60:0.4
If delay is very short, then it sound like a (metallic) robot playing music:
aecho=0.8:0.88:6:0.4
A longer delay will sound like an open air concert in the mountains:
aecho=0.8:0.9:
Same as above but with one more mountain:
aecho=0.8:0.9:.3|0.25
Audio emphasis filter creates or restores material directly taken from LPs or
emphased CDs with different filter curves. E.g. to store music on vinyl the
signal has to be altered by a filter first to even out the disadvantages of
this recording medium.
Once the material is played back the inverse filter has to be applied to
restore the distortion of the frequency response.
The filter accepts the following options:
Set input gain.
Set output gain.
Set filter mode. For restoring material use reproduction mode, otherwise
use production mode. Default is reproduction mode.
Set filter type. Selects medium. Can be one of the following:
select Columbia.
select EMI.
select BSI (78RPM).
select RIAA.
select Compact Disc (CD).
select 50us (FM).
select 75us (FM).
select 50us (FM-KF).
select 75us (FM-KF).
Modify an audio signal according to the specified expressions.
This filter accepts one or more expressions (one for each channel),
which are evaluated and used to modify a corresponding audio signal.
It accepts the following parameters:
Set the &|&-separated expressions list for each separate channel. If
the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining
output channels.
channel_layout, c
Set output channel layout. If not specified, the channel layout is
specified by the number of expressions. If set to &same&, it will
use by default the same input channel layout.
Each expression in exprs can contain the following constants and functions:
channel number of the current expression
number of the evaluated sample, starting from 0
sample rate
time of the evaluated sample expressed in seconds
nb_in_channels
nb_out_channels
input and output number of channels
the value of input channel with number CH
Note: this filter is slow. For faster processing you should use a
dedicated filter.
Half volume:
aeval=val(ch)/2:c=same
Invert phase of the second channel:
aeval=val(0)|-val(1)
Apply fade-in/out effect to input audio.
A description of the accepted parameters follows.
Specify the effect type, can be either in for fade-in, or
out for a fade-out effect. Default is in.
start_sample, ss
Specify the number of the start sample for starting to apply the fade
effect. Default is 0.
nb_samples, ns
Specify the number of samples for which the fade effect has to last. At
the end of the fade-in effect the output audio will have the same
volume as the input audio, at the end of the fade-out transition
the output audio will be silence. Default is 44100.
start_time, st
Specify the start time of the fade effect. Default is 0.
The value must be specifie see
for the accepted syntax.
If set this option is used instead of start_sample.
duration, d
Specify the duration of the fade effect. See
for the accepted syntax.
At the end of the fade-in effect the output audio will have the same
volume as the input audio, at the end of the fade-out transition
the output audio will be silence.
By default the duration is determined by nb_samples.
If set this option is used instead of nb_samples.
Set curve for fade transition.
It accepts the following values:
select triangular, linear slope (default)
select quarter of sine wave
select half of sine wave
select exponential sine wave
select logarithmic
select inverted parabola
select quadratic
select cubic
select square root
select cubic root
select parabola
select exponential
select inverted quarter of sine wave
select inverted half of sine wave
select double-exponential seat
select double-exponential sigmoid
Fade in first 15 seconds of audio:
afade=t=in:ss=0:d=15
Fade out last 25 seconds of a 900 seconds audio:
afade=t=out:st=875:d=25
Apply arbitrary expressions to samples in frequency domain.
Set frequency domain real expression for each separate channel separated
by &|&. Default is &1&.
If the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining
output channels.
Set frequency domain imaginary expression for each separate channel
separated by &|&. If not set, real option is used.
Each expression in real and imag can contain the following
constants:
sample rate
current frequency bin number
number of available bins
channel number of the current expression
number of channels
current frame pts
Set window size.
It accepts the following values:
Default is w4096
Set window function. Default is hann.
Set window overlap. If set to 1, the recommended overlap for selected
window function will be picked. Default is 0.75.
Leave almost only low frequencies in audio:
afftfilt=&1-clip((b/nb)*b,0,1)&
Apply an arbitrary Frequency Impulse Response filter.
This filter is designed for applying long FIR filters,
up to 30 seconds long.
It can be used as component for digital crossover filters,
room equalization, cross talk cancellation, wavefield synthesis,
auralization, ambiophonics and ambisonics.
This filter uses second stream as FIR coefficients.
If second stream holds single channel, it will be used
for all input channels in first stream, otherwise
number of channels in second stream must be same as
number of channels in first stream.
It accepts the following parameters:
Set dry gain. This sets input gain.
Set wet gain. This sets final output gain.
Set Impulse Response filter length. Default is 1, which means whole IR is processed.
Enable applying gain measured from power of IR.
Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
Allowed range is 0.1 to 60 seconds.
Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
Set output format constraints for the input audio. The framework will
negotiate the most appropriate format to minimize conversions.
It accepts the following parameters:
sample_fmts
A &|&-separated list of requested sample formats.
sample_rates
A &|&-separated list of requested sample rates.
channel_layouts
A &|&-separated list of requested channel layouts.
for the required syntax.
If a parameter is omitted, all values are allowed.
Force the output to either unsigned 8-bit or signed 16-bit stereo
aformat=sample_fmts=u8|s16:channel_layouts=stereo
A gate is mainly used to reduce lower parts of a signal. This kind of signal
processing reduces disturbing noise between useful signals.
Gating is done by detecting the volume below a chosen level threshold
and dividing it by the factor set with ratio. The bottom of the noise
floor is set via range. Because an exact manipulation of the signal
would cause distortion of the waveform the reduction can be levelled over
time. This is done by setting attack and release.
attack determines how long the signal has to fall below the threshold
before any reduction will occur and release sets the time the signal
has to rise above the threshold to reduce the reduction again.
Shorter signals than the chosen attack time will be left untouched.
Set input level before filtering.
Default is 1. Allowed range is from 0.015625 to 64.
Set the level of gain reduction when the signal is below the threshold.
Default is 0.06125. Allowed range is from 0 to 1.
If a signal rises above this level the gain reduction is released.
Default is 0.125. Allowed range is from 0 to 1.
Set a ratio by which the signal is reduced.
Default is 2. Allowed range is from 1 to 9000.
Amount of milliseconds the signal has to rise above the threshold before gain
reduction stops.
Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
Amount of milliseconds the signal has to fall below the threshold before the
reduction is increased again. Default is 250 milliseconds.
Allowed range is from 0.01 to 9000.
Set amount of amplification of signal after processing.
Default is 1. Allowed range is from 1 to 64.
Curve the sharp knee around the threshold to enter gain reduction more softly.
Default is 2.. Allowed range is from 1 to 8.
Choose if exact signal should be taken for detection or an RMS like one.
Default is rms. Can be peak or rms.
Choose if the average level between all channels or the louder channel affects
the reduction.
Default is average. Can be average or maximum.
Apply an arbitrary Infinite Impulse Response filter.
It accepts the following parameters:
Set numerator/zeros coefficients.
Set denominator/poles coefficients.
Set channels gains.
Set input gain.
Set output gain.
Set coefficients format.
transfer function
Z-plane zeros/poles, cartesian (default)
Z-plane zeros/poles, polar radians
Z-plane zeros/poles, polar degrees
Set kind of processing.
Can be d - direct or s - serial cascading. Defauls is s.
Set filtering precision.
double-precision floating-point (default)
single-precision floating-point
32-bit integers
16-bit integers
Coefficients in tf format are separated by spaces and are in ascending
Coefficients in zp format are separated by spaces and order of coefficients
doesn&t matter. Coefficients in zp format are complex numbers with i
imaginary unit.
Different coefficients and gains can be provided for every channel, in such case
use &|& to separate coefficients or gains. Last provided coefficients will be
used for all remaining channels.
Apply 2 pole elliptic notch at arround 5000Hz for 48000 Hz sample rate:
aiir=k=1:z=7. -2...880E-1:p=1 -2.18 -2.500E-1:f=tf:r=d
Same as above but in zp format:
aiir=k=0.96756:z=0........i:p=0........i:f=zp:r=s
The limiter prevents an input signal from rising over a desired threshold.
This limiter uses lookahead technology to prevent your signal from distorting.
It means that there is a small delay after the signal is processed. Keep in mind
that the delay it produces is the attack time you set.
The filter accepts the following options:
Set input gain. Default is 1.
Set output gain. Default is 1.
Don&t let signals above this level pass the limiter. Default is 1.
The limiter will reach its attenuation level in this amount of time in
milliseconds. Default is 5 milliseconds.
Come back from limiting to attenuation 1.0 in this amount of milliseconds.
Default is 50 milliseconds.
When gain reduction is always needed ASC takes care of releasing to an
average reduction level rather than reaching a reduction of 0 in the release
Select how much the release time is affected by ASC, 0 means nearly no changes
in release time while 1 produces higher release times.
Auto level output signal. Default is enabled.
This normalizes audio back to 0dB if enabled.
Depending on picked setting it is recommended to upsample input 2x or 4x times
before applying this filter.
Apply a two-pole all-pass filter with central frequency (in Hz)
frequency, and filter-width width.
An all-pass filter changes the audio&s frequency to phase relationship
without changing its frequency to amplitude relationship.
The filter accepts the following options:
frequency, f
Set frequency in Hz.
width_type, t
Set method to specify band-width of filter.
Specify the band-width of a filter in width_type units.
channels, c
Specify which channels to filter, by default all available are filtered.
This filter supports the following commands:
frequency, f
Change allpass frequency.
Syntax for the command is : &frequency&
width_type, t
Change allpass width_type.
Syntax for the command is : &width_type&
Change allpass width.
Syntax for the command is : &width&
Loop audio samples.
The filter accepts the following options:
Set the number of loops. Setting this value to -1 will result in infinite loops.
Default is 0.
Set maximal number of samples. Default is 0.
Set first sample of loop. Default is 0.
Merge two or more audio streams into a single multi-channel stream.
The filter accepts the following options:
Set the number of inputs. Default is 2.
If the channel layouts of the inputs are disjoint, and therefore compatible,
the channel layout of the output will be set accordingly and the channels
will be reordered as necessary. If the channel layouts of the inputs are not
disjoint, the output will have all the channels of the first input then all
the channels of the second input, in that order, and the channel layout of
the output will be the default value corresponding to the total number of
For example, if the first input is in 2.1 (FL+FR+LF) and the second input
is FC+BL+BR, then the output will be in 5.1, with the channels in the
following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
first input, b1 is the first channel of the second input).
On the other hand, if both input are in stereo, the output channels will be
in the default order: a1, a2, b1, b2, and the channel layout will be
arbitrarily set to 4.0, which may or may not be the expected value.
All inputs must have the same sample rate, and format.
If inputs do not have the same duration, the output will stop with the
Merge two mono files into a stereo stream:
amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
Multiple merges assuming 1 video stream and 6 audio streams in input.mkv:
ffmpeg -i input.mkv -filter_complex &[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6& -c:a pcm_s16le output.mkv
Mixes multiple audio inputs into a single output.
Note that this filter only supports float samples (the amerge
and pan audio filters support many formats). If the amix
input has integer samples then
will be automatically
inserted to perform the conversion to float samples.
For example
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
will mix 3 input audio streams to a single output with the same duration as the
first input and a dropout transition time of 3 seconds.
It accepts the following parameters:
The number of inputs. If unspecified, it defaults to 2.
How to determine the end-of-stream.
The duration of the longest input. (default)
The duration of the shortest input.
The duration of the first input.
dropout_transition
The transition time, in seconds, for volume renormalization when an input
stream ends. The default value is 2 seconds.
Specify weight of each input audio stream as sequence.
Each weight is separated by space. By default all inputs have same weight.
High-order parametric multiband equalizer for each channel.
It accepts the following parameters:
This option string is in format:
&cchn f=cf w=w g=g t=f | ...&
Each equalizer band is separated by &|&.
Set channel number to which equalization will be applied.
If input doesn&t have that channel the entry is ignored.
Set central frequency for band.
If input doesn&t have that frequency the entry is ignored.
Set band width in hertz.
Set band gain in dB.
Set filter type for band, optional, can be:
Butterworth, this is default.
Chebyshev type 1.
Chebyshev type 2.
With this option activated frequency response of anequalizer is displayed
in video stream.
Set video stream size. Only useful if curves option is activated.
Set max gain that will be displayed. Only useful if curves option is activated.
Setting this to a reasonable value makes it possible to display gain which is derived from
neighbour bands which are too close to each other and thus produce higher gain
when both are activated.
Set frequency scale used to draw frequency response in video output.
Can be linear or logarithmic. Default is logarithmic.
Set color for each channel curve which is going to be displayed in video stream.
This is list of color names separated by space or by &|&.
Unrecognised or missing colors will be replaced by white color.
Lower gain by 10 of central frequency 200Hz and width 100 Hz
for first 2 channels using Chebyshev type 1 filter:
anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
This filter supports the following commands:
Alter existing filter parameters.
Syntax for the commands is : &fN|f=freq|w=width|g=gain&
fN is existing filter number, starting from 0, if no such filter is available
error is returned.
freq set new frequency parameter.
width set new width parameter in herz.
gain set new gain parameter in dB.
Full filter invocation with asendcmd may look like this:
asendcmd=c=&4.0 anequalizer change 0|f=200|w=50|g=1&,anequalizer=...
Pass the audio source unchanged to the output.
Pad the end of an audio stream with silence.
This can be used together with ffmpeg -shortest to
extend audio streams to the same length as the video stream.
A description of the accepted options follows.
packet_size
Set silence packet size. Default value is 4096.
Set the number of samples of silence to add to the end. After the
value is reached, the stream is terminated. This option is mutually
exclusive with whole_len.
Set the minimum total number of samples in the output audio stream. If
the value is longer than the input audio length, silence is added to
the end, until the value is reached. This option is mutually exclusive
with pad_len.
If neither the pad_len nor the whole_len option is
set, the filter will add silence to the end of the input stream
indefinitely.
Add 1024 samples of silence to the end of the input:
apad=pad_len=1024
Make sure the audio output will contain at least 10000 samples, pad
the input with silence if required:
apad=whole_len=10000
Use ffmpeg to pad the audio input with silence, so that the
video stream will always result the shortest and will be converted
until the end in the output file when using the shortest
ffmpeg -i VIDEO -i AUDIO -filter_complex &[1:0]apad& -shortest OUTPUT
Add a phasing effect to the input audio.
A phaser filter creates series of peaks and troughs in the frequency spectrum.
The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
A description of the accepted parameters follows.
Set input gain. Default is 0.4.
Set output gain. Default is 0.74
Set delay in milliseconds. Default is 3.0.
Set decay. Default is 0.4.
Set modulation speed in Hz. Default is 0.5.
Set modulation type. Default is triangular.
It accepts the following values:
&triangular, t&
&sinusoidal, s&
Audio pulsator is something between an autopanner and a tremolo.
But it can produce funny stereo effects as well. Pulsator changes the volume
of the left and right channel based on a LFO (low frequency oscillator) with
different waveforms and shifted phases.
This filter have the ability to define an offset between left and right
channel. An offset of 0 means that both LFO shapes match each other.
The left and right channel are altered equally - a conventional tremolo.
An offset of 50% means that the shape of the right channel is exactly shifted
in phase (or moved backwards about half of the frequency) - pulsator acts as
an autopanner. At 1 both curves match again. Every setting in between moves the
phase shift gapless between all stages and produces some &bypassing& sounds with
sine and triangle waveforms. The more you set the offset near 1 (starting from
the 0.5) the faster the signal passes from the left to the right speaker.
The filter accepts the following options:
Set input gain. By default it is 1. Range is [0.015625 - 64].
Set output gain. By default it is 1. Range is [0.015625 - 64].
Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
sawup or sawdown. Default is sine.
Set modulation. Define how much of original signal is affected by the LFO.
Set left channel offset. Default is 0. Allowed range is [0 - 1].
Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
Set pulse width. Default is 1. Allowed range is [0 - 2].
Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
is set to bpm.
Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
is set to ms.
Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
if timing is set to hz.
Resample the input audio to the specified parameters, using the
libswresample library. If none are specified then the filter will
automatically convert between its input and output.
This filter is also able to stretch/squeeze the audio data to make it match
the timestamps or to inject silence / cut out audio to make it match the
timestamps, do a combination of both or do neither.
The filter accepts the syntax
[sample_rate:]resampler_options, where sample_rate
expresses a sample rate and resampler_options is a list of
key=value pairs, separated by &:&. See the
for the complete list of supported options.
Resample the input audio to 44100Hz:
aresample=44100
Stretch/squeeze samples to the given timestamps, with a maximum of 1000
samples per second compensation:
aresample=async=1000
Reverse an audio clip.
Warning: This filter requires memory to buffer the entire clip, so trimming
is suggested.
Take the first 5 seconds of a clip, and reverse it.
atrim=end=5,areverse
Set the number of samples per each output audio frame.
The last output packet may contain a different number of samples, as
the filter will flush all the remaining samples when the input audio
signals its end.
The filter accepts the following options:
nb_out_samples, n
Set the number of frames per each output audio frame. The number is
intended as the number of samples per each channel.
Default value is 1024.
If set to 1, the filter will pad the last audio frame with zeroes, so
that the last frame will contain the same number of samples as the
previous ones. Default value is 1.
For example, to set the number of per-frame samples to 1234 and
disable padding for the last frame, use:
asetnsamples=n=1234:p=0
Set the sample rate without altering the PCM data.
This will result in a change of speed and pitch.
The filter accepts the following options:
sample_rate, r
Set the output sample rate. Default is 44100 Hz.
Show a line containing various information for each input audio frame.
The input audio is not modified.
The shown line contains a sequence of key/value pairs of the form
key:value.
The following values are shown in the output:
The (sequential) number of the input frame, starting from 0.
The presentation timestamp of the input frame, the time base
depends on the filter input pad, and is usually 1/sample_rate.
The presentation timestamp of the input frame in seconds.
position of the frame in the input stream, -1 if this information in
unavailable and/or meaningless (for example in case of synthetic audio)
The sample format.
The channel layout.
The sample rate for the audio frame.
nb_samples
The number of samples (per channel) in the frame.
The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
audio, the data is treated as if all the planes were concatenated.
plane_checksums
A list of Adler-32 checksums for each data plane.
Display time domain statistical information about the audio channels.
Statistics are calculated and displayed for each audio channel and,
where applicable, an overall figure is also given.
It accepts the following option:
Short window length in seconds, used for peak and trough RMS measurement.
Default is 0.05 (50 milliseconds). Allowed range is [0.01 - 10].
Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X,
where X is channel number starting from 1 or string Overall. Default is
Available keys for each channel are:
Min_difference
Max_difference
Mean_difference
RMS_difference
Peak_level
RMS_trough
Crest_factor
Flat_factor
Peak_count
Dynamic_range
and for Overall:
Min_difference
Max_difference
Mean_difference
RMS_difference
Peak_level
RMS_trough
Flat_factor
Peak_count
Number_of_samples
For example full key look like this lavfi.astats.1.DC_offset or
this lavfi.astats.Overall.Peak_count.
For description what each key means read below.
Set number of frame after which stats are going to be recalculated.
Default is disabled.
A description of each shown parameter follows:
Mean amplitude displacement from zero.
Minimal sample level.
Maximal sample level.
Min difference
Minimal difference between two consecutive samples.
Max difference
Maximal difference between two consecutive samples.
Mean difference
Mean difference between two consecutive samples.
The average of each difference between two consecutive samples.
RMS difference
Root Mean Square difference between two consecutive samples.
Peak level dB
RMS level dB
Standard peak and RMS level measured in dBFS.
RMS peak dB
RMS trough dB
Peak and trough values for RMS level measured over a short window.
Crest factor
Standard ratio of peak to RMS level (note: not in dB).
Flat factor
Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
(i.e. either Min level or Max level).
Peak count
Number of occasions (not the number of samples) that the signal attained either
Min level or Max level.
Overall bit depth of audio. Number of bits used for each sample.
Dynamic range
Measured dynamic range of audio in dB.
Adjust audio tempo.
The filter accepts exactly one parameter, the audio tempo. If not
specified then the filter will assume nominal 1.0 tempo. Tempo must
be in the [0.5, 2.0] range.
Slow down audio to 80% tempo:
atempo=0.8
To speed up audio to 125% tempo:
atempo=1.25
Trim the input so that the output contains one continuous subpart of the input.
It accepts the following parameters:
Timestamp (in seconds) of the start of the section to keep. I.e. the audio
sample with the timestamp start will be the first sample in the output.
Specify time of the first audio sample that will be dropped, i.e. the
audio sample immediately preceding the one with the timestamp end will be
the last sample in the output.
Same as start, except this option sets the start timestamp in samples
instead of seconds.
Same as end, except this option sets the end timestamp in samples instead
of seconds.
The maximum duration of the output in seconds.
start_sample
The number of the first sample that should be output.
end_sample
The number of the first sample that should be dropped.
start, end, and duration are expressed as time
Note that the first two sets of the start/end options and the duration
option look at the frame timestamp, while the _sample options simply count the
samples that pass through the filter. So start/end_pts and start/end_sample will
give different results when the timestamps are wrong, inexact or do not start at
zero. Also note that this filter does not modify the timestamps. If you wish
to have the output timestamps start at zero, insert the asetpts filter after the
atrim filter.
If multiple start or end options are set, this filter tries to be greedy and
keep all samples that match at least one of the specified constraints. To keep
only the part that matches all the constraints at once, chain multiple atrim
The defaults are such that all the input is kept. So it is possible to set e.g.
just the end values to keep everything before the specified time.
Drop everything except the second minute of input:
ffmpeg -i INPUT -af atrim=60:120
Keep only the first 1000 samples:
ffmpeg -i INPUT -af atrim=end_sample=1000
Apply a two-pole Butterworth band-pass filter with central
frequency frequency, and (3dB-point) band-width width.
The csg option selects a constant skirt gain (peak gain = Q)
instead of the default: constant 0dB peak gain.
The filter roll off at 6dB per octave (20dB per decade).
The filter accepts the following options:
frequency, f
Set the filter&s central frequency. Default is 3000.
Constant skirt gain if set to 1. Defaults to 0.
width_type, t
Set method to specify band-width of filter.
Specify the band-width of a filter in width_type units.
channels, c
Specify which channels to filter, by default all available are filtered.
This filter supports the following commands:
frequency, f
Change bandpass frequency.
Syntax for the command is : &frequency&
width_type, t
Change bandpass width_type.
Syntax for the command is : &width_type&
Change bandpass width.
Syntax for the command is : &width&
Apply a two-pole Butterworth band-reject filter with central
frequency frequency, and (3dB-point) band-width width.
The filter roll off at 6dB per octave (20dB per decade).
The filter accepts the following options:
frequency, f
Set the filter&s central frequency. Default is 3000.
width_type, t
Set method to specify band-width of filter.
Specify the band-width of a filter in width_type units.
channels, c
Specify which channels to filter, by default all available are filtered.
This filter supports the following commands:
frequency, f
Change bandreject frequency.
Syntax for the command is : &frequency&
width_type, t
Change bandreject width_type.
Syntax for the command is : &width_type&
Change bandreject width.
Syntax for the command is : &width&
Boost or cut the bass (lower) frequencies of the audio using a two-pole
shelving filter with a response similar to that of a standard
hi-fi&s tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Give the gain at 0 Hz. Its useful range is about -20
(for a large cut) to +20 (for a large boost).
Beware of clipping when using a positive gain.
frequency, f
Set the filter&s central frequency and so can be used
to extend or reduce the frequency range to be boosted or cut.
The default value is 100 Hz.
width_type, t
Set method to specify band-width of filter.
Determine how steep is the filter&s shelf transition.
channels, c
Specify which channels to filter, by default all available are filtered.
This filter supports the following commands:
frequency, f
Change bass frequency.
Syntax for the command is : &frequency&
width_type, t
Change bass width_type.
Syntax for the command is : &width_type&
Change bass width.
Syntax for the command is : &width&
Change bass gain.
Syntax for the command is : &gain&
Apply a biquad IIR filter with the given coefficients.
Where b0, b1, b2 and a0, a1, a2
are the numerator and denominator coefficients respectively.
and channels, c specify which channels to filter, by default all
available are filtered.
This filter supports the following commands:
Change biquad parameter.
Syntax for the command is : &value&
Bauer stereo to binaural transformation, which improves headphone listening of
stereo audio records.
To enable compilation of this filter you need to configure FFmpeg with
--enable-libbs2b.
It accepts the following parameters:
Pre-defined crossfeed level.
Default level (fcut=700, feed=50).
Chu Moy circuit (fcut=700, feed=60).
Jan Meier circuit (fcut=650, feed=95).
Cut frequency (in Hz).
Feed level (in Hz).
Remap input channels to new locations.
It accepts the following parameters:
Map channels from input to output. The argument is a &|&-separated list of
mappings, each in the in_channel-out_channel or
in_channel form. in_channel can be either the name of the input
channel (e.g. FL for front left) or its index in the input channel layout.
out_channel is the name of the output channel or its index in the output
channel layout. If out_channel is not given then it is implicitly an
index, starting with zero and increasing by one for each mapping.
channel_layout
The channel layout of the output stream.
If no mapping is present, the filter will implicitly map input channels to
output channels, preserving indices.
For example, assuming a 5.1+downmix input MOV file,
ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
will create an output WAV file tagged as stereo from the downmix channels of
the input.
To fix a 5.1 WAV improperly encoded in AAC&s native channel order
ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
Split each channel from an input audio stream into a separate output stream.
It accepts the following parameters:
channel_layout
The channel layout of the input stream. The default is &stereo&.
A channel layout describing the channels to be extracted as separate output streams
or &all& to extract each input channel as a separate stream. The default is &all&.
Choosing channels not present in channel layout in the input will result in an error.
For example, assuming a stereo input MP3 file,
ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
will create an output Matroska file with two audio streams, one containing only
the left channel and the other the right channel.
Split a 5.1 WAV file into per-channel files:
ffmpeg -i in.wav -filter_complex
'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
-map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
side_right.wav
Extract only LFE from a 5.1 WAV file:
ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
-map '[LFE]' lfe.wav
Add a chorus effect to the audio.
Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
constant, with chorus, it is varied using using sinusoidal or triangular modulation.
The modulation depth defines the range the modulated delay is played before or after
the delay. Hence the delayed sound will sound slower or faster, that is the delayed
sound tuned around the original one, like in a chorus where some vocals are slightly
It accepts the following parameters:
Set input gain. Default is 0.4.
Set output gain. Default is 0.4.
Set delays. A typical delay is around 40ms to 60ms.
Set decays.
Set speeds.
Set depths.
A single delay:
chorus=0.7:0.9:55:0.4:0.25:2
Two delays:
chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
Fuller sounding chorus with three delays:
chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
Compress or expand the audio&s dynamic range.
It accepts the following parameters:
A list of times in seconds for each channel over which the instantaneous level
of the input signal is averaged to determine its volume. attacks refers to
increase of volume and decays refers to decrease of volume. For most
situations, the attack time (response to the audio getting louder) should be
shorter than the decay time, because the human ear is more sensitive to sudden
loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
a typical value for decay is 0.8 seconds.
If specified number of attacks & decays is lower than number of channels, the last
set attack/decay will be used for all remaining channels.
A list of points for the transfer function, specified in dB relative to the
maximum possible signal amplitude. Each key points list must be defined using
the following syntax: x0/y0|x1/y1|x2/y2|.... or
x0/y0 x1/y1 x2/y2 ....
The input values must be in strictly increasing order but the transfer function
does not have to be monotonically rising. The point 0/0 is assumed but
may be overridden (by 0/out-dBn). Typical values for the transfer
function are -70/-70|-60/-20|1/0.
Set the curve radius in dB for all joints. It defaults to 0.01.
Set the additional gain in dB to be applied at all points on the transfer
function. This allows for easy adjustment of the overall gain.
It defaults to 0.
Set an initial volume, in dB, to be assumed for each channel when filtering
starts. This permits the user to supply a nominal level initially, so that, for
example, a very large gain is not applied to initial signal levels before the
companding has begun to operate. A typical value for audio which is initially
quiet is -90 dB. It defaults to 0.
Set a delay, in seconds. The input audio is analyzed immediately, but audio is
delayed before being fed to the volume adjuster. Specifying a delay
approximately equal to the attack/decay times allows the filter to effectively
operate in predictive rather than reactive mode. It defaults to 0.
Make music with both quiet and loud passages suitable for listening to in a
noisy environment:
compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
Another example for audio with whisper and explosion parts:
compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
A noise gate for when the noise}

我要回帖

更多关于 linux mkfs命令 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信