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
  • 1
  • This is not a code writing service, you need to write your own code, and add it to your question, if you want us to assist you with a specific reproducible issue it is exhibiting. – Compo Aug 04 '20 at 19:24

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
  • 16,942
  • 3
  • 35
  • 62