omxplayer icon indicating copy to clipboard operation
omxplayer copied to clipboard

Embedded subtitles in mkv not displayed

Open OrdinaryMagician opened this issue 12 years ago • 18 comments

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

OrdinaryMagician avatar Sep 26 '12 20:09 OrdinaryMagician

ASS subtitles aren't supported, unfortunately. The error message is the log version of "Unable to open font".

torarin avatar Sep 26 '12 21:09 torarin

Ah, I see... are there any plans on adding support for that subtitle format?

OrdinaryMagician avatar Sep 26 '12 21:09 OrdinaryMagician

Someone would have to integrate http://code.google.com/p/libass/. XBMC supports it, if you can use that.

torarin avatar Sep 26 '12 21:09 torarin

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?

natearn avatar Nov 11 '12 20:11 natearn

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 file subtitles.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.

torarin avatar Nov 11 '12 21:11 torarin

Thanks! I got it working.

natearn avatar Nov 11 '12 22:11 natearn

Hmm, I think some subtitles are designed expecting word wrap, which omxplayer does not do. But that's a seperate bug.

natearn avatar Nov 11 '12 22:11 natearn

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.

torarin avatar Nov 11 '12 22:11 torarin

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.

Bigun avatar Nov 16 '12 23:11 Bigun

I have implemented basic support for MKV-embedded SSA subtitles: https://github.com/torarin/omxplayer/downloads

torarin avatar Dec 09 '12 18:12 torarin

are external ass sub suported in current omxplayer? and with your patch?

mwestphal avatar Mar 24 '13 20:03 mwestphal

No, only embedded.

torarin avatar Mar 24 '13 21:03 torarin

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 :)

Cognaiscance avatar Mar 27 '13 22:03 Cognaiscance

Thank you. This has been merged into the main branch now, the latest builds are here: http://omxplayer.sconde.net/

torarin avatar Mar 27 '13 23:03 torarin

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.

JontomXire avatar Nov 17 '13 07:11 JontomXire

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.

JontomXire avatar Nov 17 '13 09:11 JontomXire

Will the loop option be available in the main branch?

paolovacirca avatar Nov 17 '13 11:11 paolovacirca

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

someSven avatar Mar 02 '22 07:03 someSven