Extract (and convert) subtitles of tvheadend's recordings
Added by Renato Riolino over 8 years ago
Hi people,
I have and issue that in some channels, the subtitles gets wrongly positioned on the screen (using Kodi as frontend). So when the subtitle has 2 lines, I can read only the first line and the second stay off the screen.
I tried already with different kodis version and the behave is the same.
Because of that I was thinking if it is possible to extract and convert the subtitles to str or other format more compatible with Kodi?
I known that the subtitle format is a kind of bitmap and I would need to use some OCR to tool for the task. That's ok for me.
The problem is that I can't extract the subtitles (and convert them) to a format suitable to converting to STR.
For example, mkvextract complains that CodecID 'S_DVBSUB' is not supported.
Anyone has any idea? Thanks
Replies (9)
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Poul Kalff over 8 years ago
That would depend on what format you record to.... I don't think that MKV records the subtitle. Are we even talking about recordings, or streaming channels? MKVextract wouldn't work on streams, since they are obviously not mkv....
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Renato Riolino over 8 years ago
I have this subtitle problem both with streaming and recording. I was thinking of trying to convert the subtitle as a way to "solve" this problem at least with recordings.
My record profile is mastrosk (built-in) and it stores the subtitle on the file as a track. The codec ID for the subtitle is S_DVBSUB that is not supported by mkvextract.
Thanks
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Stephen Neal over 8 years ago
DVB subtitles can be quite tricky to extract. I have done it in the past with a .ts recording and ProjectX exporting them as bitmaps that can then be imported into SubRip or similar to be OCRed - which will then give you a .srt or similar file. However this will lose formatting (screen location etc.) and colour (which in the UK is used to designate who is speaking)
This was a couple of years ago though - so there may be better solutions.
I would advise against using MKV for TV Headend recordings though - there are other limitations which can bite you, particularly if you record stations with 2.0/5.1 switched sound - as the MKV wrapper doesn't seem to like audio streams that change format. (So you can end up with 5.1 shows being played back in 2.0 without any dialogue...)
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Renato Riolino over 8 years ago
Almost all stations that I record have dual audio (usually 5.1 original audio and 2.0 dubbed). But it seems ok with the audio channel in MKV, each channel goes to a different track and I can switch between them while watching it on Kodi.
Thats exactly what I do when the subtitle of that particular channel is wrong: I disable subtitles and change the audio to 2.0/dubbed. But I would prefer to have original 5.1 with subtitles.
Thanks
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Wild Penguin over 8 years ago
MKV does support DVB subtitles (at least it works fine here for me). FWIW, I've never had problems with multiple audio tracks either - they are embedded as they should and are switchable (though I'm not sure any stations I've recorded broadcast 5.1 audio tracks, but I don't see why that should make a difference). MKV may have other problems, though. I'd try using .ts and see if that works better for you.
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Stephen Neal over 8 years ago
Just to clarify the issue I've observed with mkv wrapped recordings and audio channels. (Off topic)
In the UK the BBC switch their Dolby Digital (satellite) and AAC (terrestrial) audio streams between 2.0 at one bitrate, and 5.1 at a higher bitrate, dynamically on a show-by-show basis.
If you have some padding - as I do - your recording of a 5.1 show often starts with a minute or two of the previous show with 2.0 audio. MKV players often only read the audio settings at the beginning of playback, so configure themselves for 2.0 and then ignore the fact that the stream has switched, and stick with a 2.0 map (with just the Front L and Front R audio played, not a 5.1 to 2.0 fold-down) so you lose the centre channel (which often has dialogue in it)
.ts players appear to cope better with this.
I certainly have had the issue with 5.1 shows recorded this way played back in Kodi. (For UK viewers - Strictly Come Dancing and Doctor Who are both 5.1 shows - as are the current Euro 2016 championships on the BBC. ITV are no doubt still 2.0...)
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Hiro Protagonist over 8 years ago
Renato Riolino wrote:
I have and issue that in some channels, the subtitles gets wrongly positioned on the screen (using Kodi as frontend). So when the subtitle has 2 lines, I can read only the first line and the second stay off the screen.
The subtitle position is configurable in Kodi - could you not move it up to allow room for the 2nd line?
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Renato Riolino over 8 years ago
Hiro Protagonist wrote:
The subtitle position is configurable in Kodi - could you not move it up to allow room for the 2nd line?
Tried that, but this settings only works for "text" subtitles. For the DVB subtitle embbeded on the mkv it has no effect
Thanks
RE: Extract (and convert) subtitles of tvheadend's recordings - Added by Renato Riolino over 8 years ago
Yesterday while watching another channel with the same subtitle problem, I started to think that the problem is not exactly the "position".
I saw one subtitle (one line only) that was a little cropped on top. I don't know how this DVB subtitles are stored, but I think they might be just a "strip" with all subtitles as a single bitmap and then the player crops that bitmap on a determined position and size to show on the screen.
I think that maybe the problem is that the "strip" is been cropped on the wrong position. But I don't know if it is kodis, tvh or my sat faults.
Tonight I will install VLC on my PC and I will try to play the same mkv on it and then I'll post the results here.
Thanks