CivArchive
    ← All articles
    Published June 6, 2023by vgt13

    Automatic Export Frames from Anime Series with FFMPEG

    376 views0 reactions3 comments on CivitAI3 collected
    tool guide

    Here is a litthe Windows Batch Script, which exports 1 Frame every Second from mkv/mp4/avi Videos in the same Folder and saves them in a subdirectory for each episode/file.

    Filenames are not allowed to contain any spaces. I usually rename the episodes with Windows Powertoys Regexrenamer to something like S01E01.mkv, S01E02.mkv, etc.

    For every Videofile in the current Folder, a subfolder is created.

    After finishing, the Videos will be deleted.

    Just install FFMPEG and save the following code as a .bat File.

    Frames will be extracted in the same resolution as the Video and in best Quality

    • del %%F - deletes the File after extracting the Frames if you don't want that, you can just remove these lines

    for %%F in (*.mkv) do (
    If not Exist "%%~nF" MkDir "%%~nF"
    ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%6d.jpg
    del %%F
    )
    
    for %%F in (*.avi) do (
    If not Exist "%%~nF" MkDir "%%~nF"
    ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%6d.jpg
    del %%F
    )
    
    for %%F in (*.mp4) do (
    If not Exist "%%~nF" MkDir "%%~nF"
    ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%6d.jpg
    del %%F
    )
    pause