Project

General

Profile

Tvheadend transcoding with mutiple subtitle streams

Added by Choon Chien Tew about 4 years ago

Hi all,
I am currently trying to create stream profile to transcoding channels for kodi on my tvbox.
The default "matroska" or "pass" streaming profile although works(by using Kodi Tvheadend pvr addon), but I cannot watch live tv/recordings in Kodi's mediacodec hw accelerated mode, unless I turns them off.
This is very annoying as I have to constantly turning on/off to watch live tv/recording and anythings else, this is the main reason I am creating the stream profile.
Well, not only annoying, without the hw accelerated mode, the cpu usage will be very high, had to turn off deinterlacing, to prevent the channel stutter.
Although I did create the profile, with "Subtitle codec profile" set to "Copy", I can manage get only 1 subtitle, while the channels originally have more than 1 subtitle stream. Is this the limitation of Tvheadend, or are there any workarounds to fix this?
Attached images to more clearly explain my problem:

Sample Channel to show that it has mutiple subtitle streams
Sample Channel to show it has mutiple subtitle streams

playing the same sample channel using the profile I created, but only 1 subtitle
playing the same sample channel using the profile I created, but only 1 subtitle

The stream profile I created, as you can see "Subtitle codec profile" set to "Copy"
The stream I created, as you can see Subtitle codec profile set to Copy

1/2):default digital recording profile that I changed. The page is too long,so split it to 2 screenshots
(1/2):default digital recording profile that I changed. The page is too long,so split it to 2 screenshots

(2/2)
(2/2)

My Tvheadend Server System Info:
Operating System: Manjaro Linux
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.7.15-1-MANJARO
OS Type: 64-bit
Processors: 6 × Intel® Core™ i5-8400 CPU @ 2.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: AMD PITCAIRN

2020-08-27-145104_943x852_scrot.png (232 KB) 2020-08-27-145104_943x852_scrot.png Sample Channel to show it has mutiple subtitle streams
2020-08-27-145405_1620x1495_scrot.png (269 KB) 2020-08-27-145405_1620x1495_scrot.png The stream I created, as you can see "Subtitle codec profile" set to "Copy"
2020-08-27-145632_1620x1805_scrot.png (352 KB) 2020-08-27-145632_1620x1805_scrot.png (1/2):default digital recording profile that I changed. The page is too long,so split it to 2 screenshots
2020-08-27-145648_1620x1805_scrot.png (342 KB) 2020-08-27-145648_1620x1805_scrot.png (2/2)
2020-08-27-154121_2260x1345_scrot.png (371 KB) 2020-08-27-154121_2260x1345_scrot.png playing the same sample channel using the profile I created, but only 1 subtitle

Replies (18)

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

there is a stream filters where you can prefer or remove audio/subtitle streams

There is a VAAPI transcoding with GPU
also other transcoding profiles

profile you use is for web browser's

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

saen acro wrote:

there is a stream filters where you can prefer or remove audio/subtitle streams

Sorry, I currently don't have any stream filters setup, but still only got just1 subtitle(which is not what I wanted). Is this the default behavior? Does this mean at the beginning I have to setup some filters to get back the original subtitle streams? Sorry to bother you with these questions, I had tried using subtitle stream filters to make this work but failed. Maybe could you or anyone can provide me with success example to follow and try on?

There is a VAAPI transcoding with GPU
also other transcoding profiles

profile you use is for web browser's

The profile you saw in my picture, is created from "Transcode/av-lib"(provided picture below for reference), as all other selections don't have options to let me setup custom video/audio/subtitle code profile for my kodi mediacodec hw acceleration to work. Do you mean this profile is for web browser only. If this is the case, is there any other options I can try? As for "VAAPI transcoding with GPU", will try also in the future, thanks.
!2020-08-27 19-03-57.png!

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

I took the advice and try out the other stream profile, and below are the summary of my testing, as you can see, the "only 1 subtitle" problem still exists. Is this the limitation of Tvheadend transcoding function, or are there any workarounds to fix this?

