Jump to content
jhs

Ability to cache internal subtitles when media is added

Recommended Posts

jhs

Hello!
 

It would be very nice if I could make Emby cache the Subtitles from MKV files when added!

 

Also - As a bonus, maybe some way to activate it for already added media - Sometimes it takes a little while, so it would be nice if I could do it manually a litle while before I would like to see the Movie.

 

 

Is there any possibility this could be added? Or would it be hard to make?

 

Best Regards

Jonatan

Share this post


Link to post
Share on other sites
ebr

Not sure I understand what you mean.  Internal subtitles are a part of the mkv file already.

 

Can you explain exactly what you are trying to accomplish?  Thanks.

Share this post


Link to post
Share on other sites
jhs

When I play Media Files with internal subtitles in the MKV files, emby uses ffmpeg to extract the subtitle to /config/data/subtitles/ so that it can be streamed to my device.

 

This sometimes takes a very long time, and it seems Emby has a timeout of 5 minutes ( I wouldb't want to wait 5 minutes or even longer for a movie to start, so that is fine.

But, playing movies where the subtitle is already cached, it plays instantly.

 

So, i thought it coulc be nice if Subtitles could be extracted to the cache, as it is when being played for the first time, so that is just works.
 

I am playing to either Chromecast or Screenplay for LG if that makes a difference.

 

Edit:

Or - I can see in the log, that wven when being slow, it is atleast 2x in the ffmpeg output - Which I assume means 2x faster than normal playback. Could the movie use what has already been created, and just stream the subtitles a litle at a time to the client?

Edited by jhs

Share this post


Link to post
Share on other sites
Deathsquirrel

It sounds like you think the processing time for burning in embedded subs to a movie stream vs the use of external subs is a caching thing.  It's not, it's a transcoding function.  Most devices can't process embedded sub formats used in dvd and blu-rays.  When you use those subs the server often has to transcode the video stream to burn in the subtitles to the image as your client can't just process the subtitle stream and display the text.  On the other hand, support for text-based subtitle formats is widespread; I haven't run into a client that can't display external subtitles.

Share this post


Link to post
Share on other sites
jhs

I might very well be mistaken - but i don't think it gets burned in. the CPU is virtually untouched.

 

When I play media, with internal subtitles, the media just won play, I look on the server, and it is running this command for instance:

/config/ffmpeg/20171308/ffmpeg -i "file:/Shared/amatv/Sneaky Pete/Season 01/Sneaky Pete - S01E07 - Lieutenant Bernhardt.mkv" -map 0:2 -an -vn -c:s copy /config/data/subtitles/8/8654a0f3-9014-f1d2-9bb9-6fa569351d4e.srt

In the Subtitle directory there is many subtitles. Once the proccess is done the media plays. It's this process that I thought would be nice if it happened upon the media getting scanned the first time.

In the Emby log, it looks like it is transmitting a .vtt file, so my assumption was that if my player didn't support internal subtitles, it would extract them, and send them as .vtt files instead.

 

I have seen this happpening on Web player, CHromecast and LG Screenplay app.I don't think it's burning them in, as that would use much more CPU :-)

Edited by jhs

Share this post


Link to post
Share on other sites
Luke

Because what's happening is we're extracting the subtitles, however on some systems, in this case yours, the subtitles can be very slow to extract. So this is causing playback to get hung up. The benefit of this extraction is that allows us to avoid video transcoding and render the subtitles directly in the app.

 

However for some this just takes too long and causes playback to get hung up, so what we're going to be doing soon is adding a setting to the apps to burn them in instead of extract. You'll have to pay the price of a full video transcode, but they will play.

 

That is why having external text based subtitles is currently the most efficient route.

Share this post


Link to post
Share on other sites
jhs

Ah - Okay. 

 

Sometimes it works, and sometimes it doesn't. I am looking into why it sometimes might be slow for me.

 

Burn in really isn't a problem, as long as several people isn't watching at the same time :-)

Edited by jhs

Share this post


Link to post
Share on other sites
Luke

@@jhs, this setting is being added in server transcoding setup for the next release of Emby Server. This will allow you to force subtitles to be burned in. 

 

599ddf899a5bc_Untitled.png

 

Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...