Jump to content

ffmpeg subtitle extraction failed


Recommended Posts

Posted

Hello everyone,

 

I have a small problem with the subtitles. Every time Emby tries to automatically extract the subtitle it fails with the following error:

2017-04-23 16:21:22.8643 Info SubtitleEncoder: Killing ffmpeg subtitle extraction process
2017-04-23 16:21:22.8643 Info SubtitleEncoder: Deleting extracted subtitle due to failure: /var/lib/emby-server/data/subtitles/2/2cebffcc-7106-f247-50c2-bea59ea60376.srt
2017-04-23 16:21:22.8691 Error SubtitleEncoder: ffmpeg subtitle extraction failed for file

This happens always after exactly 5 minutes so I guess it's a fixed set timeout. So I've tried it manually and it took over 16minutes to extract the subtitle.

Is it possible to manually change 5 minutes timeout to something different? I guess my containers are just too big for being processed in under 5 minutes.

 
This is on a Ubuntu 16.04 server.
Posted

So is this working as intended? If yes, is there any possibility for me to increase the speed other than buying a new CPU?

My server is working without problems other than that.

Posted

@@Martum, does 5 minutes vs 10 minutes really matter? Are you actually going to wait that long prior to playback? If this is taking a really long time on your machine then what I would suggest is obtaining external text subtitles. You could try our open subtitles downloading feature to help with that. Let us know if this helps. Thanks !

  • Like 1
Posted (edited)

I've tried the subtitles downloading feature but I only need forced subs and I can't  find a way to only download those.

So the subtitle extraction only starts at the beginning of playback? I thought it was part of the library or subtitle scan.

 

Edit: Maybe something similar to the 3rd option would be good. Currently, we can skip if there are embedded subs available. But what if we could extract those if they are available instead of searching online?

Edited by Martum
Posted (edited)

I've just taken a look at it again and I'm confused because it only utilizes 15% of 1 core even though there is nothing else running besides it. So does it get throttled somehow?

 

Edit: Nevermind, I'm maxed out on memory. I will buy a RAM upgrade and try again.

Edited by Martum
Posted

Hi @@Martum, No I think in ffmpeg this particular extraction function is only single threaded. For whatever reason for some files it can be slow.

  • 7 months later...
Posted (edited)

@@Martum, does 5 minutes vs 10 minutes really matter? Are you actually going to wait that long prior to playback? If this is taking a really long time on your machine then what I would suggest is obtaining external text subtitles. You could try our open subtitles downloading feature to help with that. Let us know if this helps. Thanks !

 

I have this issues with big size files (4K movies for example), subtitle extraction takes more than 5 minutes, and failed. I agree that moving to a higher timer (10 minutes) is not an absolute solution, but it could be a workaround for the time being.

 

@@Luke, would it be possible to explore others solutions?

 

- define an extraction timer proportionate to file size

- make partially extracted subtitles available for the client in order to be displayed asap (best solution from my point of view)

- provide % of extraction OSD, users might choose to pause, waiting for complete extraction

- create a schedule task to extract subtitles 

Edited by nague
Posted

The problem with the scheduled task is that we've been down this road before with other kinds of operations that take a long time. No matter how many warnings we offer, nobody is going to be happy if an extraction takes 20 minutes per video and they have 10,000 videos. If we go that route I just see constant complaints and troubleshooting over it. That's why external subtitles represent the most practical option.

mastrmind11
Posted (edited)

Or, you can schedule your own task to do it, outside of Emby.  ffmpeg is pretty clearly documented, it's literally a command line trigger, and it's done while your server is not active if you schedule it accordingly....

Edited by mastrmind11
Posted (edited)

Thanks @@Luke and @@mastrmind11 for your answer.

 

I get the point, external subtitles are being pushed. But correct me if I’m wrong:

 

- external subtitles are not downloaded with movie file, using emby web download feature

- external subtitles are not downloaded in Android client with offline sync feature

- if I have external and internal subtitle for a same language, emby will prefer the internal one, users have to choose manually the other one, which by the way, has the same label in the play menu

 

Regarding default forced subtitles (present in most mkv files):

- they can’t be find on the net so I have to extract them

- users will never think to switch to the external one

 

My understanding is that internal subtitles that emby is able to extract (in less than 5min) are permanently kept in emby database (/var/lib/emby-server/data/subtitles) for future use. Would it be possible to schedule my own task, outside Emby, to extract subtitles from files of my choice, and put the output in emby database ? In other words, could you provide me a method to insert subtitle in emby database?

Edited by nague
Posted

As far as what emby will prefer, not necessarily. Not if you tag the external subs as default.

Posted

@@Luke in order to build my own extract task, outside emby, is there anything that I can request from emby API (ex: {MediaSourceId}, {Index}, etc.to define the expected srt file name for /var/lib/emby-server/data/subtitles?

Posted

No just name it {movie}.lang.srt

  • 11 months later...
Posted (edited)
Since few weeks, I have an infinite extraction loop when subtitles are requested by Android TV Emby client, when transcoding is necessary and subtitle extraction failed due to 5min timeout.

 

In the server logs, I can see Android TV Emby app http requesting “Subtitles/X/X/Stream.subrip” hours after media viewing has been terminated. I think the issue is in the Android TV app side, in the other hands, if we could extend the 5min timeout, it will really help (I know this point has already been discussed, but the fact is that no machines are able to extract subtitles in a 50Go mkv files in less than 5min…).

Edited by nague
Posted

Hi there, please attach the emby server log. Thanks.

Posted (edited)

Hi Luke, please find server logs in attached file.

emby.logs.txt

Edited by nague
Posted

Ok, I would suggest trying again with the next release as there are a number of changes in this area. Thanks.

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