if ($answer_counter == 1): ?>
endif; ?>
Identifique legendas em inglês em arquivos de vídeo MKV com GNU sed :
@echo off&setlocal
set "rootfolder=C:\video\test"
echo Enumerating all MKVs under %rootfolder%
echo.
for /r "%rootfolder%" %%a in (*.mkv) do (
for /f %%b in ('mkvmerge --ui-language en -i "%%a" ^| find /c /i "subtitles"') do (
if "%%b"=="0" (
echo(%%a has no subtitles
) else (
echo(%%a has subtitles
set "line="
for /f "delims=" %%i in ('mkvmerge --ui-language en --identify-verbose "%%a" ^| sed "/subtitles/!d;/language:eng/!d;s/.* \([0-9]*\):.*//"') do (
echo(english Track ID: %%i
call set line=%%line%% %%i:"%%~dpna (Sub Track %%i).sub"
)
setlocal enabledelayedexpansion
mkvextract tracks "%%a" --ui-language en !line! ||(echo Demuxing error!&goto:eof)
endlocal
mkvmerge -q -o "%%~dpna (No Subs)%%~xa" -S "%%a"
if errorlevel 1 (
echo Warnings/errors generated during remuxing, original file not deleted
) else (
del /f "%%a"
echo Successfully remuxed to "%%~dpna (No Subs)%%~xa", original file deleted
)
echo(
)
)
)