作者:yiqing020308 | 来源:互联网 | 2023-09-12 13:54
欢迎转载请注明出处:海漩涡
http://blog.csdn.net/tanhuifang520
ffmpeg命令录制windows音视频
一、下载ffmpeg
存放在windows上的某个目录
https://pan.baidu.com/s/1JH_NMM09A-ezMY0A6mUWGg
二、安装screen capture recorder
(1)下载安装
http://sourceforge.net/projects/screencapturer/files/

我下载的是2017-11-03的
(2)ffmpeg查看DirectShow视频设备,和音频设备
cd到windows存放ffmpeg的目录,运行下命令
ffmpeg -list_devices true -f dshow -i dummy

查看到如上图红圈中的内容,则安装正确
三、开始录制
(1)只录制音频
ffmpeg -f dshow -i audio="virtual-audio-capturer" -acodec libmp3lame window.mp3

上图所示即在正常录制。需要停止时按字母键“q”。
在ffmpeg目录下即可看到录制好的mp3音频文件

(2)只录制视频
ffmpeg -f dshow -i video="screen-capture-recorder" -r 5 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency MyDesktop.mp4

上图所示即在正常录制。需要停止时按字母键“q”。
在ffmpeg目录下即可看到录制好的MyDesktop.mp4视频文件

(3)录制音频和视频
ffmpeg -f dshow -i video="screen-capture-recorder" -f dshow -i audio="virtual-audio-capturer" -pix_fmt yuv420p -vcodec libx264 -acodec libvo_aacenc -s 1280x720 -r 25 -q 10 -ar 44100 -ac 2 -tune zerolatency -preset ultrafast -f mpegts - | ffmpeg -f mpegts -i - -c copy -bsf:a aac_adtstoasc -f flv temp.flv

在ffmpeg目录下即可看到录制好的tmp.flv视频文件

参考:
http://blog.csdn.net/redstarofsleep/article/details/45092151
http://blog.csdn.net/leixiaohua1020/article/details/38284961
欢迎转载请注明出处:海漩涡
http://blog.csdn.net/tanhuifang520