1. Kodi TVheadend HTSP PVR Client only accept these profile: empty, htsp, "Transcode/av-lib"; other than these it will just report "The streaming profile is not available".
Streaming profile setting in Kodi TVheadend HTSP PVR Client

2. I think empty and htsp profile is the same, as default profile the pvr client used is htsp.

3. "Transcode/av-lib" means the custom profile(what ever name you gave it) created from "Transcode/av-lib"; I also found out that this is the only profile that I can try out "VAAPI transcoding with GPU" codec profile.
Stream profile in TVheadend Configuration/Stream/Stream Profiles

4. Although htsp profile works, but it has these problems when viewing live tv /recordings on my tvbox kodi:
4.1. I cannot watch live tv/recordings in Kodi's mediacodec hw accelerated mode, unless I turns them off.
4.2. This is very annoying as I have to constantly turning on/off "Kodi's mediacodec hw accelerated mode" to watch live tv/recording and anythings else.
4.3. Besides annoying, without the hw accelerated mode, the cpu usage will be very high, had to turn off deinterlacing, to prevent the channel from stuttering.

5. Although "Transcode/av-lib" also works, but it has the problem that i am trying to solve now:
5.1. which is when viewing live tv /recordings on my tvbox kodi(via Kodi TVheadend HTSP PVR Client with the "Transcode/av-lib" streaming profile), the channel has only 1 subtitle, but the channel originally has more than 1 subtitles.
5.2. No matter what codec profile(including "VAAPI transcoding with GPU") I used in this streaming profile, the "only 1 subtitle" problem still exists.
5.3. I tried setting up Subtitle Stream Filters, the "only 1 subtitle" problem still exists.

Sample Channel to show it has mutiple subtitle streams
Custom Stream created from Transcode/av-lib
Tvheadend Subtitle Stream Filters
Only 1 subtitle in Kodi

2020-08-28-133901_2737x270_scrot.png (25.7 KB) 2020-08-28-133901_2737x270_scrot.png Streaming profile setting in Kodi TVheadend HTSP PVR Client
2020-08-28-135138_634x360_scrot.png (39.2 KB) 2020-08-28-135138_634x360_scrot.png Stream profile in TVheadend Configuration/Stream/Stream Profiles
2020-08-27-145104_943x852_scrot.png (232 KB) 2020-08-27-145104_943x852_scrot.png Sample Channel to show it has mutiple subtitle streams
2020-08-28-141805_1624x1195_scrot.png (161 KB) 2020-08-28-141805_1624x1195_scrot.png Only 1 subtitle in Kodi
2020-08-28-143503_1180x1195_scrot.png (243 KB) 2020-08-28-143503_1180x1195_scrot.png Custom Stream created from "Transcode/av-lib"
2020-08-28-144639_1470x665_scrot.png (184 KB) 2020-08-28-144639_1470x665_scrot.png Tvheadend Subtitle Stream Filters

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

Hi,
Does anyone has result different from mine?
If so, please kindly let me know how you do it?
If not, I think this maybe really is the limitation of the Tvheadend transcoding function(at lease via "Transcode/av-lib"),
which it has problem handling multiple subtitle streams (only got back 1 subtitle stream), because:
  • Whatever subtitle stream filters I tried, I still only got 1 subtitle stream back;
  • When I change the order of the filters, I just got back different subtitle but not all of them;
  • I did not setup any audio stream filters, but I still got all the audio stream, which is not the case with subtitle treams;
  • When using the default (htsp, matroska, pass) streaming profiles, I got all the subtitle streams, which is not the case with "Transcode/av-lib" profile(even with the "subtitle codec profile" option set to "Copy").

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

Use PIPE profile and use FFMPEG then do what you need.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

