D
D
Daddy_Cool2019-08-03 11:13:38
Audio
Daddy_Cool, 2019-08-03 11:13:38

How to capture video and audio at the same time with ffmpeg under Windows?

I'm trying to capture both video and audio at the same time using ffmeg under Windows. I cannot use other capture programs - although if there are console programs, please recommend.
I found a pretty decent command line (with a bunch of options) and the video is decent quality, but no sound. You need to add sound. About capturing with sound is written here:
www.trishtech.com/2018/02/record-windows-desktop-screen-with-sound-using-ffmpeg
They write that you need to install direct show. After that, the first method stops working,
and the line from the article like:
ffmpeg -f dshow -i video="UScreenCapture":audio="Stereo Mix (Realtek High Definition Audio)" "C:\videos\out.mp4"
writes sound, but does something terrible with the video (everything falls into squares and stripes).
Can you help me with a good command line?
Everything happens under Windows.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
crovin, 2020-02-14
@crovin

The following command worked for me:
ffmpeg.exe -y -rtbufsize 100M -f gdigrab -framerate 30 -probesize 10M -draw_mouse 1 -i desktop -f dshow -i audio=" Stereo Mix (Realtek High Definition Audio)" -c:v libx264 -r 30 -preset ultrafast -tune zerolatency -crf 25 -pix_fmt yuv420p screen.mp4
Apply two filters -f gdigrab to capture screen video and -f dshow to capture audio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question