[FFmpeg-user] Dimensions of the input video as a variable
Wolfgang Hugemann
auto at hugemann.de
Tue May 2 18:00:00 EEST 2017
> ffprobe can be used to get width and height for the showwaves size
> option.
This set me on the rigth track!
This is what my Windows batch file now looks like:
SET FFM="c:\programme\ffmpeg\bin\ffmpeg.exe"
SET FFP="C:\programme\ffmpeg\bin\ffprobe.exe"
for /f "tokens=5 delims==_" %%i in ('%FFP% -v error -of flat^=s^=_
-select_streams v:0 -show_entries stream^=width %1') do set W=%%i
for /f "tokens=5 delims==_" %%i in ('%FFP% -v error -of flat^=s^=_
-select_streams v:0 -show_entries stream^=height %1') do set H=%%i
%FFM% -y -i %1 -filter_complex
"[0:a]showwaves=s=%W%x%H%:mode=line,format=rgba[waves];[0:v]setsar=1:1,format=rgba[video];[waves][video]blend=all_mode='addition'"
-c:v libxvid -c:a copy %~dpn1_wav%~x1
-------
The line breaks stem from sending this per e-mail.
Please note that the colour format must be set to rgba in order to make
black background of the waves transparent.
Thanks a lot!
Wolfgang
More information about the ffmpeg-user
mailing list