ffmpeg常用命令
ffmpeg常用命令
1 | ffmpeg --help |
查看ffmpeg的帮助信息
1 | ffmpeg -version |
查看ffmpeg的版本以及子模块的版本信息
1 | ffmpeg -formats |
查看ffmpeg支持的封装格式
1 | ffmpeg -codecs | ffmpeg -decoders | ffmpeg -encoders |
查看ffmpeg支持的编解码格式
1 | ffmpeg -filters |
查看ffmpeg支持的滤镜
1 | ffmpeg -h muxer/demuxer/encoder/decoder/filter=name |
查看特定封装器、解封装器、编码器、解码器、滤镜支持的操作参数
ffprobe常用命令
1 | ffprobe --help |
查看ffprobe的帮助信息
1 | ffprobe -show_packets input.mp4 |
查看input.mp4多媒体数据包信息 以及 具体数据
1 | ffpeobe -show_format input.mp4 |
查看input.mp4的多媒体封装格式
1 | ffprobe -show_frames input.mp4 |
查看input.mp4视频文件中的帧信息
1 | ffprobe -show_streams input.mp4 |
查看input.mp4多媒体文件中的流信息
1 | ffprobe -print_format / -of xml/json/csv -show_packets / -show_format / ··· input.mp4 |
使用-print_format或-of格式化输出相关内容,支持XML、INI、JSON、CSV、FLAT等格式
1 | ffprobe -show_frames -of xml -select_streams a/v/s input.mp4 |
使用-select_streams仅查看视频(v),音频(a),字幕(s) 信息
ffplay常用命令
1 | ffplay --help |
查看ffplay的帮助信息
1 | ffplay -ss 10 input.mp4 |
将input.mp4定位到第10秒开始播放
1 | ffplay -ss 10 -t 20 input.mp4 |
将input.mp4定位到第10秒开始播放,累计播放20秒后关闭
1 | ffplay -window_title "PLAY TEST" input.mp4 |
自定义播放器窗口显示的标题
1 | ffplay -window_title "网络直播流" rtmp://up.v.test.com/live/stream |
使用ffplay打开网络直播流
1 | ffplay -window_title "PLAY TEST" -ss 5 -t 10 -autoexit input.mp4 |
-autoexit使多媒体播放完毕后退出ffplay,默认情况下播放完毕后不退出
1 | ffplay -vcodec h264 input.mp4 |
-vcodec强制使用指定的解码器解码多媒体文件
1 | ffplay -ast 5 -vst 4 -sst 3 input.ts |
视频流出现多个Program时,使用-ast指定播放的音频流,使用-vst指定播放的视频流,使用-sst指定播放的字幕流
1 | ffplay -vf "subtitles=input.srt" input.mp4 |
-vf设置视频滤镜,subtitles指定字幕滤镜,.srt为字幕文件
1 | ffplay -showmode 0/1/2 input.mp3 |
-showmode设置音频播放模式,可以用于音频可视化分析