Netflix Subtitles

Earlier this year, Netflix announced the beginning of subtitles support for Instant Streaming.  At the time, this only included about 100 episodes of Lost.  Fast forward 5 months and there’s still no indication of additional support.  While I’m grateful that something was offered at all, I’m still wondering what’s taking so long for additional support.  Other streaming sites such as Hulu have a much more diverse library of tv shows that are subtitled.  If I want to watch a TV show online, I’ll probably go to Hulu, but most of my online watching consists of movies.  If I want to see a TV show, I’ll just DVR it at home.

So, since there are no movies I can see that yet have subtitles in Netflix, watching instantly is kind of useless to me.  So I started looking for ways to use subtitles downloaded freely from other websites.  Initially I was thinking of using VLC somehow since VLC can open an SRT file and overlay it onto the video.  My googling for that idea turned up nil, so I decided to broaden my search & googled “netflix subtitles”.  That’s where I came across this blog post by Josh Erickson.  That’s where I learned about the keyboard shortcuts available for the Netflix player, and the ability to embed DFXP subtitle files.  I’d never heard of DFXP before, but apparently it’s an XML W3 standard for subtitles.  Cool!  I noticed the script was written in PowerShell, which means Windows only, but a talented Python developer also found the same blog ahead of me and ported the script to python for us Mac OS or Linux users.  Also worth noting that Josh has developed a GUI for the script that he calls Subvert which should be easier for Windows users to use.  Very cool!

Since I’m primarily a Mac user, I downloaded the python script to try it out.  First I needed to find some (good) SRT files for the movie I wanted to watch.  There are several sites to find subtitles.  I personally haven’t found a favorite, but if you google “download subtitles”, the first page of results will list several good ones.  I usually wind up using opensubtitles.org the most.

So now that we’ve downloaded the python script and the subtitle SRT file we want to use, we need to convert the SRT file to DFXP.  Here’s how:

First off, you’re going to have to use the command line. On your Mac, there’s an application in your Applications, Utilities folder called Terminal.  When you open it, it’ll look something like this:

I won’t go into full detail as to what you’re seeing here, as it’s outside the scope of this article.  If you’re curious, Google “using bash”.  So, when you open Terminal.app, you’re basically looking at a location (directory) on your hard drive.  By default, this is your home directory (Macintosh HD, Users, you… or /Users/you in Terminal-speak).  If you type the command “ls” (without quotes) and hit enter, you’ll see a printout of your home directory (Desktop, Documents, Photos, Movies, etc).  These are the same as the folders you see in Finder, you’re just looking at it from the command line interface.

So, assuming you downloaded & unzipped the python script as well as the SRT file for the movie you want to watch, they’ll most likely be in your Downloads folder.  For simplicities sake, let’s make a folder in your home directory called “subtitles” using Finder.  Go ahead and copy the srt2dfxp.py file (the python script) and the SRT file to this folder.  From the Terminal app, type:

[sourcecode language=“bash”]cd subtitles[/sourcecode]

(this is case sensitive, so if you created the folder with a capital S, you’ll need to type a capital S)

From there, we need to make sure the srt2dfxp.py file is executable in the shell we’re in, so we do this by typing

[sourcecode language=“bash”]chmod +x srt2dfxp.py[/sourcecode]

and hitting enter. It may be that the file is already executable, but doing this won’t hurt anything. Now we actually run it:

[sourcecode language=“bash”]./srt2dfxp.py[/sourcecode]

or

[sourcecode language=“bash”]python srt2dfxp.py[/sourcecode]

which prints out how to use it:

[sourcecode language=“bash”]$ srt2dfxp.py
SubRip to W3 Timed Text (DFXP) Converter v1.3
Original PowerShell version by Josh Erickson
Python port by Cody “codeman38” Boisclair

Usage:
srt2dfxp.py [-n] [-t OFFSET] INFILE [OUTFILE]
-n use Netflix-compatible format
-t add OFFSET seconds to timestamps of original SubRip file
INFILE input file name
OUTFILE output file name; will output to STDOUT if omitted[/sourcecode]

So, let’s say the name of the SRT file is movie.srt, your command to convert it to dfxp would be this:

[sourcecode language=“bash”]./srt2dfxp.py -n -t 15 movie.srt movie.dfxp[/sourcecode]

The -n option is for Netflix compatible format (obviously required here). The -t option is to adjust the start time of the dfxp file in case the Netflix stream doesn’t match up to the original SRT file.

Now we need to load it by switching to the Netflix player and pressing Ctrl+Shift+Alt+M simultaneously. Use your mouse to click “Load Custom DFXP File”, and then point it to your newly created “movie.dfxp” file in the subtitles folder. If it works, you’ll notice the Subtitles button appears on the player bar:

Now, assuming you downloaded a good SRT file and the timing is correct, you’re good to go!

I experimented the better part of a day with downloading and converting subtitles, then loading them into the Netflix player.  My experience was mixed.  I encountered two main problems:

  1. Some of the DFXP files wouldn’t load.  I’m not exactly sure why that is, but I think it is because the SRT file might have been messed up somehow.  It may have also been due to the conversion process.  I don’t think the Netflix Player will load a file that’s not w3 compliant.  I did find that if I converted a different SRT file for the same movie, it worked.  I guess it’s just a matter of finding a reliable source.
  2. The timing of the subtitles is almost always off.  The only way to fix this is to experiment with the -t flag when creating the DFXP file.  It is a very tedious process, because you have to create the file and load it into the Netflix Player each time. According to the guy who wrote the python script:

    As for timing, my experience has been that the timing is pretty much the same on all the sites. Typically the issue is that Netflix gets a different print from the studios for streaming than what’s used on the DVD.

    So it’s just a matter of playing around with the times to get it right. One important note is that the -t value can be positive or negative: -t 15 or -t -15. It’s a little mind bending trying to keep up with which way to adjust the time. On one particular movie, Die Hard 3, I had to adjust the time to -120 and it took me about 30 mins to find the right time!. That was frustrating!

So, once you find the right SRT file and adjust the timing, you’re good to go. I could understand how one would want to keep these valuable dfxp files around in case they’re needed later. Someone already came up with that idea, and started posting some to their blog: http://www.carolinamaria.com/nfsubs/.  I’m going to look around and see if I can find more collections.  I think it’s a good idea to host DFXP files that have been tested and are known to work, so I’m going to try to get involved in the collection as well as possibly promote the existing site(s) more.  I have no idea whether or not there are any legal implications with doing so.  I hope not.

I actually thought about trying to write some sort of GUI wrapper to the python script, but I realized it wouldn’t really help much with making the conversion easier.  What would be really cool is if I could figure out some way to have the app read the Netflix Player screen somehow to automatically detect when the movie starts, which would make getting the timing right a lot easier.  Problem is, I have no idea how to do such a thing.  Some kind of audio or visual trigger, even if it were manually done, would probably help a lot.  I guess it would benefit to know how the timing on the SRT file begins, & if there’s some standard involved.  More to learn…

Comments