PROJET AUTOBLOG


Between Linux and Anime

Site original : Between Linux and Anime

⇐ retour index

Playing Multiple Subtitles Simultaneously with Mplayer

lundi 29 avril 2013 à 21:12

Well, with any player that plays ass subs really, but the procedure requires Mplayer :)

(I know I haven’t written a real post in a good while and this doesn’t quite count. I’ll post soon! I hope.. at least, I’m positively definitely trying to really write a proper post and push it out as soon as I’m positively capable of doing. No really!)

So I found myself needing to have both english and chinese subtitles on at once today and struggled with it briefly. I eventually found the solution in the form of a script called merge2ass (Source). What it does is it takes two different subtitle files and smushes it into a single ass file that basically shows the first subtitle file at the top of the screen and the second subtitle file at the bottom, something like this:

Yuki is sad all this is harder than she wanted

Usage of the script is simple enough. Make it executable, then supply the video file, the first subtitle file, then the second. You can also just run the script without arguments and it’ll show a nice help message.

chmod +x merge2ass.sh
./merge2ass.sh yourmoviefile.format sub1.srt sub2.srt

This will produce a file called yourmovilefile-bilingual.ass that you could then load with mplayer (or whatever other player you want) to get simultaneous dual subtitles.

Oh right, for this to work with chinese subtitles, you need to change line 125 and/or 128 of the script and supply -subcp enca:zh:BIG5 as an mplayer option, as per this post. Just add it immediately after ‘mplayer’, like so:

mplayer -subcp enca:zh:BIG5 -dumpsrtsub -noautosub -really-quiet -frames 0 -sub "${sub[1]}" "$movie" 2>>"$mplayer_err" && echo "Done"