以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起双击运行
@echo off
rem 使用ffmpeg将多个mp4视频逐帧导出jpg图片
mode con lines=3000
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
for /f "delims=" %%a in ('dir /a-d-h/b *.mp4') do (
if not exist "%%~na" md "%%~na"
ffmpeg.exe -i "%%a" -r 1 "%%~na\%%6d.jpg"
)
echo;%#% +%$%%$%/%@% %z%
pause
exit
jpg前加了%d,这样试试:
for %%I in (*.exe) do echo ffmpeg -i %%I -r 1 %%~nI%%d.jpg