Jump to content

Ability to cache internal subtitles when media is added


jhs

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...

@@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
Link to comment
Share on other sites

  • 2 years later...
tzuchan

@Luke, I'm having issues with embedded ASS/SSA subtitles losing formatting when transcoded. However, my TV can support ASS/SSA subtitles and when I extract the subtitle and use it as an external sub, I don't lose any formatting.

Can an option be added so that the embedded ass/ssa subs be extracted and cached along side the video ahead of time instead of generating it on runtime? 

Link to comment
Share on other sites

1 hour ago, tzuchan said:

@Luke, I'm having issues with embedded ASS/SSA subtitles losing formatting when transcoded. However, my TV can support ASS/SSA subtitles and when I extract the subtitle and use it as an external sub, I don't lose any formatting.

Can an option be added so that the embedded ass/ssa subs be extracted and cached along side the video ahead of time instead of generating it on runtime? 

It's possible for the future but there are other techniques we're going to explore in the near future first.

  • Like 1
Link to comment
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...