ffmpeg output to dynamically created folders

2019-09-20 06:40发布

问题:

My main aim is from the below code:

@Echo off

for %%i in (*.mp4) do (
ffmpeg -i "%%i" -vf fps=1/1800 "%%~ni_%%d.jpeg"
)

I want to be able to use the file name to create a new folder with said file name and store the images that will be screentshot in the folder.

So basically have a separate folder created for each video file and it automatically naming the folder the same name as the file

回答1:

Is this what you want?

@echo off
for %%i in (*.mp4) do (if not exist "%%~ni\" MD "%%~ni"
    ffmpeg -i "%%i" -vf fps=1/1800 "%%~ni\%%~ni_%%d.jpeg")