文章來源
http://blog.superuser.com/2012/02/24/ffmpeg-the-ultimate-video-and-audio-manipulation-tool/
把 mp4 轉(zhuǎn)化為 flv 指定的編碼格式
ffmpeg?-i?source.mp4?-c:v?libx264?-crf?19?destinationfile.flv
轉(zhuǎn)換命令:
ffmpeg -i "20090401010.mp4" -y -ab 32 -ar 22050 -qscale 10 -s 640*480 -r 15 /opt/a.flv
-i 是 要轉(zhuǎn)換文件名
-y是 覆蓋輸出文件
-ab 是 音頻數(shù)據(jù)流廊营,大家在百度聽歌的時候應該都可以看到 128 64
-ar 是 聲音的頻率 22050 基本都是這個凶掰。
-qscale 是視頻輸出質(zhì)量技掏,后邊的值越小質(zhì)量越高,但是輸出文件就越“肥”
-s 是輸出 文件的尺寸大惺忌堋告材!
-r 是 播放偵數(shù)
ffmpeg -i 1.mp4 -y -ab 32 -c:v libx264 -ar 22050 -acodec copy -qscale 10 -s 1920*960 -r 15 112.flv
-acodec copy 音頻直接拷貝
http://my.oschina.net/zhangxu0512/blog/192804
顯示 音視頻的詳細信息(編碼格式等)
ffprobe /Users/dingfude/Desktop/111.flv
比上面更加詳細
ffprobe -print_format json -show_format -show_streams -i /Users/dingfude/Desktop/111.flv
截取一段視頻中的一部分
ffmpeg -ss 00:00:00 -i "2.mp4" -acodec copy -vcodec copy -t 00:01:00 3.mp4
這行命令解釋為:從文件 2.mp4f 第 00:00 分秒開始,截取 01:00 的時間,其中視頻和音頻解碼不變繁仁,輸出文件名為 3.mp4
dingfudedeMacBook-Pro:desktop dingfude$ man ffmpeg
Show all available encoders.
decoder=decoder_name
Print detailed information about the decoder named
decoder_name. Use the-decodersoption to get a list of all
decoders.
打印指定的解碼器的詳細信息
decoder_name。使用-解碼器選項來獲得所有的列表
解碼器归园。
encoder=encoder_name
Print detailed information about the encoder named
encoder_name. Use the-encodersoption to get a list of all
encoders.
demuxer=demuxer_name
Print detailed information about the demuxer named
demuxer_name. Use the-formatsoption to get a list of all
demuxers and muxers.
打印指定的編碼器的詳細信息
encoder_name黄虱。使用-編碼器選項得到所有的列表
編碼器。
muxer=muxer_name
Print detailed information about the muxer namedmuxer_name.
Use the-formatsoption to get a list of all muxers and
demuxers.
filter=filter_name
Print detailed information about the filter namefilter_name.
Use the-filtersoption to get a list of all filters.
打印muxer_name復用器命名的詳細信息庸诱。
使用格式選項來獲得一個列表中的所有muxers和
分配器捻浦。
ffmpeg-version
Show version.
ffmpeg-formats
Show available formats (including devices).
顯示可用的格式(包括設備)。
ffmpeg-devices
Show available devices.
顯示可用的格式(包括設備)桥爽。
ffmpeg-codecs
Show all codecs known to libavcodec.
Note that the term 'codec' is used throughout this documentation as
a shortcut for what is more correctly called a media bitstream
format.
ffmpeg-decoders可用的解碼器
Show available decoders.
ffmpeg-encoders可用的編解碼器
Show all available encoders.
ffmpeg-bsfs可用的bit流
Show available bitstream filters.
ffmpeg-protocols
Show available protocols.
ffmpeg-filters
Show available libavfilter filters.
ffmpeg-pix_fmts
Show available pixel formats.
ffmpeg-sample_fmts
Show available sample formats.
ffmpeg-layouts
Show channel names and standard channel layouts.
ffmpeg-colors
Show recognized color names.
http://www.cnblogs.com/youngt/p/3768155.html
?可用的bit流 :ffmpeg –bsfs
?可用的編解碼器:ffmpeg –codecs
?可用的解碼器:ffmpeg –decoders
?可用的編碼器:ffmpeg –encoders
?可用的過濾器:ffmpeg –filters
?可用的視頻格式:ffmpeg –formats
?可用的聲道布局:ffmpeg –layouts
?可用的license:ffmpeg –L
?可用的像素格式:ffmpeg –pix_fmts
?可用的協(xié)議:ffmpeg -protocols