Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save CannonballSkippy/6433a981c233ff224b46753695b3ff8b to your computer and use it in GitHub Desktop.
Save CannonballSkippy/6433a981c233ff224b46753695b3ff8b to your computer and use it in GitHub Desktop.
This is a batch script that will merge subtitles with a video file, resulting in an *.mkv file with internal subtitles.
@echo off
echo ----------------------------------------------------------------------
echo VIDEO AND SUBTITLE MERGER
echo version 1.0.0 by Seyoum
echo ----------------------------------------------------------------------
:: Set file video extention
:VIDEOFILEEXTENTION
echo.
set /p videofileformat=Enter the video file type extension (e.g mp4):
if /I "%videofileformat%" EQU "webm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mkv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "vob" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "ogv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "ogg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "drc" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "gif" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "gifv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mng" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "avi" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mov" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "qt" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "wmv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "yuv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "rm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "rmvb" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "asf" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mp4" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "m4p" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "m4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mp2" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpeg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpe" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mpeg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "m2v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "m4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "svi" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "3gp" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "3g2" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "mxf" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "roq" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "nsv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "f4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "f4p" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "f4a" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
if /I "%videofileformat%" EQU "f4b" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
echo you have entered something invalid&goto:VIDEOFILEEXTENTION
:: Set subtitle file extention
:SUBTITLEFILEEXTENTION
echo.
set /p subtitlefileformat=Enter the subtitle file type extention(e.g srt):
if /I "%subtitlefileformat%" EQU "aqt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "gsub" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "txt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "jss" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "sub" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "ttxt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "pjs" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "psb" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "rt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "smi" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "stl" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "ssf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "srt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "ssa" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "ass" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "usf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "idx" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "usf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
if /I "%subtitlefileformat%" EQU "pgs" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
echo you have entered something invalid&goto:SUBTITLEFILEEXTENTION
:: Set Subtitle language code
:Get_ISOlanguage
echo.
set "language=not valid"
set /p "ISOlanguage=Enter subtitle language(e.g eng, fre, ger or similar):"
for /f "tokens=3 delims=," %%i in ('find "DATA,%ISOlanguage%," "%~f0"') do set language=%%i
echo - You have chosen %language% subtitles
if "%language%"=="not valid" goto :Get_ISOlanguage
goto :CONTINUE1
DATA,abk,Abkhazian
DATA,ace,Achinese
DATA,ach,Acoli
DATA,ada,Adangme
DATA,ady,Adyghe; Adygei
DATA,aar,Afar
DATA,afh,Afrihili
DATA,afr,Afrikaans
DATA,afa,Afro-Asiatic languages
DATA,ain,Ainu
DATA,aka,Akan
DATA,akk,Akkadian
DATA,alb,Albanian
DATA,ale,Aleut
DATA,alg,Algonquian languages
DATA,tut,Altaic languages
DATA,amh,Amharic
DATA,anp,Angika
DATA,apa,Apache languages
DATA,ara,Arabic
DATA,arg,Aragonese
DATA,arp,Arapaho
DATA,arw,Arawak
DATA,arm,Armenian
DATA,rup,Aromanian; Arumanian; Macedo-Romanian
DATA,art,Artificial languages
DATA,asm,Assamese
DATA,ast,Asturian; Bable; Leonese; Asturleonese
DATA,ath,Athapascan languages
DATA,aus,Australian languages
DATA,map,Austronesian languages
DATA,ava,Avaric
DATA,ave,Avestan
DATA,awa,Awadhi
DATA,aym,Aymara
DATA,aze,Azerbaijani
DATA,ban,Balinese
DATA,bat,Baltic languages
DATA,bal,Baluchi
DATA,bam,Bambara
DATA,bai,Bamileke languages
DATA,bad,Banda languages
DATA,bnt,Bantu languages
DATA,bas,Basa
DATA,bak,Bashkir
DATA,baq,Basque
DATA,btk,Batak languages
DATA,bej,Beja; Bedawiyet
DATA,bel,Belarusian
DATA,bem,Bemba
DATA,ben,Bengali
DATA,ber,Berber languages
DATA,bho,Bhojpuri
DATA,bih,Bihari languages
DATA,bik,Bikol
DATA,bin,Bini; Edo
DATA,bis,Bislama
DATA,byn,Blin; Bilin
DATA,zbl,Blissymbols; Blissymbolics; Bliss
DATA,nob,Bokmål, Norwegian; Norwegian Bokmål
DATA,bos,Bosnian
DATA,bra,Braj
DATA,bre,Breton
DATA,bug,Buginese
DATA,bul,Bulgarian
DATA,bua,Buriat
DATA,bur,Burmese
DATA,cad,Caddo
DATA,cat,Catalan; Valencian
DATA,cau,Caucasian languages
DATA,ceb,Cebuano
DATA,cel,Celtic languages
DATA,cai,Central American Indian languages
DATA,khm,Central Khmer
DATA,chg,Chagatai
DATA,cmc,Chamic languages
DATA,cha,Chamorro
DATA,che,Chechen
DATA,chr,Cherokee
DATA,chy,Cheyenne
DATA,chb,Chibcha
DATA,nya,Chichewa; Chewa; Nyanja
DATA,chi,Chinese
DATA,chp,Chipewyan; Dene Suline
DATA,cho,Choctaw
DATA,chu,Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
DATA,chk,Chuukese
DATA,chv,Chuvash
DATA,nwc,Classical Newari; Old Newari; Classical Nepal Bhasa
DATA,syc,Classical Syriac
DATA,cop,Coptic
DATA,cor,Cornish
DATA,cos,Corsican
DATA,cre,Cree
DATA,mus,Creek
DATA,crp,Creoles and pidgins
DATA,cpe,Creoles and pidgins, English based
DATA,cpf,Creoles and pidgins, French-based
DATA,cpp,Creoles and pidgins, Portuguese-based
DATA,crh,Crimean Tatar; Crimean Turkish
DATA,hrv,Croatian
DATA,cus,Cushitic languages
DATA,cze,Czech
DATA,dak,Dakota
DATA,dan,Danish
DATA,dar,Dargwa
DATA,del,Delaware
DATA,din,Dinka
DATA,div,Divehi; Dhivehi; Maldivian
DATA,doi,Dogri
DATA,dgr,Dogrib
DATA,dra,Dravidian languages
DATA,dua,Duala
DATA,dum,Dutch, Middle (ca.1050-1350)
DATA,dut,Dutch; Flemish
DATA,dyu,Dyula
DATA,dzo,Dzongkha
DATA,frs,Eastern Frisian
DATA,efi,Efik
DATA,egy,Egyptian (Ancient)
DATA,eka,Ekajuk
DATA,elx,Elamite
DATA,eng,English
DATA,myv,Erzya
DATA,epo,Esperanto
DATA,est,Estonian
DATA,ewe,Ewe
DATA,ewo,Ewondo
DATA,fan,Fang
DATA,fat,Fanti
DATA,fao,Faroese
DATA,fij,Fijian
DATA,fil,Filipino; Pilipino
DATA,fin,Finnish
DATA,fiu,Finno-Ugrian languages
DATA,fon,Fon
DATA,fre,French
DATA,frm,French, Middle (ca.1400-1600)
DATA,fro,French, Old (842-ca.1400)
DATA,fur,Friulian
DATA,ful,Fulah
DATA,gaa,Ga
DATA,gla,Gaelic; Scottish Gaelic
DATA,car,Galibi Carib
DATA,glg,Galician
DATA,lug,Ganda
DATA,gay,Gayo
DATA,gba,Gbaya
DATA,gez,Geez
DATA,geo,Georgian
DATA,ger,German
DATA,gil,Gilbertese
DATA,gon,Gondi
DATA,gor,Gorontalo
DATA,got,Gothic
DATA,grb,Grebo
DATA,grc,Greek, Ancient (to 1453)
DATA,gre,Greek, Modern (1453-)
DATA,grn,Guarani
DATA,guj,Gujarati
DATA,gwi,Gwich'in
DATA,hai,Haida
DATA,hat,Haitian; Haitian Creole
DATA,hau,Hausa
DATA,haw,Hawaiian
DATA,heb,Hebrew
DATA,her,Herero
DATA,hil,Hiligaynon
DATA,him,Himachali languages; Western Pahari languages
DATA,hin,Hindi
DATA,hmo,Hiri Motu
DATA,hit,Hittite
DATA,hmn,Hmong; Mong
DATA,hun,Hungarian
DATA,hup,Hupa
DATA,iba,Iban
DATA,ice,Icelandic
DATA,ido,Ido
DATA,ibo,Igbo
DATA,ijo,Ijo languages
DATA,ilo,Iloko
DATA,smn,Inari Sami
DATA,inc,Indic languages
DATA,ine,Indo-European languages
DATA,ind,Indonesian
DATA,inh,Ingush
DATA,ina,Interlingua (International Auxiliary Language Association)
DATA,ile,Interlingue; Occidental
DATA,iku,Inuktitut
DATA,ipk,Inupiaq
DATA,ira,Iranian languages
DATA,gle,Irish
DATA,mga,Irish, Middle (900-1200)
DATA,sga,Irish, Old (to 900)
DATA,iro,Iroquoian languages
DATA,ita,Italian
DATA,jpn,Japanese
DATA,jav,Javanese
DATA,jrb,Judeo-Arabic
DATA,jpr,Judeo-Persian
DATA,kbd,Kabardian
DATA,kab,Kabyle
DATA,kac,Kachin; Jingpho
DATA,kal,Kalaallisut; Greenlandic
DATA,xal,Kalmyk; Oirat
DATA,kam,Kamba
DATA,kan,Kannada
DATA,kau,Kanuri
DATA,krc,Karachay-Balkar
DATA,kaa,Kara-Kalpak
DATA,krl,Karelian
DATA,kar,Karen languages
DATA,kas,Kashmiri
DATA,csb,Kashubian
DATA,kaw,Kawi
DATA,kaz,Kazakh
DATA,kha,Khasi
DATA,khi,Khoisan languages
DATA,kho,Khotanese; Sakan
DATA,kik,Kikuyu; Gikuyu
DATA,kmb,Kimbundu
DATA,kin,Kinyarwanda
DATA,kir,Kirghiz; Kyrgyz
DATA,tlh,Klingon; tlhIngan-Hol
DATA,kom,Komi
DATA,kon,Kongo
DATA,kok,Konkani
DATA,kor,Korean
DATA,kos,Kosraean
DATA,kpe,Kpelle
DATA,kro,Kru languages
DATA,kua,Kuanyama; Kwanyama
DATA,kum,Kumyk
DATA,kur,Kurdish
DATA,kru,Kurukh
DATA,kut,Kutenai
DATA,lad,Ladino
DATA,lah,Lahnda
DATA,lam,Lamba
DATA,day,Land Dayak languages
DATA,lao,Lao
DATA,lat,Latin
DATA,lav,Latvian
DATA,lez,Lezghian
DATA,lim,Limburgan; Limburger; Limburgish
DATA,lin,Lingala
DATA,lit,Lithuanian
DATA,jbo,Lojban
DATA,nds,Low German; Low Saxon; German, Low; Saxon, Low
DATA,dsb,Lower Sorbian
DATA,loz,Lozi
DATA,lub,Luba-Katanga
DATA,lua,Luba-Lulua
DATA,lui,Luiseno
DATA,smj,Lule Sami
DATA,lun,Lunda
DATA,luo,Luo (Kenya and Tanzania)
DATA,lus,Lushai
DATA,ltz,Luxembourgish; Letzeburgesch
DATA,mac,Macedonian
DATA,mad,Madurese
DATA,mag,Magahi
DATA,mai,Maithili
DATA,mak,Makasar
DATA,mlg,Malagasy
DATA,may,Malay
DATA,mal,Malayalam
DATA,mlt,Maltese
DATA,mnc,Manchu
DATA,mdr,Mandar
DATA,man,Mandingo
DATA,mni,Manipuri
DATA,mno,Manobo languages
DATA,glv,Manx
DATA,mao,Maori
DATA,arn,Mapudungun; Mapuche
DATA,mar,Marathi
DATA,chm,Mari
DATA,mah,Marshallese
DATA,mwr,Marwari
DATA,mas,Masai
DATA,myn,Mayan languages
DATA,men,Mende
DATA,mic,Mi'kmaq; Micmac
DATA,min,Minangkabau
DATA,mwl,Mirandese
DATA,moh,Mohawk
DATA,mdf,Moksha
DATA,lol,Mongo
DATA,mon,Mongolian
DATA,mkh,Mon-Khmer languages
DATA,mos,Mossi
DATA,mul,Multiple languages
DATA,mun,Munda languages
DATA,nah,Nahuatl languages
DATA,nau,Nauru
DATA,nav,Navajo; Navaho
DATA,nde,Ndebele, North; North Ndebele
DATA,nbl,Ndebele, South; South Ndebele
DATA,ndo,Ndonga
DATA,nap,Neapolitan
DATA,new,Nepal Bhasa; Newari
DATA,nep,Nepali
DATA,nia,Nias
DATA,nic,Niger-Kordofanian languages
DATA,ssa,Nilo-Saharan languages
DATA,niu,Niuean
DATA,nqo,N'Ko
DATA,zxx,No linguistic content; Not applicable
DATA,nog,Nogai
DATA,non,Norse, Old
DATA,nai,North American Indian languages
DATA,frr,Northern Frisian
DATA,sme,Northern Sami
DATA,nor,Norwegian
DATA,nno,Norwegian Nynorsk; Nynorsk, Norwegian
DATA,nub,Nubian languages
DATA,nym,Nyamwezi
DATA,nyn,Nyankole
DATA,nyo,Nyoro
DATA,nzi,Nzima
DATA,oci,Occitan (post 1500)
DATA,arc,Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)
DATA,oji,Ojibwa
DATA,ori,Oriya
DATA,orm,Oromo
DATA,osa,Osage
DATA,oss,Ossetian; Ossetic
DATA,oto,Otomian languages
DATA,pal,Pahlavi
DATA,pau,Palauan
DATA,pli,Pali
DATA,pam,Pampanga; Kapampangan
DATA,pag,Pangasinan
DATA,pan,Panjabi; Punjabi
DATA,pap,Papiamento
DATA,paa,Papuan languages
DATA,nso,Pedi; Sepedi; Northern Sotho
DATA,per,Persian
DATA,peo,Persian, Old (ca.600-400 B.C.)
DATA,phi,Philippine languages
DATA,phn,Phoenician
DATA,pon,Pohnpeian
DATA,pol,Polish
DATA,por,Portuguese
DATA,pra,Prakrit languages
DATA,pro,Provençal, Old (to 1500);Occitan, Old (to 1500)
DATA,pus,Pushto; Pashto
DATA,que,Quechua
DATA,raj,Rajasthani
DATA,rap,Rapanui
DATA,rar,Rarotongan; Cook Islands Maori
DATA,qaa,Reserved for local use
DATA,roa,Romance languages
DATA,rum,Romanian; Moldavian; Moldovan
DATA,roh,Romansh
DATA,rom,Romany
DATA,run,Rundi
DATA,rus,Russian
DATA,sal,Salishan languages
DATA,sam,Samaritan Aramaic
DATA,smi,Sami languages
DATA,smo,Samoan
DATA,sad,Sandawe
DATA,sag,Sango
DATA,san,Sanskrit
DATA,sat,Santali
DATA,srd,Sardinian
DATA,sas,Sasak
DATA,sco,Scots
DATA,sel,Selkup
DATA,sem,Semitic languages
DATA,srp,Serbian
DATA,srr,Serer
DATA,shn,Shan
DATA,sna,Shona
DATA,iii,Sichuan Yi; Nuosu
DATA,scn,Sicilian
DATA,sid,Sidamo
DATA,sgn,Sign Languages
DATA,bla,Siksika
DATA,snd,Sindhi
DATA,sin,Sinhala; Sinhalese
DATA,sit,Sino-Tibetan languages
DATA,sio,Siouan languages
DATA,sms,Skolt Sami
DATA,den,Slave (Athapascan)
DATA,sla,Slavic languages
DATA,slo,Slovak
DATA,slv,Slovenian
DATA,sog,Sogdian
DATA,som,Somali
DATA,son,Songhai languages
DATA,snk,Soninke
DATA,wen,Sorbian languages
DATA,sot,Sotho, Southern
DATA,sai,South American Indian languages
DATA,alt,Southern Altai
DATA,sma,Southern Sami
DATA,spa,Spanish; Castilian
DATA,srn,Sranan Tongo
DATA,zgh,Standard Moroccan Tamazight
DATA,suk,Sukuma
DATA,sux,Sumerian
DATA,sun,Sundanese
DATA,sus,Susu
DATA,swa,Swahili
DATA,ssw,Swati
DATA,swe,Swedish
DATA,gsw,Swiss German; Alemannic; Alsatian
DATA,syr,Syriac
DATA,tgl,Tagalog
DATA,tah,Tahitian
DATA,tai,Tai languages
DATA,tgk,Tajik
DATA,tmh,Tamashek
DATA,tam,Tamil
DATA,tat,Tatar
DATA,tel,Telugu
DATA,ter,Tereno
DATA,tet,Tetum
DATA,tha,Thai
DATA,tib,Tibetan
DATA,tig,Tigre
DATA,tir,Tigrinya
DATA,tem,Timne
DATA,tiv,Tiv
DATA,tli,Tlingit
DATA,tpi,Tok Pisin
DATA,tkl,Tokelau
DATA,tog,Tonga (Nyasa)
DATA,ton,Tonga (Tonga Islands)
DATA,tsi,Tsimshian
DATA,tso,Tsonga
DATA,tsn,Tswana
DATA,tum,Tumbuka
DATA,tup,Tupi languages
DATA,tur,Turkish
DATA,ota,Turkish, Ottoman (1500-1928)
DATA,tuk,Turkmen
DATA,tvl,Tuvalu
DATA,tyv,Tuvinian
DATA,twi,Twi
DATA,udm,Udmurt
DATA,uga,Ugaritic
DATA,uig,Uighur; Uyghur
DATA,ukr,Ukrainian
DATA,umb,Umbundu
DATA,mis,Uncoded languages
DATA,und,Undetermined
DATA,hsb,Upper Sorbian
DATA,urd,Urdu
DATA,uzb,Uzbek
DATA,vai,Vai
DATA,ven,Venda
DATA,vie,Vietnamese
DATA,vol,Volapük
DATA,vot,Votic
DATA,wak,Wakashan languages
DATA,wln,Walloon
DATA,war,Waray
DATA,was,Washo
DATA,wel,Welsh
DATA,fry,Western Frisian
DATA,wal,Wolaitta; Wolaytta
DATA,wol,Wolof
DATA,xho,Xhosa
DATA,sah,Yakut
DATA,yao,Yao
DATA,yap,Yapese
DATA,yid,Yiddish
DATA,yor,Yoruba
DATA,ypk,Yupik languages
DATA,znd,Zande languages
DATA,zap,Zapotec
DATA,zza,Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki
DATA,zen,Zenaga
DATA,zha,Zhuang; Chuang
DATA,zul,Zulu
DATA,zun,Zuni
:CONTINUE1
:: Default yes/not
:SubtitleDefaultYesNo
echo.
set /p subtitledefault=Do you want to make subtitles default [y/n]? :
if /I "%subtitledefault%" EQU "y" set subtitledefault=0:yes&goto:CONTINUE2
if /I "%subtitledefault%" EQU "n" set subtitledefault=1:yes&goto:CONTINUE2
echo you have entered something invalid&goto:SubtitleDefaultYesNo
:: Forced yes/not
:CONTINUE2
:SubtitleForcedYesNo
echo.
set /p subtitledefault=Do you want to make subtitles forced [y/n]? :
if /I "%subtitledefault%" EQU "y" set subtitledefault=0:yes&goto:CONTINUE3
if /I "%subtitledefault%" EQU "n" set subtitledefault=1:yes&goto:CONTINUE3
echo you have entered something invalid&goto:SubtitleForcedYesNo
:: Set mkvmergepath
:CONTINUE3
Setlocal EnableDelayedExpansion
echo.
set /p mkvmergepath=Enter the full path to mkvmerge (e.g C:\mkvtoolnix\mkvmerge.exe):
if not exist "%mkvmergepath%" echo The path you have entered does not exist...&goto:CONTINUE3
::Muxing operation
echo.
for %%A IN (*.%videofileformat%) do ( "!mkvmergepath!" -o "remux-%%~nxA" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:%language% subtitles" --language "0:%ISOlanguage%" "%%~nA.%subtitlefileformat%")
:: Confirmation dialog
@echo off
echo ----------------------------------------------------------------------
echo Finished operation!
echo Press any key to exit
pause > nul
cls
@CannonballSkippy
Copy link
Author

The script works however despite me choosing English or Undetermined as the language and then choosing No for Default and Forced subs, the subs play automatically when I play the video. Can you please fix the script.

This has nothing to do with the script but rather your media player. You probably just have to change your settings. You can also use MediaInfo to check which track is forced/default.

@CannonballSkippy
Copy link
Author

when i run the script windows 10 showm virus trojan why wtf?

Strange... I am running Windows 10 too. In fact, this script was created on a Windows 10 computer 🤣

@jedi256
Copy link

jedi256 commented Dec 23, 2019

The script works however despite me choosing English or Undetermined as the language and then choosing No for Default and Forced subs, the subs play automatically when I play the video. Can you please fix the script.

As seyoum stated, you can adjust the settings in your media player. For example, in VLC Player, from the menu go to Tools>Preferences>Subtitles and uncheck the box "Enable subtitles." Subtitles will not automatically play but you'll still have the option to turn them on manually in each video via the menu and going to Subtitle>Sub Track and selecting the track you wish to display.

@holygamer
Copy link

Regarding my earlier comment:

The script works however despite me choosing English or Undetermined as the language and then choosing No for Default and Forced subs, the subs play automatically when I play the video. Can you please fix the script

You said that's it's the media player options that I need to adjust however you're incorrect. The subtitles in MPC-HC via "View > Options > Subtitles > Misc" don't make a difference to whether the subs play automatically or not and if I was to manually mux a video in MKVMerge choosing Undetermined as the language and then choosing No for Default and Forced subs, then when I play the video in MPC-HC the subtitles do NOT play automatically. I can right click within the video playing and go to Subtitle Track and it shows that "No subtitles" is the track selected and you can select the "SRT" track if you want to turn on subtitles. Also within the Subtitle Track menu is an "Enable" check box to turn subtitles on or off and it's currently ticked.

You would think that the same options I chose in MKVMerge that I also chose in your script would give the same result but it doesn't. Instead when I play the video the subtitles play automatically. This time in the MPC-HC right-click > Subtitle Track menu I see that the following track is selected "Undetermined subtitles (srt) [default]". Note that it says default this time even though I specified default NO in your script. This is annoying as whenever I play a video I need to disable the subtitles via the right-click menu. Or I can turn "Enable" off so I don't have to turn subs off every time I play a video.

So the problem with your script is that setting default subtitles to NO - that setting is ignored by MKVMerge for some reason. Can you please fix your script. Thanks

@jedi256
Copy link

jedi256 commented Dec 25, 2019

I verified that what holygamer said is accurate. If I mux subtitles manually with MKVMerge then the subtitles do not automatically play in VLC Player even if I have Preferences set with the box "Enable subtitles" checked. However, when muxing via the script, the subtitles autoplay despite choosing "no" for Default and Forced subs. I can get around this by unchecking the "Enable subtitles" box in Preferences but the fact remains that the script does not have the same result as muxing subtitles directly in MKVMerge with what should be the same settings. When verifying the remux version of a file after running the script, MediaInfo shows the subtitles Default selected as "yes" and subtitles Forced as "no" so the script incorrectly set the subtitles default to "yes" despite selecting "no" when prompted in the script execution.

@modparts
Copy link

Can I set the mkvmerge path in the batch file so i don't have to type it every time?

@TheDevilsKiller
Copy link

Can I set the mkvmerge path in the batch file so i don't have to type it every time?

Yes, you cloud replace using the text editor

set /p mkvmergepath=Enter the full path to mkvmerge (e.g C:\mkvtoolnix\mkvmerge.exe):
if not exist "%mkvmergepath%" echo The path you have entered does not exist...&goto:CONTINUE3

with

set mkvmergepath=C:\Program Files\MKVToolNix\mkvmerge.exe

@jedi256
Copy link

jedi256 commented Jan 15, 2020

Can I set the mkvmerge path in the batch file so i don't have to type it every time?

Yes, here is a modified version of seyoum's script that results in a .mkv file output and allows you to explicitly set a permanent file path for mkvmerge.exe without prompting the script user to specify a file path during each batch execution. You may need to do a one-time modification of the following line of code near the end of the script: "C:\Program Files (x86)\MKVToolNix\mkvmerge.exe" by changing the file path in quotes to where mkvmerge.exe is located on your computer. Download Script

@modparts
Copy link

Thanks for the well explained answer.
So can i also set it to just ask me the video file type?
So i wanna change the script to just ask vide file format like mp4 then it's default set to srt for subtitle,
dut for dutch subtitles, yes for default and no for forced, and if possible that the remux in the new filename is in the back of the filename instead of the beginning

@jedi256
Copy link

jedi256 commented Jan 15, 2020

@modparts: All of that is of course possible but while seyoum was kind enough to donate his/her generalized script, the potential modifications are endless but his/her time is limited. I provided my modified script because I think those two modifications (forced .mkv file output extension and fixed mkvmerge file path) will be useful to a wide audience. By examining the basic script and utilizing online sources, you can probably figure out some custom modifications for your circumstances. All the best! P.S. I'm not a programmer but was able to modify the original script doing what I just recommended.

@tbone7467
Copy link

Any ideas how to keep the subs from defaulting to yes when you select no? I spent a few hrs but came up empty

@zoidy
Copy link

zoidy commented Mar 6, 2020

@jedi256
Copy link

jedi256 commented Mar 10, 2020

@zoidy It was a good attempt but there were still issues with your script. Here is an amended script that corrects all the default/forced subtitle settings problems. I verified with MediaInfo that the script works using all four combinations of settings for the questions regarding default and forced subtitles ( Y/Y, N/N, Y/N, N/Y). Download Script

@zoidy
Copy link

zoidy commented Mar 11, 2020

@jedi256 Thanks for the update. I only tried N/N which is the one I cared about

@tbone7467
Copy link

I haven’t tried it yet. I’m excited to look at code an learn what I missed. I tried a few thing but got zero. I’ll try this ASAP.

@holygamer
Copy link

holygamer commented Jun 29, 2020

@zoidy It was a good attempt but there were still issues with your script. Here is an amended script that corrects all the default/forced subtitle settings problems. I verified with MediaInfo that the script works using all four combinations of settings for the questions regarding default and forced subtitles ( Y/Y, N/N, Y/N, N/Y). Download Script

Thanks. Your script works. Is there a way I can get the script to always use the same settings so it won't ask me any questions when I run it? For example I always give these answers:

Enter the video file extension: mp4
Enter the subtitle file type extension: sup
Enter subtitle language: eng
Do you want to make subtitles default: n
Do you want to make subtitles forced: n

@jedi256
Copy link

jedi256 commented Jun 30, 2020

@holygamer Yes, but I'd have to figure it out. As mentioned before, I'm not a programmer but I can usually figure things out by tinkering. I'd help if I had the time but it could be a good learning project for you :-) All the best!

@ChaoticTissue
Copy link

ChaoticTissue commented Jul 15, 2020

I have noticed that if there's an exclamation point (!) in the filename, it will get skipped entirely. Minor issue, just something to look out for.

@Ascentw
Copy link

Ascentw commented Sep 14, 2020

Yeah, if there's a "!" for now I've been removing it from the name to do it.
About the output files, is there a easy way to make them be remuxed with the same name, but in a "output" folder? I think it's not that hard, but I don't know the language enough to change that. Thanks for the script, it was really useful!

Edit: Nevermind, I changed the output path to -o "mkvsubsmux/%%A" "%%A" and apparently worked.

@DLoh8698
Copy link

DLoh8698 commented Oct 19, 2020

Thanks for the script. I am using it with a few changes to suit my usual usage pattern. Wanted to remove as many of the required inputs as possible, including input of video and subtitle types, but found that almost impossible as there are so many possible combinations. So I settled for the following changes, (note: I commented out lines which I am not using instead of deleting so as not to muck up the batch file too much)
(EDIT: Not as difficult as I first thought, because I found I only have a very types of video/sub files so ended up with only 6 possible combinations. See my post further down)

  1. to set eng permanently
    :: Set Subtitle language code
    :Get_ISOlanguage
    ::echo.
    ::set "language=not valid"
    ::set /p "ISOlanguage=Enter subtitle language(e.g eng, fre, ger or similar):"
    ::for /f "tokens=3 delims=," %%i in ('find "DATA,%ISOlanguage%," "%~f0"') do set language=%%i
    set language=Eng
    echo - You have chosen %language% subtitles
    if "%language%"=="not valid" goto :Get_ISOlanguage

  2. To set Yes and No for the 2 default subtitle actions
    :: Default yes/not
    :SubtitleDefaultYesNo
    ::echo.
    ::set /p subtitledefault=Do you want to make subtitles default [y/n]? :
    set subtitledefault=0:yes&goto:CONTINUE2
    ::if /I "%subtitledefault%" EQU "n" set subtitledefault=1:yes&goto:CONTINUE2
    ::echo you have entered something invalid&goto:SubtitleDefaultYesNo
    :: Forced yes/not
    :CONTINUE2
    :SubtitleForcedYesNo
    echo.
    ::set /p subtitledefault=Do you want to make subtitles forced [y/n]? :
    ::if /I "%subtitledefault%" EQU "y" set subtitledefault=0:yes&goto:CONTINUE3
    set subtitledefault=1:yes&goto:CONTINUE3
    ::echo you have entered something invalid&goto:SubtitleForcedYesNo

  3. Some changes which affect the output
    ::for %%A IN (.%videofileformat%) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:%language% subtitles" --language "0:%ISOlanguage%" "%%~nA.%subtitlefileformat%")
    for %%A IN (
    .%videofileformat%) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.%subtitlefileformat%")

I changed original "remux-%%~nxA" "%%~A" to "%%~nA with Sub.mkv" "%%~A" because I found it much easier to locate the merged file when it is grouped together with the original files.

track-name "0:English subtitles" --language "0:eng" to label the subtitle as English

Hope this makes sense.

@CannonballSkippy
Copy link
Author

Just stopping by to say I am positively surprised by the responses here 😀. Unfortunately I don't have much time maintaining this script anymore. The script was just an ad hoc solution and I am actually keeping separate SRT's now. Feel free to continue the discussion though. I am glad to see the interest!

@DLoh8698
Copy link

DLoh8698 commented Oct 20, 2020

A follow up to my earlier post, I realised that my videos are mostly MKV, AVI, MP4 and subtitles SRT, IDX. With some MKS which were extracted from Huge MKV files which I intended to compress to smaller files and reinsert the subtitles. With this in mind I have done further moditifications that Fully automates the whole script without any input. However, it will only work on the following combinations of video/subtitle files:
MP4/AVI/MKV with SRT/IDX (these are the vast majority of what I have). The Changes I made are shown below. (please note I have commented out all the Input lines. You can also delete them if you like)
With these new lines, I can merge a whole stack of different video/subtitle combinations without any input. Just 1 Click!

::AVI
for %%A IN (.avi) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")
for %%A IN (
.avi) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")

::MP4
for %%A IN (.MP4) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")
for %%A IN (
.MP4) do ( "!mkvmergepath!" -o "%%~nA with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")

::MKV
for %%A IN (.MKV) do ( "!mkvmergepath!" -o "%%~nA with Sub.MKV" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")
for %%A IN (
.MKV) do ( "!mkvmergepath!" -o "%%~nA with Sub.MKV" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")

PS all the "for %%A IN (*.MKV) " should have an asterisk after the open bracket. so should be asterisk.MKV. I don't know why but I can only see the asterisk when I am in EDIT mode. Once I update the asterisk disappears.

@DLoh8698
Copy link

DLoh8698 commented Oct 20, 2020

Hi Seyoum,
your file started the ball rolling, for me. Long, long ago, in a Galaxy Far Far Away, I used to play around with batch files, Very, very basic batch files. My very first "PC" was a Sinclair Zx something. As I said, Long Long ago......
The reason I prefer to MERGE the subtitles into my videos is so I do not have to keep track of the SRT files. Was getting very tedious. With some googling I found MKVTOOLNIX but after using for a while I realised it was extremely tedious to input 1 at time. So I googled for batch handling and found your file. With a bit of previous fooling around with batch files, I could figure out (more or less) what to do.
So, I decided to try and automate it as much as possible. (I am lazy!) Now it is totally automated, for the file combinations as stated.
Thanks so much for posting your batch file. Without it I won't have any idea where to start.

@tbone7467
Copy link

DLoh8698 Can you post your script?

@DLoh8698
Copy link

DLoh8698 commented Oct 22, 2020

Hi tbone7467
Firstly, acknowledgement goes to Seyoum who posted the original file, which I modified.

I am not sure how to post a .bat file here, so I will post the contents of the .bat file below.

You must set "set mkvmergepath=C:\INSTNS_ORIGINAL==DO NOT MOVE AWAY\mkvmerge.exe" to show the Path to mkvmerge.exe in YOUR computer. What you see below is for My computer.

Also, you could delete ALL lines from ":: Set file video extention" to "::echo you have entered something invalid&goto:SubtitleForcedYesNo". Script should still work, but I did not try it. All the comment lines (lines starting with ::) don't do anything and don't slow down the process. I prefer them to remain, for future reference.

CONTINUE1
set subtitledefault=0:yes&goto:CONTINUE2 (This sets default to YES)
set subtitledefault=1:yes&goto:CONTINUE2 (This sets default to NO)
Comment out (ie insert :: in front of line) the Other line that you don't want to be default. You should not have both lines active.
Use same method to auto set default in CONTINUE 2 section.

The Output file has been changed from remux(file name).mkv to (file name) - with sub.mkv. This means the output file will be grouped together with the original video/subtitle files. Makes it easier to locate them.

Please take note, the way the script has been modified, you will Not be asked for any input, and it will only work for any combination of
AVI/MP4/MKV to merge with SRT/IDX(SUB). It not work for any other video/subtitle types. You could add in more combinations of other file types using the same format.

PS In sections AVI MP4 MKV, all the "for %%A IN (*.AVI) " (similarly for MP4 and MKV) should have an asterisk after the open bracket. so should be asterisk.AVI (etc). I don't know why but I can only see the asterisk when I am in EDIT mode. Once I update the asterisk disappears.

Copy everything below up to cls right at the end. Then paste into a text file and name it anyname.bat

@echo off
echo ----------------------------------------------------------------------
echo VIDEO AND SUBTITLE MERGER
echo version 1.0.0 by Seyoum
echo ----------------------------------------------------------------------
:: Set file video extention
:VIDEOFILEEXTENTION
::echo.
::set /p videofileformat=Enter the video file type extension (e.g mp4):
::if /I "%videofileformat%" EQU "webm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if /I "%videofileformat%" EQU "mkv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "vob" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "ogv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "ogg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "drc" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "gif" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "gifv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mng" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "avi" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mov" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "qt" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "wmv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "yuv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "rm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "rmvb" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "asf" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mp4" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "m4p" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "m4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mp2" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpeg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpe" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mpeg" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "m2v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "m4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "svi" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "3gp" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "3g2" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "mxf" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "roq" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "nsv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "flv" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "f4v" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "f4p" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "f4a" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::if/I "%videofileformat%" EQU "f4b" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
::echo you have entered something invalid&goto:VIDEOFILEEXTENTION
:: Set subtitle file extention
:SUBTITLEFILEEXTENTION
echo.
::set /p subtitlefileformat=Enter the subtitle file type extention(e.g srt):
::if/I "%subtitlefileformat%" EQU "aqt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "gsub" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "txt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "jss" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "sub" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "ttxt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "pjs" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "psb" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "rt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "smi" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "stl" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "ssf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "srt" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "ssa" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "ass" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "usf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "idx" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "usf" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::if/I "%subtitlefileformat%" EQU "pgs" echo You have chosen %subtitlefileformat% as your subtitle file format&goto:Get_ISOlanguage
::echo you have entered something invalid&goto:SUBTITLEFILEEXTENTION
:: Set Subtitle language code
:Get_ISOlanguage
::echo.
::set "language=not valid"
::set /p "ISOlanguage=Enter subtitle language(e.g eng, fre, ger or similar):"
::for /f "tokens=3 delims=," %%i in ('find "DATA,%ISOlanguage%," "%~f0"') do set language=%%i
set language=Eng
echo - You have chosen %language% subtitles
::if"%language%"=="not valid" goto :Get_ISOlanguage
goto :CONTINUE1
DATA,abk,Abkhazian
DATA,ace,Achinese
DATA,ach,Acoli
DATA,ada,Adangme
DATA,ady,Adyghe; Adygei
DATA,aar,Afar
DATA,afh,Afrihili
DATA,afr,Afrikaans
DATA,afa,Afro-Asiatic languages
DATA,ain,Ainu
DATA,aka,Akan
DATA,akk,Akkadian
DATA,alb,Albanian
DATA,ale,Aleut
DATA,alg,Algonquian languages
DATA,tut,Altaic languages
DATA,amh,Amharic
DATA,anp,Angika
DATA,apa,Apache languages
DATA,ara,Arabic
DATA,arg,Aragonese
DATA,arp,Arapaho
DATA,arw,Arawak
DATA,arm,Armenian
DATA,rup,Aromanian; Arumanian; Macedo-Romanian
DATA,art,Artificial languages
DATA,asm,Assamese
DATA,ast,Asturian; Bable; Leonese; Asturleonese
DATA,ath,Athapascan languages
DATA,aus,Australian languages
DATA,map,Austronesian languages
DATA,ava,Avaric
DATA,ave,Avestan
DATA,awa,Awadhi
DATA,aym,Aymara
DATA,aze,Azerbaijani
DATA,ban,Balinese
DATA,bat,Baltic languages
DATA,bal,Baluchi
DATA,bam,Bambara
DATA,bai,Bamileke languages
DATA,bad,Banda languages
DATA,bnt,Bantu languages
DATA,bas,Basa
DATA,bak,Bashkir
DATA,baq,Basque
DATA,btk,Batak languages
DATA,bej,Beja; Bedawiyet
DATA,bel,Belarusian
DATA,bem,Bemba
DATA,ben,Bengali
DATA,ber,Berber languages
DATA,bho,Bhojpuri
DATA,bih,Bihari languages
DATA,bik,Bikol
DATA,bin,Bini; Edo
DATA,bis,Bislama
DATA,byn,Blin; Bilin
DATA,zbl,Blissymbols; Blissymbolics; Bliss
DATA,nob,Bokmål, Norwegian; Norwegian Bokmål
DATA,bos,Bosnian
DATA,bra,Braj
DATA,bre,Breton
DATA,bug,Buginese
DATA,bul,Bulgarian
DATA,bua,Buriat
DATA,bur,Burmese
DATA,cad,Caddo
DATA,cat,Catalan; Valencian
DATA,cau,Caucasian languages
DATA,ceb,Cebuano
DATA,cel,Celtic languages
DATA,cai,Central American Indian languages
DATA,khm,Central Khmer
DATA,chg,Chagatai
DATA,cmc,Chamic languages
DATA,cha,Chamorro
DATA,che,Chechen
DATA,chr,Cherokee
DATA,chy,Cheyenne
DATA,chb,Chibcha
DATA,nya,Chichewa; Chewa; Nyanja
DATA,chi,Chinese
DATA,chp,Chipewyan; Dene Suline
DATA,cho,Choctaw
DATA,chu,Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
DATA,chk,Chuukese
DATA,chv,Chuvash
DATA,nwc,Classical Newari; Old Newari; Classical Nepal Bhasa
DATA,syc,Classical Syriac
DATA,cop,Coptic
DATA,cor,Cornish
DATA,cos,Corsican
DATA,cre,Cree
DATA,mus,Creek
DATA,crp,Creoles and pidgins
DATA,cpe,Creoles and pidgins, English based
DATA,cpf,Creoles and pidgins, French-based
DATA,cpp,Creoles and pidgins, Portuguese-based
DATA,crh,Crimean Tatar; Crimean Turkish
DATA,hrv,Croatian
DATA,cus,Cushitic languages
DATA,cze,Czech
DATA,dak,Dakota
DATA,dan,Danish
DATA,dar,Dargwa
DATA,del,Delaware
DATA,din,Dinka
DATA,div,Divehi; Dhivehi; Maldivian
DATA,doi,Dogri
DATA,dgr,Dogrib
DATA,dra,Dravidian languages
DATA,dua,Duala
DATA,dum,Dutch, Middle (ca.1050-1350)
DATA,dut,Dutch; Flemish
DATA,dyu,Dyula
DATA,dzo,Dzongkha
DATA,frs,Eastern Frisian
DATA,efi,Efik
DATA,egy,Egyptian (Ancient)
DATA,eka,Ekajuk
DATA,elx,Elamite
DATA,eng,English
DATA,myv,Erzya
DATA,epo,Esperanto
DATA,est,Estonian
DATA,ewe,Ewe
DATA,ewo,Ewondo
DATA,fan,Fang
DATA,fat,Fanti
DATA,fao,Faroese
DATA,fij,Fijian
DATA,fil,Filipino; Pilipino
DATA,fin,Finnish
DATA,fiu,Finno-Ugrian languages
DATA,fon,Fon
DATA,fre,French
DATA,frm,French, Middle (ca.1400-1600)
DATA,fro,French, Old (842-ca.1400)
DATA,fur,Friulian
DATA,ful,Fulah
DATA,gaa,Ga
DATA,gla,Gaelic; Scottish Gaelic
DATA,car,Galibi Carib
DATA,glg,Galician
DATA,lug,Ganda
DATA,gay,Gayo
DATA,gba,Gbaya
DATA,gez,Geez
DATA,geo,Georgian
DATA,ger,German
DATA,gil,Gilbertese
DATA,gon,Gondi
DATA,gor,Gorontalo
DATA,got,Gothic
DATA,grb,Grebo
DATA,grc,Greek, Ancient (to 1453)
DATA,gre,Greek, Modern (1453-)
DATA,grn,Guarani
DATA,guj,Gujarati
DATA,gwi,Gwich'in
DATA,hai,Haida
DATA,hat,Haitian; Haitian Creole
DATA,hau,Hausa
DATA,haw,Hawaiian
DATA,heb,Hebrew
DATA,her,Herero
DATA,hil,Hiligaynon
DATA,him,Himachali languages; Western Pahari languages
DATA,hin,Hindi
DATA,hmo,Hiri Motu
DATA,hit,Hittite
DATA,hmn,Hmong; Mong
DATA,hun,Hungarian
DATA,hup,Hupa
DATA,iba,Iban
DATA,ice,Icelandic
DATA,ido,Ido
DATA,ibo,Igbo
DATA,ijo,Ijo languages
DATA,ilo,Iloko
DATA,smn,Inari Sami
DATA,inc,Indic languages
DATA,ine,Indo-European languages
DATA,ind,Indonesian
DATA,inh,Ingush
DATA,ina,Interlingua (International Auxiliary Language Association)
DATA,ile,Interlingue; Occidental
DATA,iku,Inuktitut
DATA,ipk,Inupiaq
DATA,ira,Iranian languages
DATA,gle,Irish
DATA,mga,Irish, Middle (900-1200)
DATA,sga,Irish, Old (to 900)
DATA,iro,Iroquoian languages
DATA,ita,Italian
DATA,jpn,Japanese
DATA,jav,Javanese
DATA,jrb,Judeo-Arabic
DATA,jpr,Judeo-Persian
DATA,kbd,Kabardian
DATA,kab,Kabyle
DATA,kac,Kachin; Jingpho
DATA,kal,Kalaallisut; Greenlandic
DATA,xal,Kalmyk; Oirat
DATA,kam,Kamba
DATA,kan,Kannada
DATA,kau,Kanuri
DATA,krc,Karachay-Balkar
DATA,kaa,Kara-Kalpak
DATA,krl,Karelian
DATA,kar,Karen languages
DATA,kas,Kashmiri
DATA,csb,Kashubian
DATA,kaw,Kawi
DATA,kaz,Kazakh
DATA,kha,Khasi
DATA,khi,Khoisan languages
DATA,kho,Khotanese; Sakan
DATA,kik,Kikuyu; Gikuyu
DATA,kmb,Kimbundu
DATA,kin,Kinyarwanda
DATA,kir,Kirghiz; Kyrgyz
DATA,tlh,Klingon; tlhIngan-Hol
DATA,kom,Komi
DATA,kon,Kongo
DATA,kok,Konkani
DATA,kor,Korean
DATA,kos,Kosraean
DATA,kpe,Kpelle
DATA,kro,Kru languages
DATA,kua,Kuanyama; Kwanyama
DATA,kum,Kumyk
DATA,kur,Kurdish
DATA,kru,Kurukh
DATA,kut,Kutenai
DATA,lad,Ladino
DATA,lah,Lahnda
DATA,lam,Lamba
DATA,day,Land Dayak languages
DATA,lao,Lao
DATA,lat,Latin
DATA,lav,Latvian
DATA,lez,Lezghian
DATA,lim,Limburgan; Limburger; Limburgish
DATA,lin,Lingala
DATA,lit,Lithuanian
DATA,jbo,Lojban
DATA,nds,Low German; Low Saxon; German, Low; Saxon, Low
DATA,dsb,Lower Sorbian
DATA,loz,Lozi
DATA,lub,Luba-Katanga
DATA,lua,Luba-Lulua
DATA,lui,Luiseno
DATA,smj,Lule Sami
DATA,lun,Lunda
DATA,luo,Luo (Kenya and Tanzania)
DATA,lus,Lushai
DATA,ltz,Luxembourgish; Letzeburgesch
DATA,mac,Macedonian
DATA,mad,Madurese
DATA,mag,Magahi
DATA,mai,Maithili
DATA,mak,Makasar
DATA,mlg,Malagasy
DATA,may,Malay
DATA,mal,Malayalam
DATA,mlt,Maltese
DATA,mnc,Manchu
DATA,mdr,Mandar
DATA,man,Mandingo
DATA,mni,Manipuri
DATA,mno,Manobo languages
DATA,glv,Manx
DATA,mao,Maori
DATA,arn,Mapudungun; Mapuche
DATA,mar,Marathi
DATA,chm,Mari
DATA,mah,Marshallese
DATA,mwr,Marwari
DATA,mas,Masai
DATA,myn,Mayan languages
DATA,men,Mende
DATA,mic,Mi'kmaq; Micmac
DATA,min,Minangkabau
DATA,mwl,Mirandese
DATA,moh,Mohawk
DATA,mdf,Moksha
DATA,lol,Mongo
DATA,mon,Mongolian
DATA,mkh,Mon-Khmer languages
DATA,mos,Mossi
DATA,mul,Multiple languages
DATA,mun,Munda languages
DATA,nah,Nahuatl languages
DATA,nau,Nauru
DATA,nav,Navajo; Navaho
DATA,nde,Ndebele, North; North Ndebele
DATA,nbl,Ndebele, South; South Ndebele
DATA,ndo,Ndonga
DATA,nap,Neapolitan
DATA,new,Nepal Bhasa; Newari
DATA,nep,Nepali
DATA,nia,Nias
DATA,nic,Niger-Kordofanian languages
DATA,ssa,Nilo-Saharan languages
DATA,niu,Niuean
DATA,nqo,N'Ko
DATA,zxx,No linguistic content; Not applicable
DATA,nog,Nogai
DATA,non,Norse, Old
DATA,nai,North American Indian languages
DATA,frr,Northern Frisian
DATA,sme,Northern Sami
DATA,nor,Norwegian
DATA,nno,Norwegian Nynorsk; Nynorsk, Norwegian
DATA,nub,Nubian languages
DATA,nym,Nyamwezi
DATA,nyn,Nyankole
DATA,nyo,Nyoro
DATA,nzi,Nzima
DATA,oci,Occitan (post 1500)
DATA,arc,Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)
DATA,oji,Ojibwa
DATA,ori,Oriya
DATA,orm,Oromo
DATA,osa,Osage
DATA,oss,Ossetian; Ossetic
DATA,oto,Otomian languages
DATA,pal,Pahlavi
DATA,pau,Palauan
DATA,pli,Pali
DATA,pam,Pampanga; Kapampangan
DATA,pag,Pangasinan
DATA,pan,Panjabi; Punjabi
DATA,pap,Papiamento
DATA,paa,Papuan languages
DATA,nso,Pedi; Sepedi; Northern Sotho
DATA,per,Persian
DATA,peo,Persian, Old (ca.600-400 B.C.)
DATA,phi,Philippine languages
DATA,phn,Phoenician
DATA,pon,Pohnpeian
DATA,pol,Polish
DATA,por,Portuguese
DATA,pra,Prakrit languages
DATA,pro,Provençal, Old (to 1500);Occitan, Old (to 1500)
DATA,pus,Pushto; Pashto
DATA,que,Quechua
DATA,raj,Rajasthani
DATA,rap,Rapanui
DATA,rar,Rarotongan; Cook Islands Maori
DATA,qaa,Reserved for local use
DATA,roa,Romance languages
DATA,rum,Romanian; Moldavian; Moldovan
DATA,roh,Romansh
DATA,rom,Romany
DATA,run,Rundi
DATA,rus,Russian
DATA,sal,Salishan languages
DATA,sam,Samaritan Aramaic
DATA,smi,Sami languages
DATA,smo,Samoan
DATA,sad,Sandawe
DATA,sag,Sango
DATA,san,Sanskrit
DATA,sat,Santali
DATA,srd,Sardinian
DATA,sas,Sasak
DATA,sco,Scots
DATA,sel,Selkup
DATA,sem,Semitic languages
DATA,srp,Serbian
DATA,srr,Serer
DATA,shn,Shan
DATA,sna,Shona
DATA,iii,Sichuan Yi; Nuosu
DATA,scn,Sicilian
DATA,sid,Sidamo
DATA,sgn,Sign Languages
DATA,bla,Siksika
DATA,snd,Sindhi
DATA,sin,Sinhala; Sinhalese
DATA,sit,Sino-Tibetan languages
DATA,sio,Siouan languages
DATA,sms,Skolt Sami
DATA,den,Slave (Athapascan)
DATA,sla,Slavic languages
DATA,slo,Slovak
DATA,slv,Slovenian
DATA,sog,Sogdian
DATA,som,Somali
DATA,son,Songhai languages
DATA,snk,Soninke
DATA,wen,Sorbian languages
DATA,sot,Sotho, Southern
DATA,sai,South American Indian languages
DATA,alt,Southern Altai
DATA,sma,Southern Sami
DATA,spa,Spanish; Castilian
DATA,srn,Sranan Tongo
DATA,zgh,Standard Moroccan Tamazight
DATA,suk,Sukuma
DATA,sux,Sumerian
DATA,sun,Sundanese
DATA,sus,Susu
DATA,swa,Swahili
DATA,ssw,Swati
DATA,swe,Swedish
DATA,gsw,Swiss German; Alemannic; Alsatian
DATA,syr,Syriac
DATA,tgl,Tagalog
DATA,tah,Tahitian
DATA,tai,Tai languages
DATA,tgk,Tajik
DATA,tmh,Tamashek
DATA,tam,Tamil
DATA,tat,Tatar
DATA,tel,Telugu
DATA,ter,Tereno
DATA,tet,Tetum
DATA,tha,Thai
DATA,tib,Tibetan
DATA,tig,Tigre
DATA,tir,Tigrinya
DATA,tem,Timne
DATA,tiv,Tiv
DATA,tli,Tlingit
DATA,tpi,Tok Pisin
DATA,tkl,Tokelau
DATA,tog,Tonga (Nyasa)
DATA,ton,Tonga (Tonga Islands)
DATA,tsi,Tsimshian
DATA,tso,Tsonga
DATA,tsn,Tswana
DATA,tum,Tumbuka
DATA,tup,Tupi languages
DATA,tur,Turkish
DATA,ota,Turkish, Ottoman (1500-1928)
DATA,tuk,Turkmen
DATA,tvl,Tuvalu
DATA,tyv,Tuvinian
DATA,twi,Twi
DATA,udm,Udmurt
DATA,uga,Ugaritic
DATA,uig,Uighur; Uyghur
DATA,ukr,Ukrainian
DATA,umb,Umbundu
DATA,mis,Uncoded languages
DATA,und,Undetermined
DATA,hsb,Upper Sorbian
DATA,urd,Urdu
DATA,uzb,Uzbek
DATA,vai,Vai
DATA,ven,Venda
DATA,vie,Vietnamese
DATA,vol,Volapük
DATA,vot,Votic
DATA,wak,Wakashan languages
DATA,wln,Walloon
DATA,war,Waray
DATA,was,Washo
DATA,wel,Welsh
DATA,fry,Western Frisian
DATA,wal,Wolaitta; Wolaytta
DATA,wol,Wolof
DATA,xho,Xhosa
DATA,sah,Yakut
DATA,yao,Yao
DATA,yap,Yapese
DATA,yid,Yiddish
DATA,yor,Yoruba
DATA,ypk,Yupik languages
DATA,znd,Zande languages
DATA,zap,Zapotec
DATA,zza,Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki
DATA,zen,Zenaga
DATA,zha,Zhuang; Chuang
DATA,zul,Zulu
DATA,zun,Zuni
:CONTINUE1
:: Default yes/not
:SubtitleDefaultYesNo
::echo.
::set /p subtitledefault=Do you want to make subtitles default [y/n]? :
set subtitledefault=0:yes&goto:CONTINUE2
::if /I "%subtitledefault%" EQU "n" set subtitledefault=1:yes&goto:CONTINUE2
::echo you have entered something invalid&goto:SubtitleDefaultYesNo
:: Forced yes/not
:CONTINUE2
:SubtitleForcedYesNo
::echo.
::set /p subtitledefault=Do you want to make subtitles forced [y/n]? :
::if /I "%subtitledefault%" EQU "y" set subtitledefault=0:yes&goto:CONTINUE3
set subtitledefault=1:yes&goto:CONTINUE3
::echo you have entered something invalid&goto:SubtitleForcedYesNo
:: Set mkvmergepath
:CONTINUE3
Setlocal EnableDelayedExpansion
echo.
set mkvmergepath=C:\INSTNS_ORIGINAL==DO NOT MOVE AWAY\mkvmerge.exe
::Muxing operation
echo.
::for %%A IN (*.%videofileformat%) do ( "!mkvmergepath!" -o "%%~nA - with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:%language% subtitles" --language "0:%ISOlanguage%" "%%~nA.%subtitlefileformat%")

::AVI
for %%A IN (.avi) do ( "!mkvmergepath!" -o "%%~nA - with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")
for %%A IN (
.avi) do ( "!mkvmergepath!" -o "%%~nA - with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")

::MP4
for %%A IN (.MP4) do ( "!mkvmergepath!" -o "%%~nA - with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")
for %%A IN (
.MP4) do ( "!mkvmergepath!" -o "%%~nA - with Sub.mkv" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")

::MKV
for %%A IN (.MKV) do ( "!mkvmergepath!" -o "%%~nA - with Sub.MKV" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.idx")
for %%A IN (
.MKV) do ( "!mkvmergepath!" -o "%%~nA - with Sub.MKV" "%%~A" --forced-track "%subtitledefault%" --default-track "%subtitledefault%" --track-name "0:English subtitles" --language "0:eng" "%%~nA.srt")

:: Confirmation dialog
@echo off
echo ----------------------------------------------------------------------
echo Finished operation!
echo Press any key to exit
pause > nul
cls

@tbone7467
Copy link

I agree Seyoum script has saved me a TON of time. I really appreciate the work that has gone into this script

@Kuju29
Copy link

Kuju29 commented Oct 23, 2020

Hello, Can it be used to add subtitles and audio at the same time?

@wieluk
Copy link

wieluk commented Nov 16, 2020

Is it possible to make a change so this script works for subfolders and maybe subsubfolders ?

Copy link

ghost commented Feb 19, 2021

does anyone have a working fix for having stuff pre-defined. I tried the various scripts people posted here, but they do not work.
I would like default subs to be on Y, forced on N, mkv as container, srt as sub and dut as language.

@kryptik001
Copy link

https://imgur.com/a/clWOhOv does anyone have a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment