Intermitent delay playing mkv files with ass subtitles
#1
Hi

I'm having some troubles playing mkv files with embedded ass subtitles and fonts. Sometimes it stalls for 15-20 seconds showing the busy dialog (working and the circle spinning) before the video, then plays just fine.

Quote:13:55:22 T:2924 DEBUG: FactoryCodec - Overlay: SSA Subtitle Decoder - Opening
13:55:22 T:2924 DEBUG: SECTION:LoadDLL(special://xbmcbin/system/players/dvdplayer/libass.dll)
13:55:22 T:2660 DEBUG: Thread CDVDPlayerAudio start, auto delete: 0
13:55:22 T:2660 NOTICE: running thread: CDVDPlayerAudio:Tonguerocess()
13:55:22 T:2924 INFO: CDVDSubtitlesLibass: Creating ASS library structure
13:55:22 T:2924 INFO: CDVDSubtitlesLibass: Initializing ASS library font settings
13:55:22 T:2924 INFO: CDVDSubtitlesLibass: Initializing ASS Renderer
13:55:22 T:2924 ERROR: convert_checked iconv() failed from UTF-8 to UTF-16LE, errno=2(No such file or directory)
13:55:22 T:2460 ERROR: Previous line repeats 43 times.
13:55:22 T:2460 DEBUG: ------ Window Init (DialogBusy.xml) ------
13:55:22 T:2924 ERROR: convert_checked iconv() failed from UTF-8 to UTF-16LE, errno=2(No such file or directory)
13:55:31 T:2460 ERROR: Previous line repeats 141 times.
13:55:31 T:2460 DEBUG: ------ Window Init (Pointer.xml) ------
13:55:31 T:2460 ERROR: Control 1 in window 10099 has been asked to focus, but it can't
13:55:42 T:2460 DEBUG: ------ Window Deinit (Pointer.xml) ------
13:55:42 T:2924 INFO: CDVDSubtitlesLibass: Creating new ASS track
13:55:42 T:2924 DEBUG: FactoryCodec - Overlay: SSA Subtitle Decoder - Opened
13:55:42 T:2924 DEBUG: CEdl::ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: C:\anime\Bakuman\Bakuman S2 Ep03.mkv
13:55:42 T:2924 DEBUG: CDVDPlayer::SetCaching - caching state 2
13:55:42 T:2604 DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE

The same file may play without the delay next time, so can't be precisely reproduced. Looks like some problem with the ass subtitles, it doesn't happen with other files.
Reply
#2
From a quick squint at the source code I'd guess it is failing trying to convert 8 bit characters to UNICODE, and the error 2 is the Windows error ERROR_FILE_NOT_FOUND. I don't know this bit of the code well enough to guess what's happening, but you're getting 186 of these errors and that's what's causing the 20 second delay.

Does the skin make a difference? Have you set a custom font for the subtitles? Do the subtitle files specify a font that isn't available?

JR
Reply
#3
Thanks for your reply, jhsrennie.

I'm using Customizable Confluence as the skin (only for the showcase view), default subtitle font (not used with .ass subtitles) and no missing fonts or undefined styles. All fonts render ok, with or without the delay.

Will try using default Confluence skin and report.
Reply
#4
It might be worth having a look at the .ass file. As I recall these are just text files so you can open them with Notepad.

JR
Reply
#5
Same result using default Confluence skin. Still dozens of "convert_checked iconv() failed from UTF-8 to UTF-16LE, errno=2(No such file or directory)" errors in the log and 20 seconds of delay.

Here's the .ass file:

http://pastebin.com/ga8k3Gju

Note that any .ass file inside a mkv container may produce this error, not only this one.
Reply
#6
The file looks perfectly standard. I'd guess it's something to do with the extraction of the ass file from the MKV, though that's a part of the code I'm not familiar with. If you extract the ass file and use it as external subtitles does that work? Not that I'm recommending this as the solution, but if the ass works externally it must be extracting it from the MKV that's causing the problem.

JR
Reply
#7
I've also noticed this :
- Always on the 1rst file played after i've deleted the fontconfig directory in temp directory.
- On some files some times to times.

Are the fonts Blue Higways and Eras Bold ITC embemded on the mkv ?
Otherwise, last option, provide the whole file to xbmc team, for them to check.
Reply
#8
Extracted .ass file and fonts from the original file, and used alongside a mkv without fonts or subtitles. Same result, 22 seconds this time and 496 errors.
Fonts used: Arial, Blue Highway Bold, Blue Highway Condensed, Blue Highway, Eras Bold ITC.

jpsdr: so may be the fonts used? any way to avoid this problem?

Tried another file with fonts Aubrey and Mentone-SemiBold only, 11 seconds of delay.
Reply
#9
Sorry, i don't know. It's rare, but sometimes fansub teams think that everyone has the same font as them, and don't put them on mkv... It was just to test/confirm if used fonts were included or not in the mkv. After, unfortunately, i've no idea of what causing it.
The best way is to provide the whole mkv file to xbmc team...
Reply
#10
All fonts used and referenced in the .ass file are embedded in the mkv. After the initial delay the video plays just fine without any subtitle error or glitch. Same file played with any external player also plays fine (and without delay).
Reply
#11
Removed all fonts (250mb!) in user/appdata/roaming/XBMC/cache/fonts and the delay is gone!

I think I'll make a script to clear the folder every week or so, is it safe? what's its purpose?
Reply
#12
fems Wrote:Removed all fonts (250mb!) in user/appdata/roaming/XBMC/cache/fonts and the delay is gone!

I think I'll make a script to clear the folder every week or so, is it safe? what's its purpose?

Aaaaahhhhhhhhh! Have a look at 501 (PR).

I noticed this the other day and wondered if it might be related, though I wasn't sure so I didn't mention it.

JR
Reply
#13
I've made some test, and if you delete only cache/fonts in user data, when you replay a file, nothing is displayed anymore (at least, it's what happened for me).
So, from my testing, to have correct subtitle display, you can delete either both fontconfig in temp directory and cache/fonts in user directory or only fontconfig but absolutely not cache/fonts only.
Reply
#14
Ok, finaly behavior is the following :
Start from a state with fontconfig and cache/fonts deleted.
Play file A, display is correct. Play file B, display is incorrect. Delete fontconfig only, and play again file B, display is correct. Now, file A and B will always display properly while cache/fonts is not deleted. Play file C, display is incorrect. Delete fontconfig only and replay file C, display is correct. Now, file A, B and C display properly. Etc...
Reply
#15
I've been able to repro jpsdr's issues with clearing cache/fonts, but it doesn't always happen. It's also not clear how to fix at this time, I pulled the pull request for now.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Intermitent delay playing mkv files with ass subtitles0