Use ffmpeg to call the computer's built-in camera and speakers to record audio and video

1. Open cmd, execute chcp 65001, and modify the encoding format of cmd to utf8 to avoid garbled characters.
Insert image description here

Insert image description here

2. Execute the command ffmpeg -list_devices true -f dshow -i dummyto view the audio and video names of the current window.
Insert image description here

3. Open the Windows system's "Open Sound Settings" - "Microphone Privacy Settings" - "Allow apps to access your microphone" and click to turn it on.
Insert image description here
Insert image description here

Insert image description here

Record video:

ffmpeg -f dshow -i video="XiaoMi USB 2.0 Webcam" -r 25 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency video.mp4

Record audio:

ffmpeg -f dshow -i audio="麦克风阵列 (英特尔® 智音技术)" -acodec libmp3lame audio.mp3

Record audio and video:

ffmpeg -f dshow -i video="XiaoMi USB 2.0 Webcam":audio="麦克风阵列 (英特尔® 智音技术)" VideoAndAudio.mp4

Use gdigrab to record video of the desktop:

ffmpeg -f gdigrab -framerate 30 -i desktop output.mp4

Use gdigrab to record desktop audio and video:

ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio="麦克风阵列 (英特尔® 智音技术)" output.mp4

Guess you like

Origin blog.csdn.net/qq_23350817/article/details/134296765