Last active
November 16, 2018 01:26
-
-
Save Miragecore/3e8bb717404efaeddfcb72155a860a7c to your computer and use it in GitHub Desktop.
Take a screenshot with subtitles of every mkv file in the directory, at 10 seconds after the video starts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Take a screenshot with subtitles of every mkv file in the directory, | |
rem at 10 seconds after the video starts | |
@echo off | |
SET count=1 | |
FOR /f "tokens=*" %%G IN ('dir /b') DO (call :subroutine "%%G") | |
GOTO :eof | |
:subroutine | |
set tmp=%1 | |
set ext="%tmp:~-5% | |
IF %ext%==".mkv" ( | |
set fn=%tmp:~0,-5% | |
echo Take screen shot %fn%.mkv | |
ffmpeg -i %1 -map 0:s:0 %fn%.srt | |
ffmpeg -ss 00:00:10 -copyts -i %1 -vf subtitles=%fn%.srt" -vframes 1 %fn%.jpg" | |
) | |
set /a count+=1 | |
GOTO :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment