8

Ubuntu 17.10

Opening videos has always the English subtitles (embedded) on by default, I have to turn them off every time I open I new file.

How to turn it to none as a default?

There is a checkbox for external subtitles that I have turned off. This setting makes no sense at all. It should be apply to embedded subtitles as well.

And no, a horrible hack from another question to set the font size to 1px or something like that is not a solution.

This happens with .mkv containered files with subt subtitle streams in them.

5
  • Which videos? Is it possible the subtitles embedded In The Video? How could a player (any player, not just Totem) suppress them?
    – waltinator
    Nov 22, 2017 at 17:47
  • I think its pretty obvious that I am not talking about hardcoded subtitles but embedded ones (metadata in the file). Obvious because I said I have to turn them off every time, meaning they do in fact turn off and I do in fact have a menu showing me the languages and the none option. Maybe you should read and think next time. Nov 22, 2017 at 17:53
  • Which videos? What format? Are the videos playing in totem, or in a GStreamer selected backend player?
    – waltinator
    Nov 22, 2017 at 18:00
  • What is a GStreamer selected back-end player? And how do I find out if I am using one? Its the default Ubuntu video player totem to my knowable. I do not think it has anything to do with all this questions you are asking. I think totems option is just stupid to be honest. It seems to apply only for external subtitles stored in a separate file (not tested it) I edit the file into in. Nov 22, 2017 at 18:24
  • Seems not possible ATM. But there is a hacky way to disable them in totem alltogether gsettings set org.gnome.totem subtitle-font '[whatever your font is here], 0' Feb 17, 2018 at 11:17

3 Answers 3

6
+500

Make subtitle overlay invisible

After a lot of googling found the same Q&A here in AU: totem (videos) - turn things off?. Just like your question the OP there doesn't want to set font size to 1 pixel as a work around.

The answer posted in the question found that a font size of ``0 using gsettings worked perfectly:


Permanently remove subtitles from your videos

Another option is to permanently remove subtitles from your .mkv files. The author in the link explains how to do it for both soft titles and hard titles (by cropping out the lower part of the picture). The article is divided into three parts:

  • Part One: Check if the Subtitle is Soft Subtitle or not
  • Part Two: How to Remove Soft Subtitle from MKV, AVI and MP4?
  • Part Three: How to Remove Hardcoded Subtitle from MKV, MP4 and AVI?

Email developer with new feature request

The GNOME Totem developer is Bastien Nocera. You can email him at [email protected] and ask for a new feature of setting newly opened video default language. In your case it would be "None". However for other users there is a benefit if for example their system's language was set to "Russian" but they wanted all videos opened to have "English" subtitles.


Change the source code and recompile

Totem source code can be found on github. If the developers doesn't accommodate the new feature request, you can modify the source code:

  1. Find the module where the subtitle format is assigned
  2. Find the line where the subtitle is set to your language
  3. Add a new line of code overriding the language to none

It could take many hours to add the one line to the source code but you might find the process enlightening and enjoyable

I spent about 10 minutes to find the function that sets the subtitle in module: https://github.com/GNOME/totem/blob/master/src/totem-menu.c at line 246:

select_subtitle_action_cb (GSimpleAction *action,
               GVariant      *parameter,
               gpointer       user_data)
{
    totem_playlist_select_subtitle_dialog (TOTEM_OBJECT (user_data)->playlist,
                           TOTEM_PLAYLIST_DIALOG_PLAYING);
}

Totem uses GStreamer for heavy lifting

Thanks to the answer by Chriki, we learn a lot about Totem internals and how it calls GStreamer to do the heavy lifting of video playback. There is a GStreamer interface option where subtitles can be turned off altogether:

  • Supports stream selection and disabling. If your media has multiple audio or subtitle tracks, you can dynamically choose which one to play back, or decide to turn it off altogether (which is especially useful to turn off subtitles). For each of those, use the “current-text” and other related properties.

The part stating "which is especially useful to turn off subtitles" is probably where an updated version of Totem would target.

As pointed out by Chriki, GStreamer selects the default subtitle language and provides a list of all subtitles which Totem uses to populate it's settings menu. Totem is providing another option of "None" which when selected instructs GStreamer to turn off subtitles.

I think the design change would be to remove the "none" option from the subtitle selection menu. Then create a global menu option for "subtitles on/off" which is persistent across Totem sessions. Perhaps when each new video is started a 5 second bubble could display "Available subtitles turned off." to remind the user they can be turned on for the current video if desired.

That said I'm a beginning bash script maker and C programming to modify the Totem to GStreamer interface is above my pay grade.

6
  • 1
    this is exactly what my comment says ;-) Feb 18, 2018 at 8:14
  • @RobertRiedl Please post an answer and I'll delete mine. I had gone googling over hours withing remembering reading your comment. Feb 18, 2018 at 13:10
  • This does not toggle the subtitle setting to 'none'. I would like to learn how to alter the default, or how to persist the change after I toggle it manually. Feb 18, 2018 at 13:11
  • @TomBrossman I searched a long time before finally finding the gsetting by googling that directly which led me to the Ask Ubuntu Q&A in my link. The only other thing people have done is simply remove sub-titles embedded in all the .mkv files. Which could be a worse option for you depending on usage. Feb 18, 2018 at 13:25
  • @TomBrossman I added two more options to the answer. A new feature request would gain more traction by linking all the Q&A's for this feature in the request to the developers. Feb 18, 2018 at 13:52
2

Setting a Default is not Possible with Totem

I have gone through the Totem source code and to date it doesn’t seem to be possible to set either any default subtitle language or “None”. Totem seems to simply always use the default subtitle stream that the underlying GStreamer player selects for the currently played video – and that default is described here: “By default the first subtitle stream with data is played.”

In other words, the answer reported by WinEunuuchs2Unix is probably your best option at the moment. Here it is again with a bit originality added for my own answer:

gsettings set org.gnome.totem subtitle-font \
    "$(gsettings get org.gnome.totem subtitle-font | sed -r -e 's/ [0-9]+([^0-9])?$/ 0\1/')"

You can directly run that in a (bash) Terminal window, i.e., you don’t have to manually think of a font to set; it uses the previously set one (visible with gsettings get org.gnome.totem subtitle-font).

More Details on my Claim

While it’s not easy to prove that something is not available, I would still like to point to some relevant pieces of code that I have come across which seem to support my claim.

The totem_subtitles_update function takes care of updating the subtitles menu. What it does boils down to the following:

action = g_action_map_lookup_action (G_ACTION_MAP (totem), "set-subtitle");
// …
current = bacon_video_widget_get_subtitle (totem->bvw);
g_action_change_state (action, g_variant_new_int32 (current));

In other words, it takes the current subtitle setting from the video widget and uses it in the menu, too.

Here’s what bacon_video_widget_get_subtitle does for the sake of completeness:

g_object_get (G_OBJECT (bvw->priv->play), "current-text", &subtitle, NULL);

The current-text property is queried and its value is returned via the subtitle variable (for being used via the current variable as shown above). And as mentioned above, this property defaults to “the first subtitle stream with data”.

1
  • Your answer here is impressive. I added a new section to the bottom of my answer building upon your hard work. I'm a little out of my depth so I hope I got it right. Thank you. Feb 19, 2018 at 12:13
1

Seems not possible ATM.

But there is a hacky way to disable them in totem alltogether

gsettings set org.gnome.totem subtitle-font '[whatever your font is here], 0'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .