mencoder使用

mencoder使用通用选项列出所有选项 mencoder list options 不加载配置文件 noconfigsyst user gui all 加载不同的 profile profilemy profile 显示所有定义的 profile profilehelp 显示某个指定 profile 的内容 show profilemypro 现实很少的输出信息 reall

通用选项

列出所有选项:mencoder −list−options

不加载配置文件:−noconfig system/user/gui/all

加载不同的profile:−profile my-profile

显示所有定义的profile:-profile help

显示某个指定profile的内容:-show-profile myprofile

现实很少的输出信息:−really−quiet

Demux/Stream选项

指定帧率:−fps

指定从开始起转换的帧数:−frames

DECODING/FILTERING OPTIONS

强制宽高比:−aspect

,例如−aspect 4:3 or−aspect 1.3333



不编码音频:−nosound

不编码视频:−novideo

指定软件scaler的参数:−ssf
,例如−vf scale −ssflgb=3.0

                                                                         lgb=<0−100>

gaussian blur filter (luma)

cgb=<0−100>

gaussian blur filter(chroma)

ls=<−100−100>

sharpen filter (luma)

cs=<−100−100>

sharpen filter (chroma)

chs=

chroma horizontal shifting

cvs=

chroma vertical shifting

立体声输出模式:
−stereo

软件缩放算法选择:−sws

,该选项指定了使用-zoom时,进行软件缩放的算法。

缩放比例设定:−xy

,value<=8时表示缩放比例,value>8时表示宽度,高度按比例计算得到。

                      -y

:指定高度而不是宽度

启用缩放:−zoom

VIDEO FILTERS

显示所有的视频滤波器:-vf help

一般用法:−vf

mirror:上下镜像

通用编码选项

指定输出文件的fourcc:−ffourcc

输出文件名:-o,可以在默认配置文件中指定本选项,则每次输出的文件都是指定的名字。

音频编码器的名字:−oac,可选参数为copy, pcm, mp3lame, lavc, faac

视频编码器的名字:-avc,可选参数为copy, frameno, raw, lavc, vfw, qtvideo, xvid, x264,其中如果指定为raw,则需要指定fourcc选项。

输出格式:-of,可选参数为avi, mpeg, lavf, rawvideo, rawaudio,后两种格式不会将音视频复用。

输出帧率:-ofps

指定firstpass的输出文件:−passlogfile

mp3编码器

帮助:mencoder -oac mp3lame -lameopts help

一般可以用abr模式,preset=172

faac编码器

指定码率:-br=bitrate

指定档次:-object=1/2/3/4, 对应main, low, ssr, ltp(默认main)

哪种算法:-mpeg=2/4,默认是4

x264编码器

bitrate=

pass=<1-3>

profile=baseline/main/high

preset=ultrafast/superfast/veryfast/faster/fast/medium/slow/slower/veryslow/placebo,medium为缺省设置。

keyint=

,IDR的间隔帧数

keyint_min=<1 - keyint/2>,最小IDR的间隔帧数,默认值为25。如果在此之内发生场景切换,则该帧被编码为I帧,而不是IDR帧。

frameref=<1-16>,参考帧数量,默认是3

bframes=<1-16>,I帧和P帧之间的B帧数量,默认值3

(no)b_adapt,B帧数量自适应,默认打开,如果关闭,则使用上面的bframes指定的参数

b_bias=<−100−100>,B帧数量判决依据,大的值产生更多的B帧,默认为0。

b_pyramid=

,是否允许B帧作为参考帧,要求
bframes>=2

(no)mbtree: 使能或禁止宏块树率控,在多通道模式下,写入到一个单独的统计文件: .mbtree

rc_lookahead=<0−250>:调整mbtree前瞻的距离(默认值:40)。较大的值将降低编码速度,并且导致X264消耗更多的内存,但可以产生更高的质量。

ratetol=<0.1−100.0> (ABR or two pass):平均码率设定下允许的码率变化范围,(default: 1.0)

vbv_maxrate=

(ABR or two pass):最大码率,单位kbps,(default: disabled)

vbv_bufsize=

(ABR or two pass):表示计算





vbv_maxrate的平均周期,单位是kbits,没有默认值,如果vbv_maxrate使能,则本选项必须设置。

vbv_init=<0.0−1.0> (ABR or two pass):表示起始阶段vbv_bufsize的占用率。
(default: 0.9)

ip_factor=

,I和P之间的量化值比例。(default: 1.4)

pb_factor=

,P和B之间的量化值比例。(default: 1.3)

qcomp=<0−1> (ABR or two pass),量化压缩值,(default: 0.6)。小的值使码率更恒定,大的值使量化值更固定。

cplx_blur=<0−999> (two pass only),

Temporal blur of the estimated frame complexity, before curve compression (default: 20). Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly. cplx_blur ensures that each I-frame has quality comparable to the following P-frames, and ensures that alternating high and low complexity frames (e.g. low fps animation) do not waste bits on fluctuating quantizer.

qblur=<0−99> (two pass only)

Temporal blur of the quantization parameter, after curve compression (default: 0.5). Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly.
















direct_pred=none/spatial/temporal/auto,默认spatial。当使用multi-pass模式时,最好使用auto。none无论速度还是效率都不高。

partitions= :(default: p8x8,b8x8,i8x8,i4x4),对于小图像,可以加上p4x4

(no)8x8dct

(no)mixed_refs,允许一个宏块的16×8,8×16,8×8分块选择不同的参考帧。

level_idc=<10−51>

threads=<0−16>,默认0,表示编码器自动选择。

(no)sliced_threads,默认禁止。

(no)global_header,是否只在文件开头保存SPS和PPS。默认禁止,即在每个IDR之前都保存SPS和PPS。

(no)interlaced,视频源是否是隔行扫描的。

lavf复用器

format=

, 可输出flv, mp4, mkv等格式。

mencoder用法举例

Encode DVD title #2, only selected chapters:

mencoder dvd://2 −chapter 10−15 −o title2.avi −oac copy −ovc lavc −lavcopts vcodec=mpeg4

Encode DVD title #2, resizing to 640×480:
mencoder dvd://2 −vf scale=640:480 −o title2.avi −oac copy −ovc lavc −lavcopts vcodec=mpeg4

Encode DVD title #2, resizing to 512xHHH (keep aspect ratio):
mencoder dvd://2 −vf scale −zoom −xy 512 −o title2.avi −oac copy −ovc lavc −lavcopts vcodec=mpeg4

The same, but with bitrate set to 1800kbit and optimized macroblocks:
mencoder dvd://2 −o title2.avi −oac copy −ovc lavc −lavcopts vcodec=mpeg4:mbd=1:vbitrate=1800

The same, but with MJPEG compression:
mencoder dvd://2 −o title2.avi −oac copy −ovc lavc −lavcopts vcodec=mjpeg:mbd=1:vbitrate=1800

Encode all *.jpg files in the current directory:
mencoder “mf://*.jpg” −mf fps=25 −o output.avi −ovc lavc −lavcopts vcodec=mpeg4

Encode from a tuner (specify a format with −vf format):
mencoder −tv driver=v4l:width=640:height=480 tv:// −o tv.avi −ovc raw

Encode from a pipe:

rar p test-SVCD.rar | mencoder −ovc lavc −lavcopts vcodec=mpeg4:vbitrate=800 −ofps 24 −

























版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219922.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午9:35
下一篇 2026年3月17日 下午9:35


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号