Skip to content

Instantly share code, notes, and snippets.

@heitara
Last active August 5, 2016 07:05
Show Gist options
  • Save heitara/8d112d5d177ad8248c35dc044d34b341 to your computer and use it in GitHub Desktop.
Save heitara/8d112d5d177ad8248c35dc044d34b341 to your computer and use it in GitHub Desktop.
Record video using ffmpeg
@echo off
rem batch file which starts video recording
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
rem echo %MyDate%
set today=%MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2%
set time=%MyDate:~8,2%-%MyDate:~10,2%
set filename=%today%_%time%.mp4
echo %today%
title Recording %filename%. To stop it press Ctrl+C!
rem ffmpeg -y -f vfwcap -r 25 -i "default:default" out.mp4
rem change teh active disk
rem c:
rem change teh active directory
cd c:\video_recording\videos
rem start recording. To stop it press Ctrl+C
rem ffmpeg -y -f vfwcap -r 25 -i "default:default" %filename%
ffmpeg -f dshow -i video="A4 TECH USB2.0 PC Camera J":audio="Microphone (USB2.0 Camera Audio" %filename%
rem wait for a key press
PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment