How to set subtitles to 'none' as a default for totem?
Solution 1:
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:
- Find the module where the subtitle format is assigned
- Find the line where the subtitle is set to your language
- 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.
Solution 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”.