多媒体ffmpeg
目前比较流行的音视频文件为:MP4 flv m3u8
ffmpeg
ffmpeg ffplay ffprobe ffserver
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip];[main][flip] overlay=0:H/2" OUTPUT
ffmpeg -i 2022.mp4 -vcodec mpeg4 -b:v 200k -r 15 -an output.rmvb
ffmpeg -h demuxer=mp4
ffmpeg -i input.flv -c copy -f mp4 -movflags dash output.mp4
ffmpeg -i 2022.mp4 -c copy -f flv output.flv
ffmpeg -i 2022.mp4 -vcodec copy -acodec aac -f flv output.flv
ffmpeg -i 2022.mp4 -c copy -f flv -flvflags add_keyframe_index add_keyframe_index.flv
ffmpeg -re -i 2022.mp4 -c copy -f hls -bsf:v h264_mp4toannexb output.m3u8
切割音视频
ffmpeg -re -i 2022.mp4 -c copy -f segment -segment_format mp4 test_output-%d.mp4ffprobe -v quiet -show_packets -select_streams v test_output-0.mp4 2> x | grep pts_time | tail -n 3ffmpeg -ss 10 -i 2022.mp4 -c copy output1de.ts
抽取音频流
ffmpeg -i 2022.mp4 -vn -acodec copy output.aac
抽取H264视频流
ffmpeg -i 2022.mp4 -vcodec copy -an output.h264
抽取H265数据
ffmpeg -i 2022.mp4 -vcodec copy -an -bsf hevc_mp4toannexb -f hevc output.hevc
ffmpeg -h encoder=libx264
ffmpeg -hide_banner -codecs | grep h264
转码
ffmpeg -i 2022.mp4 -vcodec libx264 -preset ultrafast -b:v 2000k out.mp4ffmpeg -i 2022.mp4 -vcodec libx264 -preset medium -b:v 2000k out.mp4ffmpeg -i 2022.mp4 -vcodec libx264 -profile:v baseline -level 3.1 -s 352x288 -an -y -t 10 output_baseline.tsffmpeg -i 2022.mp4 -vcodec libx264 -profile:v high -level 3.1 -s 352x288 -an -y -t 10 output_high.tsffmpeg -i 2022.mp4 -c:v libx264 -g 50 -t 60 demo.mp4
转码: 控制GOP长度 sc_threshold
ffmpeg -i 2022.mp4 -c:v libx264 -g 50 -sc_threshold 0 -t 60 -y outputs1.mp4
设置内部参数 x264opts
ffmpeg -i 2022.mp4 -c:v libx264 -x264opts "bframes=0" -g 50 -sc_threshold 0 demo.mp4
ffmpeg -i 2022.mp4 -c:v libx264 -x264opts "bframes=0:b-adapt=0" -g 50 -sc_threshold 0 demo.mp4ffmpeg -i 2022.mp4 -c:v libx264 -x264opts "bframes=10:b-adapt=0" -b:v 1000k -maxrate 1000k -minrate 1000k -bufsize 50k -nal-hrd cbr -g 50 -sc_threshold 0 demo01.mp4
硬件编码
nvidia GPU和Intel QSV
ffmpeg -h encoder=h264_nvenc # intel
ffmpeg -h encoder=h264_cuvid # nvidiaffmpeg -hwaccel cuvid -vcodec h264_cuvid -i 2022.mp4 -vf scale_npp=1920:1080 -vcodec h264_nvenc -acodec copy -f mp4 -y sss.mp4
Inter QSV
root@ai-evaluation-test:~# ffmpeg -hide_banner -codecs | grep h264DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_crystalhd h264_v4l2m2m h264_vdpau h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )ffmpeg -i 2022.mp4 -pix_fmt nv12 -vcodec h264_qsv -an -y outputqsv.mp4ffmpeg -hide_banner -y -hwaccel qsv -i 2022.mp4 -an -c:v hevc_qsv -load_plugin hevc_hw -b:v 5M -maxrate 5M out.mp4ffmpeg -h decoder=h264_videotoolbox
支持mp3编码:
ffmpeg -h encoder=libmp3lameffmpeg -i sample-3s.mp3 -acodec libmp3lame sample-3s-demo.mp3 # 编码
设置MP3码率为CBR
ffmpeg -i sample-3s.mp3 -acodec libmp3lame -b:a 64k ss.mp3
设置MP3的码率为 ABR
ffmpeg -i sample-3s.mp3 -acodec libmp3lame -b:a 64k -abr 1 ss.mp3
AAC编码器的使用
ffmpeg -i 2022.mp4 -c:a aac -b:a 160k output.aac # 抽取aac格式的语音流
ffmpeg -i 2022.mp4 -c:a aac -q:a 2 output.mp4
libfdk_acc使用例子
ffmpeg -i 2022.mp4 -c:a libfdk_aac -b:a 128k ssdemo.mp4ffmpeg -i 2022.mp4 -c:v copy -c:a libfdk_aac -b:a 384k ssde.mp4ffmpeg -i 2022.mp4 -c:a libfdk_aac -vbr 3 outsdee.mp4
AAC音频分为三种: LC HE-AAC HEv2-AAC
he-aac
ffmpeg -i 2022.mp4 -c:a libfdk_aac -profile:a aac_he -b:a 64k ssde.m4a
hev2-acc
ffmpeg -i 2022.mp4 -c:a libfdk_aac -profile:a aac_he_v2 -b:a 64k ssde.m4a
ffprobe
查看音视频有多少个包
ffprobe -show_packets 2022.mp4
ffprobe -show_packets -show_data 2022.mp4
查看音视频封装格式
ffprobe -show_format 2022.mp4
查看音视频帧信息
ffprobe -show_frames 2022.mp4
查看音视频流信息
ffprobe -show_streams 2022.mp4
指定输出格式-of
ffprobe -show_streams -of ini 2022.mp4
ffprobe -show_frames -select_streams v -of xml 2022.mp4
分析flv文件格式音视频
ffprobe -v trace -i add_keyframe_index.flv分析每一帧包含I帧P帧B帧的情况:
ffprobe -v quiet -show_frames -select_streams v output_baseline.ts | grep "pict_type=B" | wc -l
ffprobe -v quiet -show_frames -select_streams v output_high.ts | grep "pict_type=B" | wc -l
ffplay
从第5秒开始放,播放10秒
ffplay -ss 5 -t 10 2022.mp4
ffplay -window_title "AUTEL DEMo" -ss 5 -t 10 -autoexit 2022.mp4
自定义标题
ffplay -window_title "AUTEL DEMo" 2022.mp4
打开网络直播流
ffplay -window_title "AUTEL DEMo" rtmp://up.v.test.com/live/streamffplay -vcodec h264 2022.mp4
播放视频流编号为4,音频流编号为5
ffplay -vst 4 -ast 5 2022.mp4
ffplay -window_title "Test Movie" -vf "subtitles=input.srt" 2022.mp4
MP3
ffplay -showmode 1 sample-3s.mp3
宏块
ffplay -debug vis_mb_type -window_title "show vis_mb_type" -ss 5 -t 10 -autoexit 2022.mp4
ffplay -vismv pf 2022.mp4
ffplay -flags2 +export_mvs -ss 5 2022.mp4 -vf codecview=mv=pf+bf+bb
RTMP
rtmp_app参数:
ffmpeg -rtmp_app live -i rtmp://publish.chinaffmpeg.com -c copy -f flv demo.flv
ffmpeg -re -i 2022.mp4 -c copy -f flv -rtmp_app live rtmp://publish.chinaffmpeg.com
rtmp_playpath参数:
ffmpeg -re -i 2022.mp4 -c copy -f flv -rtmp_app live -rtmp_playpath class rtmp://puhlish.chinaffmpeg.com#拉流
ffmpeg -rtmp_app live -rtmp_playpath class -i rtmp://publish.chinaffmpeg.com -c copy -f flv ssd.flv#推流
ffmpeg -i 2022.mp4 -c copy -f flv rtmp://publish.chinaffmpeg.com/${rtmp_app}/${rtmp_playpath}ffmpeg -i 2022.mp4 -c copy -f flv rtmp://publish.chinaffmpeg.com/live/class#拉流
ffmpeg -i rtmp://publish.chinaffmpeg.com/live/class -c copy -f flv sde.flv
rtmp_pageurl参数
ffmpeg -rtmp_pageurl "http://wwww.chinaffmpeg.com" -i rtmp:/publish.chinaffmpeg.com/live/class
RTSP
查看帮助
ffmpeg -h demuxer=RTSP
rtsp_transport 参数
ffmpeg -rtsp_transport tcp -i rtsp://47.90.47.25/test.ts -c copy -f mp4 ds.mp4 #录制流
user-agent参数
ffmpeg -user-agent "ChinaFFmpeg-Player" -i rtsp://input:554/live/1/stream.sdp -c copy -f mp4 -y ssee.mp4
TS流: TS流(Transport Stream,传输流):*是将一个节目的多个组成部分按照它们之间的互相关系进行组织并加入各组成部分关系描述和节目组成信息,并进一步封装成传输包后的码流*。TS流是将视频、音频、PSI等数据打包成传输包进行传送
HTTP
seekable参数举例
ffmpeg -ss 30 -seekable 0 -i http://bbs.chinaffmpeg.com/test.ts -c copy ssdfsa.mp4
ffmpeg -ss 30 -seekable 1 -i http://bbs.chinaffmpeg.com/test.ts -c copy -y ss.mp4
headers 参数
ffmpeg -headers "referer: http://bbs.chinaffmpeg.com/index.html" -i http://play.chinaffmpeg.com/live/class.flv -c copy -f flv -y sdaa.flv
uaser_agent参数
ffmpeg -user_agent "LiuQi's Player" -i http://bbs.chinaffmpeg.com/1.flv
拉流
ffmpeg -i http://bbs.chinaffmpeg.com/live.flv -c copy -f flv outss.flv
ffmpeg -i http://bbs.chinaffmpeg.com/live.ts -c copy -f flv outss.flv
ffmpeg -i http://bbs.chinaffmpeg.com/live.m3u8 -c copy -f flv outss.flv
TCP
拉流
fmpeg -listen 1 -f flv -i tcp://127.0.0.1:1234/live/stream -c copy -f flv ssd.flv
发布流
ffmpeg -re -i 2022.mp4 -c copy -f flv tcp://127.0.0.1:1234/live/streamffmpeg -listen_timeout 5000 -listen 1 -f flv -i tcp://127.0.0.1:1234/live/stream -c copy -f flv oude.flv
ffmpeg -timeout 20000000 -listen 1 -f flv -i tcp://127.0.0.1:1935/live/stream -c copy -f flv oude.flv
设置buffer大小流
ffmpeg -re -i 2022.mp4 -c copy -send_buffer_size 265 -f flv tcp://192.168.100.179:1234/live/stream
UDP
ffmpeg -re -i 2022.mp4 -c copy -localport 23456 -f flv udp://192.168.100.179:1234/live/stream
推多路流
管道方式输出多路流
ffmpeg -i 2022.mp4 -acodec aac -vcodec libx264 -f flv - | ffmpeg -f mpegts -i - -c copy output1 -c copy output2 -c copy output3# 推2路流
ffmpeg -i 2022.mp4 -vcodec libx264 -acodec aac -f flv - | ffmpeg -f flv -i - -c copy -f flv rtmp://publish.chinaffmpeg.com/live/stream1 -c copy -f flv rtmp://pubpish.chinaffmpeg.com/live/stream2
# 验证
ffmpeg -i rtmp://publish.chinaffmpeg.com/live/stream1 -i rtmp://publish.chinaffmpeg.com/live/stream2
tee封装格式输出多路流
# 推流
ffmpeg -re -i 2022.mp4 -vcodec libx264 -acodec aac -map 0 -f tee "[f=flv] rtmp://publish.chinaffmpeg.com/live/stream1 | [f=flv] rtmp://publish.chinaffmpeg.com/live/stream2"# 拉流
ffmpeg -i rtmp://publish.chinaffmpeg.com/live/stream1 -i rtmp://publish.chinaffmpeg.com/live/stream2ffmpeg -re -i 2022.mp4 -ccodec libx264 -acodec aac -f flv "tee:rtmp://publish.chinaffmpeg.com/live/stream1|rtmp://publish.chinaffmpeg.com/live/stream2"
生成HDS流
ffmpeg -h muxer=hds # 查看hds帮助信息
window_size 参数控制文件列表大小
ffmpeg -i 2022.mp4 -c copy -f hds -window_size 4 llll.mp4
root@ai-evaluation-test:~/llll.mp4# ls -lrt
total 14196
-rw-r--r-- 1 root root 3770540 10月 13 14:10 stream0Seg1-Frag1
-rw-r--r-- 1 root root 3806068 10月 13 14:10 stream0Seg1-Frag2
-rw-r--r-- 1 root root 3848563 10月 13 14:10 stream0Seg1-Frag3
-rw-r--r-- 1 root root 3093703 10月 13 14:10 stream0Seg1-Frag4
-rw-r--r-- 1 root root 154 10月 13 14:10 stream0.abst
-rw-r--r-- 1 root root 615 10月 13 14:10 index.f4m
extra_window_size 参数控制文件个数
ffmpeg -re -i 2022.mp4 -c copy -f hds -window_size 4 -extra_window_size 1 outputdemo
root@ai-evaluation-test:~/outputdemo# ls -lrt
total 14196
-rw-r--r-- 1 root root 3770540 10月 13 14:14 stream0Seg1-Frag1
-rw-r--r-- 1 root root 3806068 10月 13 14:15 stream0Seg1-Frag2
-rw-r--r-- 1 root root 3848563 10月 13 14:15 stream0Seg1-Frag3
-rw-r--r-- 1 root root 3093703 10月 13 14:15 stream0Seg1-Frag4
-rw-r--r-- 1 root root 154 10月 13 14:15 stream0.abst
-rw-r--r-- 1 root root 617 10月 13 14:15 index.f4m
生成DASH流
ffmpeg -h muxer=dash
window_size 与extra_window_size参数举例
ffmpeg -re -i 2022.mp4 -c:v copy -acodec copy -f dash -window_size 4 -extra_window_size 5 index.mpd
single_file参数验证
ffmpeg -re -i ../2022.mp4 -c:v copy -acodec copy -f dash -window_size 4 -extra_window_size 5 -single_file 1 index.mpd
为视频加logo
ffmpeg -i 2022.mp4 -i ion-credit.png -filter_complex "[1:v] scale=176:144[ion-credit];[0:v][ion-credit]overlay=x=0:y=0" sddsaad.mp4
为视频增加水印: drawtext滤镜参数
ffmpeg -i 2022.mp4 2022.mp4 -vf "drawtext=fontsize=100:fontfile=FreeSerif.ttf:text='Autel':x=20:y=20" ssaa3r2r.mp4ffmpeg -i 2022.mp4 -vf "drawtext=fontsize=100:fontfile=FreeSerif.ttf:text='Autel':x=20:y=20:fontcolor=green" ssaa3r2r.mp4ffmpeg -i 2022.mp4 -vf "drawtext=fontsize=100:fontfile=FreeSerif.ttf:text='Autel':x=20:y=20:fontcolor=green:box=1:boxcolor=yellow" ssaa3r2r.mp4
为视频添加本地时间 drawtext滤镜
ffmpeg -re -i 2022.mp4 -vf "drawtext=fontsize=60:fontfile=FreeSerif.ttf:text='%{localtime\:%Y\-%m\-%d %H-%M-%S}':x=20:y=20:fontcolor=green:box=1:boxcolor=yellow" ssaa3r2r.mp4# 闪烁效果
ffmpeg -re -i 2022.mp4 -vf "drawtext=fontsize=60:fontfile=FreeSerif.ttf:text='test':x=20:y=20:fontcolor=green:box=1:boxcolor=yellow:enable=lt(mod(t\,3)\,1)" ssaa3r2r.mp4
为视频加图片水印 movie滤镜
ffmpeg -i 2022.mp4 -vf "movie=ion-credit.png[wm]; [in][wm]overlay=30:10[out]" sdsemdeosa.mp4ffmpeg -i 2022.mp4 -vf "movie=ion-credit.png,colorkey=black:1.0:1.0[wm]; [in][wm]overlay=30:10[out]" sdsemdeosa.mp4
生成画中画 overlay滤镜
# 左上角
ffmpeg -re -i 2022.mp4 -vf "movie=ssaa3r2r.mp4,scale=480x320[test];[in][test]overlay[out]" -vcodec libx264 out20231024.flv#右上角
ffmpeg -re -i 2022.mp4 -vf "movie=ssaa3r2r.mp4,scale=480x320[test];[in][test]overlay=x=main_w-480:y=main_h-320[out]" -vcodec libx264 out20231024.flvffmpeg -re -i 2022.mp4 -vf "movie=ssaa3r2r.mp4,scale=480x320[test];[in][test]overlay=x='if(gte(t,2),-w+(t-2)*20,NAN)':y=0[out]" -vcodec libx264 out20231024.flv# 视频多宫格
ffmpeg -re -i 2022.mp4 -re -i out20231024.flv -re -i output.flv -re -i outputs1.mp4 -filter_complex "nullsrc=size=640x480[base];[0:v]setpts=PTS-STARTPTS,scale=320x240[upperleft];[1:v]setpts=PTS-STARTPTS,scale=320x240[upperright];[2:v]setpts=PTS-STARTPTS,scale=320x240[lowerleft];[3:v]setpts=PTS-STARTPTS,scale=320x240[lowerright];[base][upperleft]overlay=shortest=1[tmp1];[tmp1][upperright]overlay=shortest=1:x=320[tmp2];[tmp2][lowerleft]overlay=shortest=1:y=240[tmp3];[tmp3][lowerright]overlay=shortest=1:x=320:y=240" -c:v libx264 dems.flv
音频相关:
ffmpeg -layoutsffmpeg -i 2323.mp3 -ac 1 output.aacffmpeg -i 2323.mp3 -map_channel 0.0.0 left.aac -map_channel 0.0.1 right.aacffmpeg -i 2323.mp3 -filter_complex "[0:0]pan=1c|c0=c0[left];[0:0]pan=1c|c0=c1[right]" -map "[left]" left.aac -map "[right]" right.aacffmpeg -i 2323.mp3 -filter_complex channelsplit=channel_layout=stereo output.mka# 单声道传双声道ffmpeg -i left.aac -ac 2 output.m4affmpeg -i left.aac -filter_complex "[0:a][0:a]amerge=inputs=2[out]" -map "[out]" output.m4affmpeg -i left.aac -i right.aac -filter_complex "[0:a][1:a]amerge=inputs=2[aout]" -map "[aout]" output.mkaffmpeg -i 2323.mp3 -i 2323.mp3 -i 2323.mp3 -i 2323.mp3 -i 2323.mp3 -i 2323.mp3 -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[aout]" -map "aout" output.wav
音频音量
# 获取音频音量
ffmpeg -i 2323.mp3 -filter_complex volumedetect -c:v copy -f null /dev/null# 绘制音频波形
ffmpeg -i 2323.mp3 -filter_complex "showwavespic=s=640x120" -frames:v 1 ooo.png# 绘制不同声道的波形 split_channels
ffmpeg -i 2323.mp3 -filter_complex "showwavespic=s=640x120:split_channels=1" -frames:v 1 ooo.png
为视频加字幕
ASS字幕流写入视频流
ffmpeg -i 2022.mp4 -vf ass=t1.ass -f mp4 output.mp4
ASS字幕流写入封装容器
ffmpeg -i 2022.mp4 -i t1.ass -acodec copy -vcodec copy -scodec copy out.mkv
ffmpeg -i 2022.mp4 -i t1.ass -map 0:0 -map 0:1 -map 1:0 -acodec copy -vcodec copy -scodec copy out.mkv
视频抠图合并chromakey
查询背景颜色
ffmpeg -colorsffmpeg -i 2022.mp4 -i input_green.mp4 -filter_complex "[1:v]chromakey=Green:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" ddessaa.mp4colorkey
3D视频处理 stereo3d
播放3D视频
ffplay -vf "stereo3d=sbsl:aybd" 2022.mp4ffplay -vf "stereo3d=sbsl:aybg" 2022.mp4
定时视频截图vframe参数和 fps滤镜
ffmpeg -i 2022.mp4 -ss 00:00:7.435 -vframes 1 out.png# 定时截图
"/root/srs/"
ffmpeg -i 2022.mp4 -vf fps=1 out%d.png # 1s
ffmpeg -i 2022.mp4 -vf fps=1/60 out%d.png # 1min
ffmpeg -i 2022.mp4 -vf fps=1/600 out%d.png # 10min# select
ffmpeg -i 2022.mp4 -vf "select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr thumb%04d.png
生成音视频
ffmpeg -re -f lavfi -i abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo -acodec aac -y outputaac.aacffmpeg -re -f lavfi "aevalsrc=sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC" -acodec aac output111.aac
生成视频流
ffmpeg -re -f lavfi -i testsrc=duration=5.3:size=qcif:rate=25 -vcodec libx264 -r:v 25 ssssss.mp4ffmpeg -re -f lavfi -i testsrc2=duration=5.3:size=qcif:rate=25 -vcodec libx264 -r:v 25 ssssss.mp4ffmpeg -re -f lavfi -i color=c=red@0.2:s=qcif:r=25 -vcodec libx264 -r:v 25 ssssss.mp4
音视频的倍速处理 atempo setpts
atempo
ffmpeg -i 2022.mp4 -filter_complex "atempo=tempo=0.5" -acodec aac output11.aac ## 0.5倍处理
ffmpeg -i 2022.mp4 -filter_complex "atempo=tempo=2.0" -acodec aac output11.aac ## 2倍处理
setpts
ffmpeg -re -i 2022.mp4 -filter_complex "setpts=PTS*2" ssde.mp4 # 半速处理ffmpeg -re -i 2022.mp4 -filter_complex "setpts=PTS/2" ssde.mp4 # 2倍处理
采集设备
ffmpeg -hide_banner -devices # 查看采集设备
ffmpeg -h demuxer=fbdev## 帧率
ffmpeg -framerate 30 -f fbdev -i /dev/fb0 ss.mp4## v412
ffmpeg -h demuxer=v412
ffmpeg -hide_banner -f v412 -list_formats all -i /dev/video0ffmpeg -hide_banner -s 1920x1080 -i /dev/video0 output.avi#x11grab 录制桌面
ffmpeg -f x11grab -framerate 25 -video_size 1366x768 -i :0.0 sssde.mp4
ffmpeg -f x11grab -framerate 25 -video_size 352x288 -i :0.0+300,200 out123.mp4 ## 指定录制区域
ffmpeg -f x11grab -video_size 1366x768 -follow_mouse 1 -i :0.0 out123.mp4 # 录制带鼠标的方法## mac os
ffmpeg -devices
ffmpeg -f avfoundation -list_devices true -i ""
# 采集内置摄像头
ffmpeg -f avfoundation -i " FaceTime HD Camera (Built-in)" demo.mp4
#采集OS X桌面
ffmpeg -f avfoundation -i "Capture screen 0" -r:v 30 out.mp4
# 录制鼠标
ffmpeg -f avfoundation -capture_cursor 1 -i "Capture screen 0" -r:v 30 out.mp4
# 采集麦克风
ffmpeg -f acfoundation -i "0:0" out.aac
ffmpeg -f acfoundation -video_device_index 0 -i ":0" out.aac
ffmpeg -f acfoundation -video_device_index 0 -audio_device_index 0 out.aac# windows dshow
ffmpeg.exe -f dshow -list_devices true -i dummy
ffmpeg.exe -f dshow -video_size 1280x720 -i video="Integrated Webcam" s.mp4
ffmpeg.exe -f dshow -i video="Integrated Webcam" -f dshow -i audio="Virtual-audio-capturer" .\s.mp4
# windows vfwcap
ffmpeg.exe -f vfwcap -i list
ffmpeg.exe -f vfwcap -i 0 -r 25 -vcodec libx264 out.mp4 # 生成mp4#windows gdigrab
ffmpeg.exe -f gdigrab -framerate 6 -i desktop out.mp4 # 采集桌面
ffmpeg.exe -f gdigrab -framerate 6 -i title=ffmpeg out.mp4 # 采集某个窗口
ffmpeg.exe -f gdigrab -framerate 6 -offset_x 50 -offset_y 50 -video_size 400x400 -i title=ffmpeg out.mp4 # 采集窗口指定区域
音频种类
WAV MP3 AAC Ogg
RGB
视频种类
YUV表示