Create a Batch File to Command ffmpeg to Record 1 Hour of Audio

Опубликовано: 19 Июль 2026
на канале: Joe Gyekis
1,146
2

Silent screencast showing how to create a text file, paste in the text below, and customize it to your computer. For Windows only.

Before you get started, create a folder on your desktop named ffmpeg. Inside that folder, paste ffmpeg.exe (download it online, it's free, just don't click the malware).

Then, copy this text.

@echo off

mkdir "C:\Users\jgyek\Desktop\ffmpeg\"

set outputpath=C:\Users\jgyek\Desktop\ffmpeg\record_20%date:~-2,2%_%date:~-10,2%_%date:~-7,2%_%time:~-11,2%%time:~-8,2%.wav

ffmpeg -f dshow -ac 1 -i audio="Microphone (USB Audio Device)" -y -t 00:59:50 "%outputpath%"

Paste it into a blank text file in your ffmpeg folder. Customize it with your directory location and microphone name as shown in the video. Also you might need to delete any extra spaces at the ends of each command line to get it to work right (especially after the v in wav).

Then after you're done with the text file, rename it from .txt to .bat extension. This is then useful for getting this to be a scheduled task so it can record every night at the same time.

Note: updated text to record single channel wav instead of two channel mp3 as seen in screen recording