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.
This produces a the codec successfully (hevc)
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
However I've been unable to store that result in a variable, I've followed a number of examples which suggest this layout.
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%
however this results this error: "Argument 'noprint_wrappers' provided as input filename, but 'codec_name' was already specified."
I'm really not sure where to go as all my reading suggest that this is the correct way to store the variable.