title: batch store ffprobe as variable
body: <p>I'm looking to store the video codec as a variable in a batch file to automate some video conversion, but not wanting to convert things which are already the right codec.</p>
  
  <p>This produces a the codec successfully (hevc)</p>
  
  <pre><code>C:\ffmpeg\bin\ffprobe.exe -v error -select_streams v:0 -show_entries` stream=codec_name -of default=noprint_wrappers=1:nokey=1 video.mkv
  pause
  </code></pre>
  
  <p>However I've been unable to store that result in a variable, I've followed a number of <a href="https://stackoverflow.com/questions/40097486/ffmpeg-store-ffprobes-duration-output-as-a-variable">examples</a> which suggest this layout. </p>
  
  <pre><code>for /F "delims=" %%I in ('C:\ffmpeg\bin\ffprobe.exe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 video.mkv') do set "codec=%%I"
  echo %codec%
  </code></pre>
  
  <p>however this results this error: "Argument 'noprint_wrappers' provided as input filename, but 'codec_name' was already specified."</p>
  
  <p>I'm really not sure where to go as all my reading suggest that this is the correct way to store the variable.</p>