In windows, How does one change STDERR before writing it to an out file?
The goal is to create one log file containing all the ffmpeg integrity errors.
ffmpeg-recursive-error.bat
@echo off
set "_var1_DoHeading=ZZZ"
FOR /R "S:#MiscDownloads\test" %%G IN (*.mp4) DO (
echo Processing... %%G
set "_var1_DoHeading=YES"
echo [a - The value of _var1_DoHeading is %_var1_DoHeading% ]
for /f "usebackq delims==" %%H in (ffmpeg.exe -xerror -v error -i "%%G" -f null - 2^>^&1) do (
if %_var1_DoHeading%==YES (
echo ====================
echo %%G
)
set "_var1_DoHeading=NO"
echo [b - The value of _var1_DoHeading is %_var1_DoHeading% ]
echo %%H
)
)
echo Done
Error
PS C:\duplicate-file-finder> .\ffmpeg-check-for-errors.bat
Processing... S:#MiscDownloads\test\test_video.mp4
[a - The value of _var1_DoHeading is ZZZ ]
[b - The value of _var1_DoHeading is ZZZ ]
[aac @ 000001b1848bed40] channel element 0.0 is not allocated
[b - The value of _var1_DoHeading is ZZZ ]
[h264 @ 000001b184936b80] error while decoding MB 60 21, bytestream -7
Done
References: