AnEilifintChorcra@sopuli.xyztoPiracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•How to integrate VOBSUB subtitles (.idx,.sub) in Subs folder into MKV?English
1·
17 hours agoEDIT: https://github.com/gwen-lg/subtile-ocr is better than https://github.com/ruediger/VobSub2SRT Subtitle-ocr had no issue with recognising “I” as “I” while vobsub2srt constantly sees “I” as “|” and blacklisting “|” causes “I” to be recognised as “]” and blacklisting “|” “[” and “]” just leaves a blank space so thanks for the recommendation! I’ll be using that to convert VOBSUB to srt instead
for f in ./*.idx; do
subtile-ocr -l ger -o "${f%.*}.srt" "$f"; done
And then https://mkvtoolnix.download/ to remove any unwanted subtitles from the mkv files
for f in ./*.mkv; do
outdir="nosubs"
mkvmerge -o "${outdir}/$f" --no-subtitles "$f"; done
Finally, I merge the srt files with the mkv files
for f in ./nosubs/*.mkv; do
outdir=addedsubs
g="${f##*/}"
mkvmerge -o "${outdir}/$g" "$f" --language 0:ger --track-name 0:German "${g%.*}".srt; done
Once the files in the addedsubs directory look good, I delete all of the other files. You can add it all to a bash file or make an alias or both and run it wherever
Yeah, mkv can handle VOBSUB. I just prefer text based like srt or ass since you can edit the subtitles to get better timings or changing font/ colour or fix spellings really easily. I also find the VOBSUB a bit blurry around the edges of the text.
If you’re happy with the VOBSUB, then the last bit of code above will merge them with the mkv file and they should be automatically on when using vlc.
Thanks for the links, I was thinking about how outdated vobsub2srt was and definitely want to try these instead!