xbmc icon indicating copy to clipboard operation
xbmc copied to clipboard

Problem with listing available subtitles

Open mrobe opened this issue 4 years ago • 13 comments
trafficstars

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

I've modified the Estuary skin to display available subtitles for the currently-selected movie, but its behavior is inconsistent.

The problem seems to be in Kodi's ListItem.SubtitleLanguage. The skin calls this function to get the available subtitles.

It seems that if SRT files are present in the same subdirectory — with names like myMovie.eng.srt —, then ListItem.SubtitleLanguage will find them.

However, it doesn't seem to work for vobsub files (sub+idx), i.e., if I have myMovie.eng.idx and myMovie.eng.sub, they are not found. (And, BTW, what is the expected filename for vobsub files that contain several different languages?)

Also, it doesn't work for subs in video streams inside the VIDEO_TS folder.

Is there some work-around, or could this bug be fixed?

Expected Behavior

Here is a clear and concise description of what was expected to happen:

ListItem.SubtitleLanguage should return all subtitles found in MKV (works), VIDEO_TS (doesn't work), SRT (works), and vobsub (sub+idx) files (doesn't work).

Actual Behavior

See above.

Possible Fix

To Reproduce

Steps to reproduce the behavior:

Debuglog

The debuglog can be found here:

http://paste.ubuntu.com/p/JBfWGkNB7s/

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

It should be possible to see information about subtitles on the page for browsing films. This is important for choosing a film to watch, as subtitles for some languages are necessary (e.g., I can watch a film in French by my friend needs subtitles).

Your Environment

Used Operating system:

  • [ ] Android

  • [ ] iOS

  • [ ] tvOS

  • [X] Linux

  • [ ] OSX

  • [ ] Windows

  • [ ] Windows UWP

  • Operating system version/name:

  • Kodi version:

Kodi 19.0-RC1 (18.9.910) on Ubuntu Server 18.04

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

mrobe avatar Feb 06 '21 23:02 mrobe

I've verified that subtitles in .sub and .idx files are displayed without problem and can switch between the languages included. Example:

VTS_07_1.vob
VTS_07_1.sub
VTS_07_1.idx

For the VIDEO_TS folder must play at the folder level to recognize the subtitles.

joseluismarti avatar Feb 07 '21 23:02 joseluismarti

Do you mean the subtitles are displayed when the video is playing? Yes, that works as expected.

The issue is rather with the SubtitleLanguage property. E.g., I have a number of movies with sub+idx files in the folder, but when ListItem.Property(SubtitleLanguage.1) is evaluated in the skin, the result is an empty string.

mrobe avatar Feb 07 '21 23:02 mrobe

@mrobe I think is an incorrect usage of the vobsub subtitle format. Kodi correctly parses the corresponding *.idx file and fills the language accordingly. See: https://wiki.multimedia.cx/index.php/VOBsub

I used the files from http://www.mediafire.com/file/jjkkh9iak234m40/Specs_and_idx-sub_files.rar/file to test

enen92 avatar Feb 09 '21 22:02 enen92

Thanks for looking at this. Unfortunately, the issue is not resolved. There's something of a puzzle here.

It would be simplest if you could re-open this issue.

I tried renaming the existing idx/sub files to eliminate "eng", and I also downloaded and tried the sub/idx files you used to test (in case my idx/sub files were somehow corrupted).

In both cases, Kodi still fails to detect the subs.

Not only does Kodi fail to detect the idx/sub files, but it also fails to detect SRT subs in this movie directory. I have tried (1) just sub/idx fails (this fails); (2) sub/idx and SRT files in the same directory (also fails); (3) just one SRT file in the same directory (also fails). After each change, I update the library and check again. However, I have some other movies in the same source for which subs are detected as expected.

This leads me to ask: what is the difference between the movies for which subs are detected, and this movie for which subs are not detected? Looking in the log file, I find this:

DEBUG <general>: ffmpeg[0x55747e04ffc0X]: [image2] Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format.
ERROR <general>: DoWork - Direct texture file loading failed for resource://resource.images.studios.white/Daiei Motion Picture Co., Ltd..png

Is it possible that ListItem.Property(SubtitleLanguage.1) is failing to find the subtitles, either because of the warning from ffmpeg, or because the icon for the studio (Daiei) is not found?

mrobe avatar Feb 10 '21 02:02 mrobe

Share a full debug log playing the file in which subs are not being added to the player despite being on the media folder. If possible use the same files I used to test by placing the idx and sub file in your movie directory and renaming the files exactly like the movie file.

enen92 avatar Feb 10 '21 07:02 enen92

