title: ffmpeg output parse in batch script
body: <p>I am totally unfamiliar with scripts in Windows, but are forced to use such a script. I would like someone to help me with the following problem. I want to process the output from ffmpeg command to save information about access an webcam to be used later.
  More precisely command is following:</p>
  
  <pre><code>ffmpeg -stats -hide_banner -list_devices true -f dshow -i dummy
  </code></pre>
  
  <p>and output is like this:</p>
  
  <pre><code>[dshow @ 02cec400] DirectShow video devices (some may be both video and audio devices)
  [dshow @ 02cec400]  "Microsoft LifeCam Studio"
  [dshow @ 02cec400]     Alternative name "@device_pnp_\\?\usb#vid_045e&amp;pid_0772&amp;mi_00#6&amp;2a15e69b&amp;0&amp;0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
  [dshow @ 02cec400] DirectShow audio devices
  [dshow @ 02cec400]  "Desktop Microphone (3- Studio -"
  [dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Desktop Microphone (3- Studio -"
  [dshow @ 02cec400]  "Line In (High Definition Audio "
  [dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Line In (High Definition Audio "
  [dshow @ 02cec400]  "Microphone (High Definition Aud"
  [dshow @ 02cec400]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Microphone (High Definition Aud"
  </code></pre>
  
  <p>Typically, the first two occurence for ”Alternative name” from DirectShow correspond to video and audio, so for simplicity I want these two information saved in two variables.
  In this example is:</p>
  
  <pre><code>@device_pnp_\\?\usb#vid_045e&amp;pid_0772&amp;mi_00#6&amp;2a15e69b&amp;0&amp;0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Desktop Microphone (3- Studio -
  </code></pre>
  
  <p>Can someone more experienced to help me with this task?
  Thanks in advance!    </p>