Hi,
By "PIPE profile", Do you mean the "MPEG-TS Spawn/built-in" streaming profile? If so, Kodi cannot use this profile, it will report the streaming profile not available, so doesn't look like a solution for my situation.
By my testings, Kodi seems to only support these profiles: htsp, "Transcode/av-lib". As I said before, on my tvbox, Kodi hw acceleration mode is not usable when using htsp profile; and Kodi (maybe not only Kodi, if I view tv recordings recorded with "Transcode/av-lib" profille, using other video player like vlc, mpv, the same "1 subtitle" problem also exists) has "1 subtitle" problem when using "Transcode/av-lib" profile.
Looks like if I want to use Kodi with Tvheadend backend on my tvbox, there are currently no solution for my "only 1 subtitle" problem (at least maybe with the current limitation of Transcode/av-lib" profile)?
I have googled for sometimes now with my problem, still haven't found any solution yet. If anyone have a working solution for situation similar to mine, please kindly let me know.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

Pass profile stream all as is,
no one watch same stream with all subtitles in same time.
remove unneeded and stream one you use.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

Thanks for the reply. But with the current situation, I will not be able to choose subtitle for different show. Because although the channels have more than 1 subtitle streams, but not all of them will be present in the stream. For example, on channel X although always have a total of 4 subtitle streams, show A maybe only have chinese and english subtitle present, but tamil and malay subtitle stream are blank; Another show B maybe have malay and english subtile present, but chinese and tamil are blank. I think you can get the idea.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

With one you need from 4 possible?

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

Choon Chien Tew wrote:

Thanks for the reply. But with the current situation, I will not be able to choose subtitle for different show. Because although the channels have more than 1 subtitle streams, but not all of them will be present in the stream. For example, on channel X although always have a total of 4 subtitle streams, show A maybe only have chinese and english subtitle present, but tamil and malay subtitle stream are blank; Another show B maybe have malay and english subtile present, but chinese and tamil are blank; Another show C maybe only have chinese subtitle and others are blank. I think you can get the idea.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

I will get the idea when you tell me witch language for audio and subtitles you need.
Until now complete mess with your explanation.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

saen acro wrote:

With one you need from 4 possible?

The main problem here is there seems to be no default non blank subtitle stream for the channels. So with the current situation, I might get a blank subtitle stream for some show.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

With language is most important for you?

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

saen acro wrote:

I will get the idea when you tell me witch language for audio and subtitles you need.
Until now complete mess with your explanation.

Ok, Consider this situation, I have several channels each with multiple subtitle streams in it; For the sake to simplify explaination, lets assume that channel "X" has a total of 4 subtitle streams at all times, sometimes some of them will be blank, because:
1. Lets say Show "A" is currently playing, it only has english and chinese subtitles available, but the other 2 are blank(which is the tamil and malay subtitles),
2. Then for another time and another show "B", it only has english and malay subtitles available, but the other 2 are blank(which is the chinese and tamil subtitles),
3. Again, another time and another show "C", it only has malay subtitle available, but the other 3 are blank(which is the chinese ,english and tamil subtitles),
4. Again, another time and another show "D", it only has chinese subtitle available, but the other 3 are blank(which is the malay ,english and tamil subtitles),
...

With all these different shows with different situations. and they don't seems to have a default non blank subtitle stream, I might get a blank subtitle stream for some show when I can only get 1 subtitle (because of the streaming profile). So I really can't make sure which one to choose. Hope my explaination is clear this time.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

saen acro wrote:

With language is most important for you?

Well, maybe Chinese subtitle, although It will not always be available.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by saen acro about 4 years ago

Choon Chien Tew wrote:

saen acro wrote:

With language is most important for you?

Well, maybe Chinese subtitle, although It will not always be available.

If not Chinese subtitle then maby in same moment Chinese audio is used

Go in Stream filters and set Chinese subtitle as USE other to remove

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Choon Chien Tew about 4 years ago

Ok, thanks, will try that soon.
I do hope that the "1 subtitle only" limitation for the "Transcode/av-lib" stream profile get resolved soon in the future, as this will make the transcoding function more complete in my opinion.

RE: Tvheadend transcoding with mutiple subtitle streams - Added by Flole Systems about 4 years ago

Go ahead and start improving it, otherwise it won't get resolved.

    (1-18/18)