Subtitles are disabled

Recently upgraded from OSMC 18 to OSMC 20. I copied the old .kodi folder and OSMC updated the settings. So far, so good.

However, when I play an MKV with embedded default subtitle, the subtitle is not shown.
The OSD shows the right subtitle track but subtitles are disabled.
(When the SRT is next to the video – same, the track is located but subtitles are disabled.)

scrot20231212075447

I can enable the subtitles but I have to do this over and over again for every video. Enabling in the OSD and “Set as default for all media” seems to have no effect. For the next video it is disabled again.

How can I permanently enable subtitles for all videos? This worked fine with OSMC 18.

You might check your subtitle settings in Kodi’s main settings. I think there is an option for preferring default or some such. This might be a language issue. The subtile selection system has been reworked in the last few version of Kodi and I think default settings are for proper language selection. I see that your file has a sub with no language set. This isn’t really what you want as proper selection behavior relies on that information.

Thanks for the info. I have already been playing extensively with most of the subtitle-related settings with no success.

There’s a reason for marking a track as “Default”. But even when the subtitle track has a language set and identifies as “Dutch”, and the main setting says that Dutch is one of the languages to load subtitles for, every video starts with subtitles disabled.

If memory serves that auto enable subs option doesn’t factor in when the sub is forced. If you wanted to post logs I could see if it actually got set or not. With forced subs off the top of my head I think it enables them depending on the language of the audio track playing in relation to the language set on the forced track but also this doesn’t work if one or two of the particular subtitle preferences are set. It gets a bit complicated but I’m about 99% certain if you search this forum you will find a thread where I helped someone else out with the same issue and figured out all the do’s and don’t to make everything work correctly.

I can post logs if it may help sorting this out. What log level?
Is it ok that the logs are from Kodi 20.2 on Fedora instead of Kodi 20.2 from OSMC? As far as I can see they both have the same problem.

Searching the forum ("@darwindesign subtitles") did not really help me. Many results are from older versions of Kodi.

Subtitle detection is not the problem. When I play video “Foo.mpg” and there is a file “Foo.srt” next to it, this is detected as “Unknown - (External)”. When named “Foo.nl.srt” it is detected as “Dutch - (External)”. It is just not shown (subtitle disabled).

Similar for MKV (I think this is the relevant part of the log):

