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!

0

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.