omxplayer
omxplayer copied to clipboard
Embedded subtitles in mkv not displayed
When playing a mkv video with embedded subtitles, these are not displayed. This appears around the beginning of the player log:
ERROR: OMXPlayerSubtitles::RenderLoop threw 13Enforce_error (Enforcement failed in SubtitleRenderer.cpp(309))
Video file linked just in case: http://www.mediafire.com/?iexe61sjtxasoux
ASS subtitles aren't supported, unfortunately. The error message is the log version of "Unable to open font".
Ah, I see... are there any plans on adding support for that subtitle format?
Someone would have to integrate http://code.google.com/p/libass/. XBMC supports it, if you can use that.
Grepping a video file of mine that is failing (but I do not see the OP's log message) I see:
S_TEXT/ASS
[Script Info]
; Script generated by Aegisub 2.1.8
; http://www.aegisub.org/
Title: Default Aegisub file
So is this the unsupported sort of subtitles as well? Is there an easy way to convert this MKV file to one with the sort of subtitles that are supported?
Yes, that's the unsupported one. As long the special formatting is not strictly needed, though, they can be converted to simple text subtitles. I believe it's fairly trivial to make omxplayer do this automatically, but I haven't gotten around to it yet. In the meantime you can use the following procedure to convert them:
-
mkvinfo videofile.mkv
and look for the track index of the subtitle track. -
mkvextract tracks videofile.mkv [track index]:subtitles.ass
to demux the subtitles and save them to the filesubtitles.ass
. - Use any subtitle editor to convert the file to srt. Subtitle Editor (http://home.gna.org/subtitleeditor/) is great.
Now you have the choice between muxing the srt subtitles into a new mkv file with mkvmerge and playing that, or using this omxplayer fork https://github.com/torarin/omxplayer/downloads to play them directly from the srt file.
Thanks! I got it working.
Hmm, I think some subtitles are designed expecting word wrap, which omxplayer does not do. But that's a seperate bug.
Yes, it can't do that, and I don't think Subtitle Editor can either, but there's probably an editor out there that can rewrap.
I'm also interested in this feature enhancement. It would rock even more if omxplayer could use the built in fonts in an MKV container in the future.
I have implemented basic support for MKV-embedded SSA subtitles: https://github.com/torarin/omxplayer/downloads
are external ass sub suported in current omxplayer? and with your patch?
No, only embedded.
torarin, you are a miracle worker. After installing from your link the subtitles work great on my mkv vids. Just don't forget the -t option :)
Thank you. This has been merged into the main branch now, the latest builds are here: http://omxplayer.sconde.net/
And there was me trying to figure out how to fix that myself and then I find this post.
Torarin, any chance of pushing your changes to the main branch? I'm sure there are lots of others would appreciate having them without having to search and find this web page.
I just noticed that you already said that the changes have been merged to the main branch. Silly me. Anyway I went to omxplayer.sconde.net and downloaded and tried:
The latest build. The latest build before the comment that later builds come from the popcornmix fork. The build that says it fixes ssa subtitles in MKV files.
None of them worked.
Will the loop option be available in the main branch?
Still not working :(
Manual solution:
for i in *.ass ; do ffmpeg -i "$i" "${i%.*}.srt" ; done
Via Superuser: https://superuser.com/questions/117929/open-source-command-line-subtitle-converter