Jump to content

Keep subtitles when using convert feature


kalon33
 Share

Recommended Posts

kalon33

Hello all,

 

I would like to reencode tv recordings that I recorded using tvheadend into hevc in mkv container. They are in mpegts format, with h264 video, aac audio and dvb_subtitle subtitles.

 

I also would like to keep subtitles, as most of my recordings are in multilangage version with translation in subtitles.

 

Currently, encoding works perfectly as expected and hardware accelerated for both decoding and encoding for video, but subtitles are removed during convert process, as shown in this example: ffmpeg-transcode-a3340299-f30b-418a-a8cd-ffae1c897874_1.txt

 

Would it be possible to encode these subtitles, or at least copy them, during the conversion process?

 

 

Thanks for your help.

 

Nicolas

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Hi, in a similar fashion, when I record a m2ts stream, Emby only keeps the first audio stream and no subtitles, whereas TVheadend recording the same feed will keep all audio streams and subtitles. Could this be fixed? Emby is really nice to record TV shows, but it's a shame not being able to watch them in original version with subtitles, especially as currently I have a mix up of episodes in original audio and translated audio (but only one audio each time).

Thanks for your time.

Link to comment
Share on other sites

4 hours ago, kalon33 said:

Hi, in a similar fashion, when I record a m2ts stream, Emby only keeps the first audio stream and no subtitles, whereas TVheadend recording the same feed will keep all audio streams and subtitles. Could this be fixed? Emby is really nice to record TV shows, but it's a shame not being able to watch them in original version with subtitles, especially as currently I have a mix up of episodes in original audio and translated audio (but only one audio each time).

Thanks for your time.

Hi there, what do you mean by record an m2ts stream?

Link to comment
Share on other sites

Hi Luke,

I mean a feed from a M3U tuner I added in live TV section from Emby, items in m3u file are rtsp protocol URLs. I think the data feed format is m2ts, at least files recorded by emby are .ts files, as are files from the exact same feed recorded by TVheadend. The difference is the available audio streams and subtitles in the files.

Link to comment
Share on other sites

On 12/1/2020 at 10:21 AM, kalon33 said:

Hi Luke,

I mean a feed from a M3U tuner I added in live TV section from Emby, items in m3u file are rtsp protocol URLs. I think the data feed format is m2ts, at least files recorded by emby are .ts files, as are files from the exact same feed recorded by TVheadend. The difference is the available audio streams and subtitles in the files.

Ok if it's the rtsp prococol then we run it through ffmpeg and yes currently this may not preserve all tracks. it's something we can look at improving in future updates. In the meantime if you could put http urls in your m3u instead, then you might get a better result.

Link to comment
Share on other sites

  • 4 months later...
kalon33

Hi Luke,

I just saw this feature in the last two beta releases:

Quote

Include all subtitle streams with conversion and download features, when possible

 

I tried to convert a video I recorded previously, thinking that it would preserve subtitles now. Unfortunately, as you can see from the attached log, it failed. Why? Is this expected or did I triggered a bug in this new feature?

 

Thanks for your help.

ffmpeg-transcode-e31f6a85-8d5e-44ff-bde8-3f306d788c4d_1.txt

Link to comment
Share on other sites

Hi,

If you recorded it what country are you in?

For example the US doesn't use subtitles but instead uses Closed Captions which are different.

Edited by cayars
Link to comment
Share on other sites

kalon33
4 hours ago, cayars said:

Hi,

If you recorded it what country are you in?

For example the US doesn't use subtitles but instead uses Closed Captions which are different.

Hi cayars,

I recorded it in France, from a DVB-T source. Subtitles are in dvb_subtitle format as indicated in the log. Last time I performed the conversion manually using ffmpeg, I think it was working properly.

Thanks for your help.

Link to comment
Share on other sites

Would you be able to create a 5 minute version of this (tested to make sure the sub is there) to test with?
I  can provide instructions to create a 5 minute file if needed using ffmpeg.

Link to comment
Share on other sites

kalon33
23 hours ago, cayars said:

Would you be able to create a 5 minute version of this (tested to make sure the sub is there) to test with?
I  can provide instructions to create a 5 minute file if needed using ffmpeg.

I unfortunately don't have the source file from this one still available (I trusted the feature announcement and choose to replace the original file instead of keeping it), but I still have plenty of other similar files to test, that I kept as is as I couldn't convert them via emby without loosing subtitles.

Sure, I would happily help to solve this problem if you provide instructions to have what you need.

Link to comment
Share on other sites

  • 3 months later...
kalon33

Dear @cayars, I would be able to send you original file with subtitles and converted one which lost them, both truncated to 5min, along with logs. Where do you want me to post them?

I have the same problem converting mkv files (mpeg4/ac3) with dvdsub subtiles to mp4 (hevc/ac3) files to gain some space, using the convert feature from Emby.

Link to comment
Share on other sites

OK I understand now.

If the point is to show that the converted files don't have subs I think that is known.  I do not believe Emby's convert feature will keep embedded subs.
@Luke is this correct.

Link to comment
Share on other sites

kalon33

@cayars If it is known, would it be possible to fix that? It's really a problem as we loose this way part of the file's features during the process... In my situation, it prevents me from converting my whole library to hevc, gaining a lot of space, because I would like to keep subtitles along with the original language audio.

Thanks for your help.

Link to comment
Share on other sites

Being in the USA which uses closed captioning and not subtitles for Live TV I have no way to test this.

Maybe someone else can comment on this but I thought the DVR did capture the subs.

Link to comment
Share on other sites

rbjtech

Using a HD Homerun - in the UK (DVB) - subtitles are saved in the .TS file without any issues.

The fundamental issue is ffmpeg does not natively support DVB subtitles.

So while it can recognise them in the stream headers, it cannot do anything with them.  Infact it can't even copy them.

You need an external library to read them called ZVBI .. link here

https://www.ffmpeg.org/general.html#ZVBI

The library source is available, but I could not find any binaries online.

In summary - It's unlikely that emby will support DVB subs as they then become dependant on this unsupported library.

If you really need the subs - then the best option is to use something like Subtitle Edit - this DOES read DVB Subs from the TS - but you then need to use OCR to write them to a standard text based format.   You need to do this BEFORE you convert them.. ;)

OCR of DVBSUBS is very accurate, so it will run through without issues ...

dvbsub1.thumb.PNG.730f01dfe9a83ea2ed8b7f904ad6fe8d.PNG

Then just save the resulting file as a .srt (text) based file the same name as your converted file - and Emby will use (external) subtitles the same as any other media file.  If you really wanted to, you can embed the .srt back into the media container - but that's another optional step.

dvbsub2.thumb.PNG.e3289e587ed136bc06464076d947e436.PNG

 

 

 

 

Edited by rbjtech
  • Like 1
Link to comment
Share on other sites

kalon33
Posted (edited)

@rbjtech, thanks for your answer, but that also happen when converting a mkv file with dvd subtitles: subtitles are lost... but sure, that may explain the problem with DVB recordings. Maybe ZVBI could be included to be able to deal with these? DVB is widely used, especially in Europe...

Edited by kalon33
Link to comment
Share on other sites

Have you explored the subtitles preferences of the emby user who is performing the conversion?

Link to comment
Share on other sites

kalon33
On 8/14/2021 at 7:23 PM, Luke said:

Have you explored the subtitles preferences of the emby user who is performing the conversion?

Sure, but they are properly set...

Link to comment
Share on other sites

On 8/17/2021 at 5:35 AM, kalon33 said:

Sure, but they are properly set...

Hi @kalon33, properly set how exactly?

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
 Share

×
×
  • Create New...