I created a batch script for windows that I use for mux mkv files. When launch this command:
ffprobe -v 0 -select_streams s -show_entries stream=index:disposition=default -of compact=nk=0 file.mkv | findstr disposition:default=1
Output is:
stream|index=3|disposition:default=1
How can filter and print only number "3" and put it in a variable?
Batchfile approach
You need to execute your command inside a
forstatement inside a batch file to be able to capture the output lines and process them further. Checkfor /?on the command line and the part withfor /fand learn about "usebackq".The key point is, that you need to escape several special characters from your command, if it is executed in the for statement and not on the command line prompt directly.
Try getting this piece to work and post your solution as update to your answer if you like. Then we can get to the second part of extracting the number.