-
-
Save nimahkh/36c0dac31d9cb5363cf356095014524f to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| #author: [email protected] | |
| #ffmpeg command from : https://gist.github.com/kurlov/32cbe841ea9d2b299e15297e54ae8971 | |
| NOCOLOR='\033[0m'; | |
| RED='\033[0;31m'; | |
| GREEN='\033[0;32m'; | |
| [ -d added ] || mkdir added | |
| addToMKV(){ | |
| for i in ./*.mkv | |
| do | |
| if [ -f "added/${i%.*}-added-subtitle.mkv" ]; then | |
| echo -e "${RED}${i%.*}-added-subtitle.mkv Exists in added directory${NOCOLOR}" | |
| else | |
| ffmpeg -hide_banner -loglevel panic -i "$i" -sub_charenc 'UTF-8' -f srt -i "${i%.*}.srt" -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt "added/${i%.*}-added-subtitle.mkv"; | |
| echo -e "${GREEN}${1} converted successfully ${i%.*}-with-subtitle.mkv${NOCOLOR}"; | |
| fi | |
| done | |
| } | |
| echo -e "Converting is starting:"; | |
| addToMKV |
How to use this. I couldnt understand this. If u have any youtube channel please upload a video about this. Or else please give a step by step procedure of how to use this
This is made for linux, but you can run it using wsl on windows (https://www.windowscentral.com/install-windows-subsystem-linux-windows-10).
Thank you very much. Now I can watch movies in my tv with subtitles.
works like magic pot, for some video you would probably need to map another audio channel which is -map 0:1
How to use this. I couldnt understand this. If u have any youtube channel please upload a video about this. Or else please give a step by step procedure of how to use this
This is made for linux, but you can run it using wsl on windows (https://www.windowscentral.com/install-windows-subsystem-linux-windows-10).
I made a version for windows.
copy the code to notepad and save as "add_sub.bat"
then execute.
How to use this. I couldnt understand this. If u have any youtube channel please upload a video about this. Or else please give a step by step procedure of how to use this