Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Main options:
-L show license
-h show help
-? show help
-help show help
--help show help
-version show version
-formats show available formats
-codecs show available codecs
-bsfs show available bit stream filters
-protocols show available protocols
-filters show available filters
-pix_fmts show available pixel formats
-loglevel loglevel set libav* logging level
-f fmt force format
-i filename input file name
-y overwrite output files
-t duration record or transcode "duration" seconds of audio/video
-fs limit_size set the limit file size in bytes
-ss time_off set the start time offset
-itsoffset time_off set the input ts offset
-itsscale stream:scale set the input ts scale
-timestamp time set the timestamp ('now' to set the current time)
-metadata string=string add metadata
-dframes number set the number of data frames to record
-timelimit limit set max runtime in seconds
-v number set ffmpeg verbosity level
-target type specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-xerror exit on error
Advanced options:
-map file:stream[:syncfile:syncstream] set input stream mapping
-map_meta_data outfile:infile set meta data information of outfile from infile
-benchmark add timings for benchmarking
-dump dump each input packet
-hex when dumping packets, also dump the payload
-re read input at native frame rate
-loop_input loop (current only works with images)
-loop_output number of times to loop output in formats that support looping (0 loops forever)
-threads count thread count
-vsync video sync method
-async audio sync method
-adrift_threshold threshold audio drift threshold
-vglobal video global header storage type
-copyts copy timestamps
-shortest finish encoding within shortest input
-dts_delta_threshold threshold timestamp discontinuity delta threshold
-programid desired program number
-copyinkf copy initial non-keyframes
-muxdelay seconds set the maximum demux-decode delay
-muxpreload seconds set the initial demux-decode delay
-fpre filename set options from indicated preset file
Video options:
-b bitrate set bitrate (in bits/s)
-vb bitrate set bitrate (in bits/s)
-vframes number set the number of video frames to record
-r rate set frame rate (Hz value, fraction or abbreviation)
-s size set frame size (WxH or abbreviation)
-aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-croptop size set top crop band size (in pixels)
-cropbottom size set bottom crop band size (in pixels)
-cropleft size set left crop band size (in pixels)
-cropright size set right crop band size (in pixels)
-padtop size set top pad band size (in pixels)
-padbottom size set bottom pad band size (in pixels)
-padleft size set left pad band size (in pixels)
-padright size set right pad band size (in pixels)
-padcolor color set color of pad bands (Hex 000000 thru FFFFFF)
-vn disable video
-vcodec codec force video codec ('copy' to copy stream)
-sameq use same video quality as source (implies VBR)
-pass n select the pass number (1 or 2)
-passlogfile prefix select two pass log file name prefix
-newvideo add a new video stream to the current output stream
-vlang code set the ISO 639 language code (3 letters) of the current video stream
Advanced Video options:
-pix_fmt format set pixel format, 'list' as argument shows all the pixel formats supported
-intra use only intra frames
-vdt n discard threshold
-qscale q use fixed video quantizer scale (VBR)
-rc_override override rate control override for specific intervals
-me_threshold threshold motion estimaton threshold
-deinterlace deinterlace pictures
-psnr calculate PSNR of compressed frames
-vstats dump video coding statistics to file
-vstats_file file dump video coding statistics to file
-intra_matrix matrix specify intra matrix coeffs
-inter_matrix matrix specify inter matrix coeffs
-top top=1/bottom=0/auto=-1 field first
-dc precision intra_dc_precision
-vtag fourcc/tag force video tag/fourcc
-qphist show QP histogram
-force_fps force the selected framerate, disable the best supported framerate selection
-vbsf bitstream_filter
-vpre preset set the video options to the indicated preset
Audio options:
-ab bitrate set bitrate (in bits/s)
-aframes number set the number of audio frames to record
-aq quality set audio quality (codec-specific)
-ar rate set audio sampling rate (in Hz)
-ac channels set number of audio channels
-an disable audio
-acodec codec force audio codec ('copy' to copy stream)
-vol volume change audio volume (256=normal)
-newaudio add a new audio stream to the current output stream
-alang code set the ISO 639 language code (3 letters) of the current audio stream
Advanced Audio options:
-atag fourcc/tag force audio tag/fourcc
-sample_fmt format set sample format, 'list' as argument shows all the sample formats supported
-absf bitstream_filter
-apre preset set the audio options to the indicated preset
Subtitle options:
-sn disable subtitle
-scodec codec force subtitle codec ('copy' to copy stream)
-newsubtitle add a new subtitle stream to the current output stream
-slang code set the ISO 639 language code (3 letters) of the current subtitle stream
-stag fourcc/tag force subtitle tag/fourcc
-sbsf bitstream_filter
-spre preset set the subtitle options to the indicated preset
Audio/Video grab options:
-vc channel set video grab channel (DV1394 only)
-tvstd standard set television standard (NTSC, PAL (SECAM))
-h 帮助
-fromats 显示可用的格式,编解码的,协议的...
-f fmt 强迫采用格式fmt
-I filename 输入文件
-y 覆盖输出文件
-t duration 设置纪录时间 hh:mm:ss[.xxx]格式的记录时间也支持
-ss position 搜索到指定的时间 [-]hh:mm:ss[.xxx]的格式也支持
-title string 设置标题
-author string 设置作者
-copyright string 设置版权
-comment string 设置评论
-target type 设置目标文件类型(vcd,svcd,dvd) 所有的格式选项(比特率,编解码以及缓冲区大小)自动设置,只需要输入如下的就可以了:ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
-hq 激活高质量设置
-itsoffset offset 设置以秒为基准的时间偏移,该选项影响所有后面的输入文件。该偏移被加到输入文件的时戳,定义一个正偏移意味着相应的流被延迟了 offset秒。 [-]hh:mm:ss[.xxx]的格式也支持
-r fps 设置帧频 缺省25
-s size 设置帧大小 格式为WXH 缺省160X128.下面的简写也可以直接使用:
Sqcif 128X96 qcif 176X144 cif 252X288 4cif 704X576
-aspect aspect 设置横纵比 4:3 16:9 或 1.3333 1.7777
-croptop size 设置顶部切除带大小 像素单位
-cropbottom size –cropleft size –cropright size
-padtop size 设置顶部补齐的大小 像素单位
-padbottom size –padleft size –padright size –padcolor color 设置补齐条颜色(hex,6个16进制的数,红:绿:兰排列,比如 000000代表黑色)
-vn 不做视频记录
-bt tolerance 设置视频码率容忍度kbit/s
-maxrate bitrate设置最大视频码率容忍度
-minrate bitreate 设置最小视频码率容忍度
-bufsize size 设置码率控制缓冲区大小
-vcodec codec 强制使用codec编解码方式。如果用copy表示原始编解码数据必须被拷贝。 mpeg4
-sameq 使用同样视频质量作为源(VBR)
-pass n 选择处理遍数(1或者2)。两遍编码非常有用。第一遍生成统计信息,第二遍生成精确的请求的码率
-passlogfile file 选择两遍的纪录文件名为file
-intra 仅适用帧内编码
-qscale q 使用固定的视频量化标度(VBR)
-qmin q 最小视频量化标度(VBR)
-qmax q 最大视频量化标度(VBR)
-qdiff q 量化标度间最大偏差 (VBR)
-qblur blur 视频量化标度柔化(VBR)
-qcomp compression 视频量化标度压缩(VBR)
-rc_init_cplx complexity 一遍编码的初始复杂度
-b_qfactor factor 在p和b帧间的qp因子
-i_qfactor factor 在p和i帧间的qp因子
-b_qoffset offset 在p和b帧间的qp偏差
-i_qoffset offset 在p和i帧间的qp偏差
-rc_eq equation 设置码率控制方程 默认tex^qComp
-rc_override override 特定间隔下的速率控制重载
-me method 设置运动估计的方法 可用方法有 zero phods log x1 epzs(缺省) full
-dct_algo algo 设置dct的算法 可用的有 0 FF_DCT_AUTO 缺省的DCT 1 FF_DCT_FASTINT 2 FF_DCT_INT 3 FF_DCT_MMX 4 FF_DCT_MLIB 5 FF_DCT_ALTIVEC
-idct_algo algo 设置idct算法。可用的有 0 FF_IDCT_AUTO 缺省的IDCT 1 FF_IDCT_INT 2 FF_IDCT_SIMPLE 3 FF_IDCT_SIMPLEMMX 4 FF_IDCT_LIBMPEG2MMX 5 FF_IDCT_PS2 6 FF_IDCT_MLIB 7 FF_IDCT_ARM 8 FF_IDCT_ALTIVEC 9 FF_IDCT_SH4 10 FF_IDCT_SIMPLEARM
-er n 设置错误残留为n 1 FF_ER_CAREFULL 缺省 2 FF_ER_COMPLIANT 3 FF_ER_AGGRESSIVE 4 FF_ER_VERY_AGGRESSIVE
-ec bit_mask 设置错误掩蔽为bit_mask,该值为如下值的位掩码 1 FF_EC_GUESS_MVS (default=enabled) 2 FF_EC_DEBLOCK (default=enabled)
-bf frames 使用frames B 帧,支持mpeg1,mpeg2,mpeg4
-mbd mode 宏块决策 0 FF_MB_DECISION_SIMPLE 使用mb_cmp 1 FF_MB_DECISION_BITS 2 FF_MB_DECISION_RD
-4mv 使用4个运动矢量 仅用于mpeg4
-part 使用数据划分 仅用于mpeg4
-bug param 绕过没有被自动监测到编码器的问题
-strict strictness 跟标准的严格性
-aic 使能高级帧内编码 h263+
-umv 使能无限运动矢量 h263+
-deinterlace 不采用交织方法
-interlace 强迫交织法编码仅对mpeg2和mpeg4有效。当你的输入是交织的并且你想要保持交织以最小图像损失的时候采用该选项。可选的方法是不交织,但是损失更大
-psnr 计算压缩帧的psnr
-vstats 输出视频编码统计到vstats_hhmmss.log
-vhook module 插入视频处理模块 module 包括了模块名和参数,用空格分开
-ar freq 设置音频采样率
-ac channels 设置通道 缺省为1
-an 不使能音频纪录
-acodec codec 使用codec编解码
-acodec copy ;libfaac ;aac;libmp3lame
(E)音频/视频捕获选项
-vd device 设置视频捕获设备。比如/dev/video0
-vc channel 设置视频捕获通道 DV1394专用
-tvstd standard 设置电视标准 NTSC PAL(SECAM)
-dv1394 设置DV1394捕获
-av device 设置音频设备 比如/dev/dsp
-debug 打印特定调试信息
-benchmark 为基准测试加入时间
-hex 倾倒每一个输入包
-bitexact 仅使用位精确算法 用于编解码测试
-ps size 设置包大小,以bits为单位
-re 以本地帧频读数据,主要用于模拟捕获设备
-loop 循环输入流(只工作于图像流,用于ffserver测试)
分离
比如你的文件是 test.mp4
分离视频出来:ffmpeg -i test.mp4 -vcodec copy -an 视频流.avi
分离音频出来:ffmpeg -i test.mp4 -acodec copy -vn 音频流.mp3
分离字幕
ffmpeg -i xxx.mov -vn -an -scodec copy xxx.sub
选择轨道
分离音频/字幕时,如果没有特别指定,那么通常就会分理出第一条音频/字幕流,要选择特定的数据流时,可以使用map参数。
比如:
ffmpeg -i xxx.mov -map 0:2 -vn -acodec copy xxx.audio
-map input:stream
input:0是指本文件
stream:视频流并非总是在0的位置
可以使用ffmpeg -i xxx.mov来查看顺序
ffmpeg支持多种容器,所以可以用一款软件在mp4/mkv/flv之间变换,在h264越来越普及的今天非常方便。
封装
如果视频流.avi里面的视频编码本身是mpeg4就:
ffmpeg -i 视频流.avi -i 音频流.mp3 -vcodec copy -acodec copy 合并.mp4
如果 视频流.avi里面的视频编码不是mpeg4,而你又想得到mp4就:
ffmpeg -i 视频流.avi -i 音频流.mp3 -vcodec mpeg4 -acodec copy 合并.mp4
参考:
http://www.ffmpeg.com.cn/index.php/Ffmpeg%E5%BF%AB%E9%80%9F%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8
http://blog.csdn.net/jixiuffff/article/details/5709976
http://www.yaosansi.com/post/1273.html
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Main options:
-L show license
-h show help
-? show help
-help show help
--help show help
-version show version
-formats show available formats
-codecs show available codecs
-bsfs show available bit stream filters
-protocols show available protocols
-filters show available filters
-pix_fmts show available pixel formats
-loglevel loglevel set libav* logging level
-f fmt force format
-i filename input file name
-y overwrite output files
-t duration record or transcode "duration" seconds of audio/video
-fs limit_size set the limit file size in bytes
-ss time_off set the start time offset
-itsoffset time_off set the input ts offset
-itsscale stream:scale set the input ts scale
-timestamp time set the timestamp ('now' to set the current time)
-metadata string=string add metadata
-dframes number set the number of data frames to record
-timelimit limit set max runtime in seconds
-v number set ffmpeg verbosity level
-target type specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-xerror exit on error
Advanced options:
-map file:stream[:syncfile:syncstream] set input stream mapping
-map_meta_data outfile:infile set meta data information of outfile from infile
-benchmark add timings for benchmarking
-dump dump each input packet
-hex when dumping packets, also dump the payload
-re read input at native frame rate
-loop_input loop (current only works with images)
-loop_output number of times to loop output in formats that support looping (0 loops forever)
-threads count thread count
-vsync video sync method
-async audio sync method
-adrift_threshold threshold audio drift threshold
-vglobal video global header storage type
-copyts copy timestamps
-shortest finish encoding within shortest input
-dts_delta_threshold threshold timestamp discontinuity delta threshold
-programid desired program number
-copyinkf copy initial non-keyframes
-muxdelay seconds set the maximum demux-decode delay
-muxpreload seconds set the initial demux-decode delay
-fpre filename set options from indicated preset file
Video options:
-b bitrate set bitrate (in bits/s)
-vb bitrate set bitrate (in bits/s)
-vframes number set the number of video frames to record
-r rate set frame rate (Hz value, fraction or abbreviation)
-s size set frame size (WxH or abbreviation)
-aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-croptop size set top crop band size (in pixels)
-cropbottom size set bottom crop band size (in pixels)
-cropleft size set left crop band size (in pixels)
-cropright size set right crop band size (in pixels)
-padtop size set top pad band size (in pixels)
-padbottom size set bottom pad band size (in pixels)
-padleft size set left pad band size (in pixels)
-padright size set right pad band size (in pixels)
-padcolor color set color of pad bands (Hex 000000 thru FFFFFF)
-vn disable video
-vcodec codec force video codec ('copy' to copy stream)
-sameq use same video quality as source (implies VBR)
-pass n select the pass number (1 or 2)
-passlogfile prefix select two pass log file name prefix
-newvideo add a new video stream to the current output stream
-vlang code set the ISO 639 language code (3 letters) of the current video stream
Advanced Video options:
-pix_fmt format set pixel format, 'list' as argument shows all the pixel formats supported
-intra use only intra frames
-vdt n discard threshold
-qscale q use fixed video quantizer scale (VBR)
-rc_override override rate control override for specific intervals
-me_threshold threshold motion estimaton threshold
-deinterlace deinterlace pictures
-psnr calculate PSNR of compressed frames
-vstats dump video coding statistics to file
-vstats_file file dump video coding statistics to file
-intra_matrix matrix specify intra matrix coeffs
-inter_matrix matrix specify inter matrix coeffs
-top top=1/bottom=0/auto=-1 field first
-dc precision intra_dc_precision
-vtag fourcc/tag force video tag/fourcc
-qphist show QP histogram
-force_fps force the selected framerate, disable the best supported framerate selection
-vbsf bitstream_filter
-vpre preset set the video options to the indicated preset
Audio options:
-ab bitrate set bitrate (in bits/s)
-aframes number set the number of audio frames to record
-aq quality set audio quality (codec-specific)
-ar rate set audio sampling rate (in Hz)
-ac channels set number of audio channels
-an disable audio
-acodec codec force audio codec ('copy' to copy stream)
-vol volume change audio volume (256=normal)
-newaudio add a new audio stream to the current output stream
-alang code set the ISO 639 language code (3 letters) of the current audio stream
Advanced Audio options:
-atag fourcc/tag force audio tag/fourcc
-sample_fmt format set sample format, 'list' as argument shows all the sample formats supported
-absf bitstream_filter
-apre preset set the audio options to the indicated preset
Subtitle options:
-sn disable subtitle
-scodec codec force subtitle codec ('copy' to copy stream)
-newsubtitle add a new subtitle stream to the current output stream
-slang code set the ISO 639 language code (3 letters) of the current subtitle stream
-stag fourcc/tag force subtitle tag/fourcc
-sbsf bitstream_filter
-spre preset set the subtitle options to the indicated preset
Audio/Video grab options:
-vc channel set video grab channel (DV1394 only)
-tvstd standard set television standard (NTSC, PAL (SECAM))
-isync sync read on input
(A) 通用选项
-L license-h 帮助
-fromats 显示可用的格式,编解码的,协议的...
-f fmt 强迫采用格式fmt
-I filename 输入文件
-y 覆盖输出文件
-t duration 设置纪录时间 hh:mm:ss[.xxx]格式的记录时间也支持
-ss position 搜索到指定的时间 [-]hh:mm:ss[.xxx]的格式也支持
-title string 设置标题
-author string 设置作者
-copyright string 设置版权
-comment string 设置评论
-target type 设置目标文件类型(vcd,svcd,dvd) 所有的格式选项(比特率,编解码以及缓冲区大小)自动设置,只需要输入如下的就可以了:ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
-hq 激活高质量设置
-itsoffset offset 设置以秒为基准的时间偏移,该选项影响所有后面的输入文件。该偏移被加到输入文件的时戳,定义一个正偏移意味着相应的流被延迟了 offset秒。 [-]hh:mm:ss[.xxx]的格式也支持
(B) 视频选项
-b bitrate 设置比特率,缺省200kb/s-r fps 设置帧频 缺省25
-s size 设置帧大小 格式为WXH 缺省160X128.下面的简写也可以直接使用:
Sqcif 128X96 qcif 176X144 cif 252X288 4cif 704X576
-aspect aspect 设置横纵比 4:3 16:9 或 1.3333 1.7777
-croptop size 设置顶部切除带大小 像素单位
-cropbottom size –cropleft size –cropright size
-padtop size 设置顶部补齐的大小 像素单位
-padbottom size –padleft size –padright size –padcolor color 设置补齐条颜色(hex,6个16进制的数,红:绿:兰排列,比如 000000代表黑色)
-vn 不做视频记录
-bt tolerance 设置视频码率容忍度kbit/s
-maxrate bitrate设置最大视频码率容忍度
-minrate bitreate 设置最小视频码率容忍度
-bufsize size 设置码率控制缓冲区大小
-vcodec codec 强制使用codec编解码方式。如果用copy表示原始编解码数据必须被拷贝。 mpeg4
-sameq 使用同样视频质量作为源(VBR)
-pass n 选择处理遍数(1或者2)。两遍编码非常有用。第一遍生成统计信息,第二遍生成精确的请求的码率
-passlogfile file 选择两遍的纪录文件名为file
(C)高级视频选项
-g gop_size 设置图像组大小-intra 仅适用帧内编码
-qscale q 使用固定的视频量化标度(VBR)
-qmin q 最小视频量化标度(VBR)
-qmax q 最大视频量化标度(VBR)
-qdiff q 量化标度间最大偏差 (VBR)
-qblur blur 视频量化标度柔化(VBR)
-qcomp compression 视频量化标度压缩(VBR)
-rc_init_cplx complexity 一遍编码的初始复杂度
-b_qfactor factor 在p和b帧间的qp因子
-i_qfactor factor 在p和i帧间的qp因子
-b_qoffset offset 在p和b帧间的qp偏差
-i_qoffset offset 在p和i帧间的qp偏差
-rc_eq equation 设置码率控制方程 默认tex^qComp
-rc_override override 特定间隔下的速率控制重载
-me method 设置运动估计的方法 可用方法有 zero phods log x1 epzs(缺省) full
-dct_algo algo 设置dct的算法 可用的有 0 FF_DCT_AUTO 缺省的DCT 1 FF_DCT_FASTINT 2 FF_DCT_INT 3 FF_DCT_MMX 4 FF_DCT_MLIB 5 FF_DCT_ALTIVEC
-idct_algo algo 设置idct算法。可用的有 0 FF_IDCT_AUTO 缺省的IDCT 1 FF_IDCT_INT 2 FF_IDCT_SIMPLE 3 FF_IDCT_SIMPLEMMX 4 FF_IDCT_LIBMPEG2MMX 5 FF_IDCT_PS2 6 FF_IDCT_MLIB 7 FF_IDCT_ARM 8 FF_IDCT_ALTIVEC 9 FF_IDCT_SH4 10 FF_IDCT_SIMPLEARM
-er n 设置错误残留为n 1 FF_ER_CAREFULL 缺省 2 FF_ER_COMPLIANT 3 FF_ER_AGGRESSIVE 4 FF_ER_VERY_AGGRESSIVE
-ec bit_mask 设置错误掩蔽为bit_mask,该值为如下值的位掩码 1 FF_EC_GUESS_MVS (default=enabled) 2 FF_EC_DEBLOCK (default=enabled)
-bf frames 使用frames B 帧,支持mpeg1,mpeg2,mpeg4
-mbd mode 宏块决策 0 FF_MB_DECISION_SIMPLE 使用mb_cmp 1 FF_MB_DECISION_BITS 2 FF_MB_DECISION_RD
-4mv 使用4个运动矢量 仅用于mpeg4
-part 使用数据划分 仅用于mpeg4
-bug param 绕过没有被自动监测到编码器的问题
-strict strictness 跟标准的严格性
-aic 使能高级帧内编码 h263+
-umv 使能无限运动矢量 h263+
-deinterlace 不采用交织方法
-interlace 强迫交织法编码仅对mpeg2和mpeg4有效。当你的输入是交织的并且你想要保持交织以最小图像损失的时候采用该选项。可选的方法是不交织,但是损失更大
-psnr 计算压缩帧的psnr
-vstats 输出视频编码统计到vstats_hhmmss.log
-vhook module 插入视频处理模块 module 包括了模块名和参数,用空格分开
(D)音频选项
-ab bitrate 设置音频码率-ar freq 设置音频采样率
-ac channels 设置通道 缺省为1
-an 不使能音频纪录
-acodec codec 使用codec编解码
-acodec copy ;libfaac ;aac;libmp3lame
(E)音频/视频捕获选项
-vd device 设置视频捕获设备。比如/dev/video0
-vc channel 设置视频捕获通道 DV1394专用
-tvstd standard 设置电视标准 NTSC PAL(SECAM)
-dv1394 设置DV1394捕获
-av device 设置音频设备 比如/dev/dsp
(F)高级选项
-map file:stream 设置输入流映射-debug 打印特定调试信息
-benchmark 为基准测试加入时间
-hex 倾倒每一个输入包
-bitexact 仅使用位精确算法 用于编解码测试
-ps size 设置包大小,以bits为单位
-re 以本地帧频读数据,主要用于模拟捕获设备
-loop 循环输入流(只工作于图像流,用于ffserver测试)
分离
比如你的文件是 test.mp4
分离视频出来:ffmpeg -i test.mp4 -vcodec copy -an 视频流.avi
分离音频出来:ffmpeg -i test.mp4 -acodec copy -vn 音频流.mp3
分离字幕
ffmpeg -i xxx.mov -vn -an -scodec copy xxx.sub
选择轨道
分离音频/字幕时,如果没有特别指定,那么通常就会分理出第一条音频/字幕流,要选择特定的数据流时,可以使用map参数。
比如:
ffmpeg -i xxx.mov -map 0:2 -vn -acodec copy xxx.audio
-map input:stream
input:0是指本文件
stream:视频流并非总是在0的位置
可以使用ffmpeg -i xxx.mov来查看顺序
ffmpeg支持多种容器,所以可以用一款软件在mp4/mkv/flv之间变换,在h264越来越普及的今天非常方便。
封装
如果视频流.avi里面的视频编码本身是mpeg4就:
ffmpeg -i 视频流.avi -i 音频流.mp3 -vcodec copy -acodec copy 合并.mp4
如果 视频流.avi里面的视频编码不是mpeg4,而你又想得到mp4就:
ffmpeg -i 视频流.avi -i 音频流.mp3 -vcodec mpeg4 -acodec copy 合并.mp4
参考:
http://www.ffmpeg.com.cn/index.php/Ffmpeg%E5%BF%AB%E9%80%9F%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8
http://blog.csdn.net/jixiuffff/article/details/5709976
http://www.yaosansi.com/post/1273.html