1. Open cmd, execute chcp 65001
, and modify the encoding format of cmd to utf8 to avoid garbled characters.
2. Execute the command ffmpeg -list_devices true -f dshow -i dummy
to view the audio and video names of the current window.
3. Open the Windows system's "Open Sound Settings" - "Microphone Privacy Settings" - "Allow apps to access your microphone" and click to turn it on.
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