Anamorphic Oh My

Missing Subtitles

In the fairly recent past our Roku TV auto upgraded its operating system. The Jellyfin server on my NAS was updated. And the Jellyfin “channel” (i.e. app) on the Roku TV auto updated as well.

Then I manually edited a .srt subtitle file on a recently added movie to improve it some. When I went to check my edits on the TV no subtitles appeared at all.

Might be the Roku OS update. Might be the Jellyfin server update. Might be the Jellyfin channel (app) update. Might be the edits I made on the .srt file.

Starting with the most obvious and recent thing, I assumed a bad .srt file. But it looked okay when examined in the editor. A diff between the most recent and the last good version didn’t turn up obvious problems. And restoring the last good version to the server made no difference.

At least it wasn’t a typo on my part that caused the problem. So what is the issue?

By way of a little more background, the movie in question has a run time of nearly three hours and it takes a while for Handbrake to process the DVD. So each debug experiment that involve re-encoding the movie takes a pretty long time.

Anyway, after more futzing that I should admit to I finally resorted to doing a web search and found that the Jellyfin app/channel for Roku had a bug. And update was released within a day of my reading the issues page on Github. So I thought my problem could be over once the TV auto updated its channels (apps). But, again, no dice.

After the latest Jellyfin app for Roku was released the developer noted on the Github that disabling “burn in subtitle when transcoding” should fix the problem. I tried that and sure enough, my subtitles returned.

Transcoding?

But why was the movie being transcoded?

When I copy my DVDs and Blu-ray movies to my NAS I use settings that, I thought, would not require transcoding by the weak little processor in my NAS when played on the Roku TV.

A bit more investigation showed that the movie in question was being transcoded because it was in an “anamorphic widescreen” format and, apparently, the Roku TV cannot play that natively.

After yet more futzing around than I care to admit, I found that some DVDs with “anamorphic widescreen” encoding were left in an anamorphic state by Handbrake even when the target selected was for a Roku device with my screen resolution. Fortunately I have only a few such DVDs, mostly very wide screen movies from the 1950s and 1960s. A quick look through my Blu-ray disks did not show any with this issue.

Figuring out Handbrake settings

DVDs have basically a resolution of 640 pixel wide by 480 pixels high. When wide screen formatted movies are stored on DVD they are might be letterboxed by decreasing the vertical dimension until the movie aspect ratio is achieved. This loses vertical resolution.

Or, for “anamorphic widescreen” DVDs, they are stored at the native 640×480 resolution with some extra information saying the horizontal pixels have been squished. It is the responsibility of the playback system to unsquish the horizontal pixels restoring the correct aspect ratio. Then the playback system should letterbox the movie locally. This “anamorphic” storage retains more of the original movie resolution.

It seems that under some conditions Handbrake leaves anamorphic videos in a slightly anamorphic state, instead of the 4:3 ratio of vintage television it seems to change them to a more modern 16:9 ratio (1.78:1 aspect ratio). Some movies are still squished horizontally, just by a different amount than on the DVD.

And, by default, Handbrake will not “allow upscaling”. So it ends up losing vertical resolution in order to keep the video within the horizontal constraints.

What seems to work:

  1. Select the appropriate Roku device in the “presets”. In my case that is “Roku 1080p30 Surround”. Yes, I have an older TV only capable of 1080p.
  2. In the “Dimensions” tab, set “Anamorphic” to “Off”.
  3. In the “Dimensions” tab, uncheck the “Optimal Size” box and check the “Allow Upscaling” box. Uncheck the “Automatic” option under “Final Dimensions”.
  4. Look on the DVD box for something that says what the aspect ratio is. For the movie I have been working on it says “Anamorphic Widescreen (Aspect Ratio 2.20:1)”. Multiply the DVD vertical resolution of 480 by the aspect ratio to get the desired horizontal pixels. In my case that would be 480 times 2.20 equals 1056.
  5. Under “Resolution & Scaling”, set the “Scaled Size” to 1056 wide by 480 high. Apparently not all values are allowed. Handbrake will change the 1056 to 1070 for the width. This gives an aspect ratio of 2.23:1 instead of 2.20:1 but that is close enough for me.
  6. Under “Final Dimensions” set the display width to match the storage size width.
  7. Do any other settings you wish (audio, subtitles, etc.). Then start the job.

When I checked on my TV, the movie was reported to be in a format that can be played directly. And starting the movie took less time that it had before. The faster start up makes a lot of sense as the processor in the NAS is not very powerful and struggles to do real time transcoding.