Alrighty. Here's the debug log: http://paste.ubuntu.com/p/wWJ56qY4ZF/

Just to clarify, this is not a problem during movie playback. The problem is when I am browsing the movie library, before I play the movie. The skin doesn't show that subs are available.

I've taken one pair of the sub/idx files from the test bundle that you kindly provided, placed them in the same directory as the movie, and renamed them to be exactly the same as the mkv file. Here's how it looks (not sure how to link to an image here):

https://ipfs.io/ipfs/QmWCJ88FERTNh9WVaPPLDzcGA5kircbZ3BkSkUFYjCYuac/Screen_Shot_2021-02-10_at_18.41.56.webp

Then, rebooted the machine and browsed the movie with added test subs. As before, the skin (i.e., ListItem.Property(SubtitleLanguage.1), that is), does not report that subs are available.

I think the issue occurs around when DialogVideoInfo.xml is loaded by the skin.

Thanks!

mrobe avatar Feb 10 '21 09:02 mrobe

I’m at work so can’t check but I’m pretty sure that label should only work for DialogVideoInfo.xml.

Hitcher avatar Feb 10 '21 10:02 Hitcher

Yeap I'd say so. Those files should only be detected and parsed upon a playback request, otherwise there would be a high performance penalty. @mrobe can you also kindly post a screenshot of the skin dialog where you'd expect to see this information? I'm getting a bit lost here :)

enen92 avatar Feb 10 '21 10:02 enen92

Thanks. See this image for an example (lower right-hand corner of the display):

https://ipfs.io/ipfs/QmWgiJcKLJ6GEnm1aPDRr4MYqFpmRvMbsvxQ6TcQdj87vZ/IMG_7750.jpg

I have modified /usr/share/kodi/addons/skin.estuary/xml/Includes.xml in my Kodi installation to show subtitles during browsing — same info on subs that normally appears on the DialogVideoInfo.xml of some skins (but not Estuary). It works fine for subtitles embedded in mkv files, but it doesn't seem to work for sub/idx or srt files.

@HitcherUK, I understand your concern, but it seems like the performance penalty should be small. For SRT files, it's not even necessary to open the file — the subtitle language is part of the file name. Idx files are also fairly small, and the first "id" tag to identify the language generally appears within the first 2K block.

As it stands now, the behavior is inconsistent — subs are indicated for some films, but not for others —, and this is quite difficult in a group viewing situation.

P.S. If you want studio logos for some Japanese studios like Daiei and ATG, I can make and send PNGs.

mrobe avatar Feb 10 '21 12:02 mrobe

Bump.

mrobe avatar Oct 31 '21 02:10 mrobe

I am getting crashes on Android (SHIELD TV) when browsing the file system, possibly caused indirectly by this same issue. The log says: Custom AVIOContext makes no sense and will be ignored with AVFMT_NOFILE format. and that's the last thing. It just crashes immediately (Kodi closes) with no further log messages. If showing subtitle information is absolutely necessary for some people when browsing, then that sounds like a job for an addon to me, when it's possible that subtitles can make Kodi flat out crash and not log anything.

BenMcLean avatar May 31 '22 15:05 BenMcLean

For me, at least, complete subtitle information is essential functionality, and the lack of support for this in Kodi is just an unending annoyance. I would even say it's the least satisfying and most annoying part of the whole Kodi experience.

My vote would be to make this optional functionality in the Kodi base, that can be enabled if desired. That would address the concerns raised by @BenMcLean.

I tried hacking the skin for this but the underlying APIs don't work (which is why I opened this issue early last year). Even if I hack the skin for a partial solution, I then have to keep re-applying my hacks every time the skin gets updated (this already happened a couple of times). AFAICT, an addon would have the same issues.

mrobe avatar Jun 01 '22 00:06 mrobe

Just adding that I can confirm that this issue occurs for me also. Initial scan of library the .srt files are recognised and SubtitleLanguage infolabels are filled correctly. However, after refreshing the movie details, the files are no longer recognised and SubtitleLanguage is empty.

@mrobe - You might be interested in these instructions I posted for how to use .nfo files as a workaround https://github.com/jurialmunkey/skin.arctic.horizon.2/issues/359#issuecomment-1193043897

However, that's just a workaround. Clearly Kodi has no issue with recognising the files, adding the metadata to the library, or displaying the infolabels as it all works as expected on the initial scan. It is only after refreshing a movie info that this data is lost and there is no way to get the metadata back into the library. Even removing item, cleaning library, and then rescanning doesn't work -- the only way is to do a library database deletion and rescan from scratch.

jurialmunkey avatar Jul 23 '22 03:07 jurialmunkey