2023-12-12 13:52:46.787 T:2150886   debug <general>: ------ Window Init (Pointer.xml) ------
2023-12-12 13:52:46.788 T:2150886   debug <general>: CVideoGUIInfo::InitCurrentItem(/volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv)
2023-12-12 13:52:46.788 T:2150886   debug <general>: CPlayerGUIInfo::InitCurrentItem(/volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv)
2023-12-12 13:52:46.789 T:2170321   debug <general>: Loading settings for /volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv
2023-12-12 13:52:46.790 T:2170355   debug <general>: ScanForExternalSubtitles: Searching for subtitles...
2023-12-12 13:52:46.790 T:2170355   debug <general>: ScanForExternalSubtitles: END (total time: 0 ms)
2023-12-12 13:52:46.790 T:2170355    info <general>: Creating Demuxer
2023-12-12 13:52:46.790 T:2150887   debug <UPNP::BuildObject>: Building didl for object '/volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv'
2023-12-12 13:52:46.790 T:2170355   debug <general>: Open - probing detected format [matroska,webm]
2023-12-12 13:52:46.790 T:2170355   debug <general>: Open - avformat_find_stream_info starting
2023-12-12 13:52:46.791 T:2170355   debug <general>: Open - av_find_stream_info finished
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]: Input #0, matroska,webm, from '/volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv':
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:   Metadata:
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:     title           : A.Discovery.Of.Witches.S01E01.720p.HDTV.x264-MTB
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:     CREATION_TIME   : 2018-10-22T07:08:29Z
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:     ENCODER         : Lavf57.7.2
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:   Duration: 00:44:51.14, start: 0.000000, bitrate: 750 kb/s
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:   Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 720x360 [SAR 1:1 DAR 2:1], 25 fps, 25 tbr, 1k tbn, 25 tbc (default)
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:   Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s (default)
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:     Metadata:
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:       title           : Stereo
2023-12-12 13:52:46.791 T:2170355    info <general>: ffmpeg[0x558ffbc04630]:   Stream #0:2(dut): Subtitle: ass (default) (forced)
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDDemuxFFmpeg::AddStream ID: 0
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDDemuxFFmpeg::AddStream ID: 1
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDDemuxFFmpeg::AddStream ID: 2
2023-12-12 13:52:46.791 T:2170355    info <general>: Opening stream: 0 source: 256
2023-12-12 13:52:46.791 T:2170355    info <general>: Creating video codec with codec id: 12
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDVideoCodecFFmpeg::Open() Using codec: MPEG-4 part 2
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-mpeg4
2023-12-12 13:52:46.791 T:2170355   debug <general>: CVideoPlayerVideo::OpenStream - open stream with codec id: 12
2023-12-12 13:52:46.791 T:2170355    info <general>: Creating video thread
2023-12-12 13:52:46.791 T:2170357   debug <general>: Thread VideoPlayerVideo start, auto delete: false
2023-12-12 13:52:46.791 T:2170357    info <general>: running thread: video_thread
2023-12-12 13:52:46.791 T:2170355   debug <general>: ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: /volume1/Storage0/Video/Series/A_Discovery_Of_Witches/Serie_1/S01E01.mkv
2023-12-12 13:52:46.791 T:2170355    info <general>: Opening stream: 1 source: 256
2023-12-12 13:52:46.791 T:2170355    info <general>: Finding audio codec for: 86017
2023-12-12 13:52:46.791 T:2170357   debug <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_PAUSE: false
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder mp3float
2023-12-12 13:52:46.791 T:2170355    info <general>: OpenStream: Allowing max Out-Of-Sync Value of 10 ms
2023-12-12 13:52:46.791 T:2170355    info <general>: Creating audio thread
2023-12-12 13:52:46.791 T:2170358   debug <general>: Thread VideoPlayerAudio start, auto delete: false
2023-12-12 13:52:46.791 T:2170358    info <general>: running thread: CVideoPlayerAudio::Process()
2023-12-12 13:52:46.791 T:2170358   debug <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_PAUSE: false
2023-12-12 13:52:46.791 T:2170355    info <general>: Opening stream: 2 source: 256
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDSubtitlesLibass: Using libass version 1701000
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDSubtitlesLibass: Creating ASS library structure
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDSubtitlesLibass: Initializing ASS Renderer
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDSubtitlesLibass: [ass] libass API version: 0x1701000
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDSubtitlesLibass: [ass] libass source: tarball: 0.17.1
2023-12-12 13:52:46.791 T:2170356   debug <general>: Thread BackgroundLoader 140367693338304 terminating
2023-12-12 13:52:46.791 T:2170355   debug <general>: CDVDSubtitlesLibass: [ass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 5.2.0 (COMPLEX)
2023-12-12 13:52:46.791 T:2170355    info <general>: CDVDSubtitlesLibass: Initializing ASS library font settings
2023-12-12 13:52:46.806 T:2170355   debug <general>: CDVDSubtitlesLibass: [ass] Using font provider fontconfig
2023-12-12 13:52:46.806 T:2170355    info <general>: CDVDSubtitlesLibass: Creating new ASS track
2023-12-12 13:52:46.806 T:2170355   debug <general>: Created subtitles overlay codec: SSA Subtitle Decoder
2023-12-12 13:52:46.806 T:2170355   debug <general>: CVideoPlayer::SetCaching - caching state 2
2023-12-12 13:52:46.806 T:2170355   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2023-12-12 13:52:46.806 T:2170355   debug <general>: CVideoPlayer::HandleMessages - player 2 reported state: 0
2023-12-12 13:52:46.806 T:2170355   debug <general>: CVideoPlayer::HandleMessages - player 1 reported state: 0
2023-12-12 13:52:46.806 T:2170355   debug <general>: CVideoPlayer::SetCaching - caching state 1
2023-12-12 13:52:46.806 T:2170355   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2023-12-12 13:52:46.806 T:2170321   debug <general>: OnAVChange: CApplication::OnAVChange
2023-12-12 13:52:46.806 T:2170357   debug <general>: CVideoPlayerVideo - Stillframe left, switching to normal playback
2023-12-12 13:52:46.806 T:2170357   debug <general>: libva info: VA-API version 1.16.0
2023-12-12 13:52:46.806 T:2170357   debug <general>: libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
2023-12-12 13:52:46.806 T:2170357   debug <general>: libva info: Found init function __vaDriverInit_1_16
2023-12-12 13:52:46.807 T:2170357   debug <general>: libva info: va_openDriver() returns 0
2023-12-12 13:52:46.807 T:2170357    info <general>: VAAPI::Close
2023-12-12 13:52:46.807 T:2170357    info <general>: VAAPI::Close - closing decoder context
2023-12-12 13:52:46.808 T:2170357    info <general>: CDVDVideoCodecFFmpeg::Open() Using codec: MPEG-4 part 2
2023-12-12 13:52:46.808 T:2170357   debug <general>: CDVDVideoCodecFFmpeg - open frame threaded with 16 threads
2023-12-12 13:52:46.808 T:2170357   debug <general>: CDVDVideoCodecFFmpeg - Updated codec: ff-mpeg4
2023-12-12 13:52:46.811 T:2170358   debug <general>: CDVDAudio::Pause - pausing audio stream
2023-12-12 13:52:46.811 T:2170355    info <general>: Skipped 1 duplicate messages..
2023-12-12 13:52:46.811 T:2170355   debug <general>: CVideoPlayer::SetCaching - caching state 2
2023-12-12 13:52:46.811 T:2170355   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2023-12-12 13:52:46.811 T:2170358    info <general>: Creating audio stream (codec id: 86017, channels: 2, sample rate: 48000, no pass-through)
2023-12-12 13:52:46.811 T:2170358   debug <general>: CVideoPlayerAudio:: synctype set to 0: clock feedback
2023-12-12 13:52:46.812 T:2150913    info <general>: CActiveAESink::OpenSink - initialize sink
2023-12-12 13:52:46.816 T:2170357   debug <general>: CRenderManager::Configure - change configuration. 720x360. display: 720x360. framerate: 25.00.
2023-12-12 13:52:46.888 T:2150886   debug <general>: ------ Window Init (DialogBusy.xml) ------
2023-12-12 13:52:46.893 T:2150886   debug <general>: DeleteRenderer - deleting renderer

(full log at https://www.squirrel.nl/pub/xfer/uploads/3Cy4OuUOEHeSadMAZxEKn9bQ.log.gz)

As you can see, the embedded (default, forced) subtitle is correctly detected. It is just not shown by default.

Then you are much better off reporting it on the Kodi issue forum.

1 Like

This looks pretty germane…

I’m sure with a bit more reading you would find others that are still relevant even with newer version of Kodi. As for the logs the part of interest would be in guisettings.xml…

    <defaultvideosettings>
...
        <showsubtitles>false</showsubtitles>
...
    </defaultvideosettings>

Which is the setting that tells Kodi if it should default to enabling subs. This auto enabling that this setting interact with does not apply if forced subs are present as that supersedes this option as it should.

I would suggest to just take one file with no subtitles but a audio track that is properly set in your language of choice and make sure this is either a new file name or location that Kodi has never touched so you know there is no stored information about it in Kodi’s database. Now take a srt and place it next to it with the same name as the video file and open it via Videos>files>[path to video]. When you do this you should at no point ever turn the sub track on/off or change selected audio or sub track or anything else as when you do things get stored in the database that will spoil the test. At this point you have a test bed that you can play around with Kodi’s subtitle settings and rename the srt to see how the settings interact with the various sub tags…

test.mkv
test.srt
test.forced.srt
test.default.srt
test.default.forced.srt
test.nl.srt
test.dut.srt
test.nl.forced.srt
test.nl.default.srt
test.nl.default.forced.srt

I ran a lot of experiments, including clean re-installs of Kodi.
Detecting (finding) the right subtitle tracks, either embedded or external always works as expected. The subtitles are just not enabled by default.

What I finally found out: I have a TV add-on that I sometimes use to watch TV streams from my provider. I has a setting to disable subtitling when starting a TV stream. If this setting is on, subtitles become disabled by default for all media. Subtitles can be enabled via the OSD screen but “use this as default for all media” does not work. It doesn’t stick. Only after changing the setting in the TV add-on to off the subtitles behave normally again. I have contacted the author of the add-on and asked him if he has an idea what and why this happens this way.

(The add-on calls showSubtitles (Kodi Development: Player). )

1 Like