0

I use the ffmpeg -stats -hide_banner -list_devices true -f dshow -i dummy command to list all video and audio devices, and I need to get all Alternative name From "DirectShow video devices" (just video devices) with batch script.

I'm start with this: ffmpeg output parse in batch script (first answer)

Can someone more experienced to help me with this task? Thanks in advance!

ubul
  • 13
  • 2

1 Answers1

1

Refer to @Endoro answer here ffmpeg output parse in batch script.

You can tweak it to get only Video Device List

@echo off
Title ffmpeg list video devices with batch script to variables
set "VideoDevice="
@For /f tokens^=1^,2delims^=^" %%a in (
'ffmpeg -stats -hide_banner -list_devices true -f dshow -i dummy 2^>^&1 ^| findstr /c:"Alternative name"'
) do (
   if not defined VideoDevice (
      set "VideoDevice=%%~b"
   )
)
echo Video Device : "%VideoDevice%"
pause
Hackoo
  • 18,337
  • 3
  • 40
  • 70