I want to automate this so I need a command line method to auto extract all subtitles from a video file like mkv. Not all video contain multiple subtitles so how can I do this?
+ Reply to Thread
Results 1 to 3 of 3
-
-
I've modified an older batch file I wrote.
All my mkv videos have .srt subs, so no testing .ass, etc.
demux-all-subtitle-streams-v01.cmdCheers.Code:@echo off if not exist Subs\ md Subs for %%a in (*.mkv) do call :process1 "%%a" goto :end :process1 rem Get a list of streams - pare down to subtitle streams. ffmpeg.exe -i "%~1" -y nul 2>&1 | find /i "stream" | find /i "subtitle" >"%~n1.txt" rem Using the temp file, "%~n1.txt", to set mapping and the output file name. for /f "usebackq tokens=1-7 delims=^(^)^:^#^ " %%a in ("%~n1.txt") do ( setlocal enabledelayedexpansion set stream=%%b:%%c ffmpeg.exe -i "%~1" -map !stream! -y "Subs\%~n1-%%d.%%g" ) goto :eof :end rem uncomment the next line to delete all temp txt files. rem del "*.txt" echo. &echo Output is in the Subs\ folder &pause
Similar Threads
-
Extract subtitles from video
By merethe in forum Video Streaming DownloadingReplies: 2Last Post: 19th Dec 2024, 02:50 -
Extract subtitles from foodnetwork video
By merethe in forum Video Streaming DownloadingReplies: 2Last Post: 16th Nov 2023, 14:19 -
How to specify subtitles codec in ffmpeg cli?
By Anonymous543 in forum Newbie / General discussionsReplies: 5Last Post: 22nd Dec 2021, 23:41 -
Using DVDShrink to extract only the video only English audio No subtitles
By RogerTango in forum DVD RippingReplies: 3Last Post: 19th Dec 2021, 17:48 -
Help me extract closed caption which overlay subtitles on embed video
By Rij in forum SubtitleReplies: 8Last Post: 4th Oct 2021, 15:19



Quote