I need to get the width and height of an image file using ffprobe and need to store it in variables using batch (Windows) so I can later use those values.
I tried to do this,
@echo off
for /f "tokens=1-2" %%i in ('ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=width,height %1') do set W=%%i & set H=%%j
echo %W%
echo %H%
But fails to execute with
Argument '_' provided as input filename, but 's' was already specified.
p.s. I also tried imagemagick identify in a similar way, but it seems that identify has a bug when returning height for GIF files