⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24set /a fallbackscreencaptime = 1 if not exist "%CD%\result" mkdir "%CD%\result" for /r %%v in (*.mp4) do ( setlocal EnableDelayedExpansion set "finalaudio=%CD%\result\%%~nv.m4a" set "tempaudio=%CD%\temp_audio.m4a" set "tempcover=%CD%\temp_cover.jpg" echo !finalaudio! ::extract audio ffmpeg -i "%%v" -vn -c:a copy "!tempaudio!" ::extract cover image ffmpeg -i "%%v" -map 0:v -map -0:V -c copy "!tempcover!" ::fallback if cover image doesn't exist if not exist !tempcover! ( ffmpeg -ss "%fallbackscreencaptime%" -i "%%v" -frames:v 1 -update 1 -q:v 5 "!tempcover!" ) ::combine cover image into audio ffmpeg -i "!tempaudio!" -i "!tempcover!" -c copy -disposition:v attached_pic "!finalaudio!" ::remove temp files del !tempaudio! del !tempcover! ) pause
Warning LINK You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue? Continue Cancel