Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Subtitle Support #203

Open
breezytm opened this issue Jul 14, 2017 · 20 comments
Open

Question - Subtitle Support #203

breezytm opened this issue Jul 14, 2017 · 20 comments

Comments

@breezytm
Copy link

Does this app currently support subtitles? I can switch audio but my subtitles option is always "off". I am currently using it the app with IPTV (HDHR Prime configured as m3u playlist) and HTSP streaming profile.

@kiall
Copy link
Owner

kiall commented Jul 14, 2017

Yes, if the media contains subtitles, they should show up.

However, we only support a few subtitle formats, DVB subtitles and what TVHesdend calls TEXTSUB. It's possible were missing something used by IPTV streams (or it's possible TVH isn't passing it through). Do you have any details on the subtitle format used?

@breezytm
Copy link
Author

breezytm commented Jul 14, 2017

I think you made a great point. I just realized when I connect Android Live Channels to my HDHR I get some extra informations from the Live Channels app. Information such as aspect ratio (16:9), subtitle (CC), video quality (FULL HD), audio quality (5.1) but when I tune to the same channel from THV Live Channels app, I only get video quality (FULL HD), audio quality (5.1).

I tried using the Kodi PVR addon and I also didn't get subtitle. Only video and audio. As you suggested, TVHeadend either not passing it through or IPTV stream doesn't seem to carry that information.

I need to figure out how to use the builtin passthrough profile (pass) as i haven't had much luck getting any tvh clients to work with it. I need to know which codecs are in the container.

@breezytm
Copy link
Author

breezytm commented Jul 14, 2017

Okay. So I just did an easy test in vlc and I had subtitles using http://:5004/auto/v502
But in my IPTV playlist i am using the hdhomerun_config with pipe:///usr/bin/hdhr_stream.sh/<tuner #> <channel #> which technically speaking should return the same exact stream. I don't believe there is an issue there.

So it's either the protocol (HTSP) is not passing the subtitle or perhaps you guys are not asking for it. See picture below

screen shot 2017-07-14 at 5 22 23 pm

@breezytm
Copy link
Author

By any chance can you please take a look at the code and see if you guys are pulling every data being sent. Thanks.

@kiall
Copy link
Owner

kiall commented Jul 14, 2017

Could you grab some logs from your device as you change onto a channel you know has subtitles? Buried in the log will be a listing of each of the streams TVHeadend is sending us, and which ones we're ignoring because we don't understand them. Also.. what version of the app are you using? And what TVH version?

https://github.com/kiall/android-tvheadend/wiki/ADB has some pointers on this.

@breezytm
Copy link
Author

Server: HTS Tvheadend 4.3-210~g7644886-dirty
Client: Version v0.4.1 (Build: 13)

I will send log shortly.

@breezytm
Copy link
Author

breezytm commented Jul 14, 2017

Log file attached. Let me know if you need anything else
logcat.txt

@breezytm
Copy link
Author

Okay so I see what's going on. There is a difference between sub and closed captions. I had to do some reading and I am guessing the app does not support closed caption?

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

The relevant parts of the logs are here, the first 5 lines being what we get from TVH, and the last 20 or so are what the video player component is seeing and handling:

07-14 18:34:51.871  3323 27988 I ie.macinnes.tvheadend.player.HtspExtractor: Handling Subscription Start
07-14 18:34:51.871  3323 27988 D ie.macinnes.tvheadend.player.HtspExtractor: Creating StreamReader for MPEG2VIDEO stream at index 1
07-14 18:34:51.871  3323 27988 D ie.macinnes.tvheadend.player.HtspExtractor: Creating StreamReader for AC3 stream at index 2
07-14 18:34:51.871  3323 27988 D ie.macinnes.tvheadend.player.HtspExtractor: Creating StreamReader for AC3 stream at index 3
07-14 18:34:51.871  3323 27988 D ie.macinnes.tvheadend.player.HtspExtractor: All streams have now been handled
07-14 18:34:51.871  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: sourceInfo [periodCount=1, windowCount=1
07-14 18:34:51.871  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   period [?]
07-14 18:34:51.871  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   window [?, false, false]
07-14 18:34:51.871  3323 27981 D ie.macinnes.tvheadend.player.TvheadendTrackSelector: TrackSelector selectVideoTrack
07-14 18:34:51.871  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: ]
07-14 18:34:51.871  3323 27981 D ie.macinnes.tvheadend.player.TvheadendTrackSelector: TrackSelector selectAudioTrack
07-14 18:34:51.871  3323 27981 D ie.macinnes.tvheadend.player.TvheadendTrackSelector: TrackSelector selectAudioTrack
07-14 18:34:51.871  3323 27981 D ie.macinnes.tvheadend.player.TvheadendTrackSelector: TrackSelector selectTextTrack
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.ExoPlayerUtils: Processing track: 1920x1080, id:1
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.ExoPlayerUtils: Processing track: eng, 6ch, 48000Hz, id:2
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.ExoPlayerUtils: Processing track: spa, 1ch, 48000Hz, id:3
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.tvinput.LiveSession: Session : 3 (9)
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: Tracks [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   Renderer:0 [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     Group:0, adaptive_supported=N/A [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:       [X] Track:0, id=1, mimeType=video/mpeg2, containerMimeType=null, res=1920x1080, fps=29.970629, supported=YES
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   Renderer:1 [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     Group:0, adaptive_supported=N/A [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:       [X] Track:0, id=2, mimeType=audio/ac3, containerMimeType=null, channels=6, sample_rate=48000, language=eng, supported=YES
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     Group:1, adaptive_supported=N/A [
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:       [ ] Track:0, id=3, mimeType=audio/ac3, containerMimeType=null, channels=1, sample_rate=48000, language=spa, supported=YES
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:     ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger:   ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: ]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: videoEnabled [1.87]
07-14 18:34:51.872  3323  3323 D ie.macinnes.tvheadend.player.EventLogger: audioEnabled [1.87]

Which basically says we received 1 MPEG2 video stream, and 2 AC3 audio tracks, all of which have been handled, and that no subtitle streams were found.

I actually don't have any video sources that include captions embedded within the video track, so it's entirely possible I've not correctly implemented support for them!

I'll see if I can find one.. Could you also try and create a muxdump and share it with me? That way I can look at the actual video stream you're having issues with. https://github.com/kiall/android-tvheadend/wiki/Muxdump

Try to make sure you get a piece of video that actually includes captions! Often, adbreaks don't :)

@breezytm
Copy link
Author

breezytm commented Jul 15, 2017

The file is attached. Channel is WCBS

https://ufile.io/23b50

VLC seems to know exactly what's in the stream even though when looking at TVH server it doesn't seem to know
screen shot 2017-07-15 at 12 32 23 pm
screen shot 2017-07-15 at 12 35 28 pm

I certainly hope you can get CC working.

Do you know which field is pulling the Aspect Ratio 16:9. Live Channels from Android TV seems to get that information as well. Unless it determines that on it's own base of the video resolution.

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

From memory, the aspect ratio is determined based on the video resolution, and it video's pixel aspect ratio.

Re the sample - thanks, I can see this defiantly have some closed captions embedded:

1
00:00:02,470 --> 00:00:05,504
TOUGH YEAR HERSELF.             

2
00:00:05,573 --> 00:00:07,573
DEBBIE: LAST YEAR MY            
PARENTS PASSED AWAY WITHIN      

3
00:00:07,641 --> 00:00:08,907
A YEAR OF EACH OTHER.           

4
00:00:08,976 --> 00:00:11,944
THEN I BECAME A CAREGIVER       
FOR MY 14 YEAR-OLD LAB.         

5
00:00:12,013 --> 00:00:16,081
I'M VERY ATTACHED TO JACK.      

6
00:00:16,150 --> 00:00:18,384
NARRATOR: AND JACK ISN'T        
ONLY A BELOVED FAMILY           

7
00:00:18,452 --> 00:00:20,686
MEMBER, HE'S ALSO THE           
OFFICIAL AMBASSADOR OF          

8
00:00:20,755 --> 00:00:21,954
DEBBIE'S B&B.                   

9
00:00:22,023 --> 00:00:25,657
DEBBIE: HE GREETS               
EVERYONE, HE SNUGGLES WITH      

10
00:00:25,726 --> 00:00:29,927
EVERYONE, BUT HE'S GETTING      
OLDER AND I'D LIKE TO GET    

I'll see if I can find why we're not picking them up

@breezytm
Copy link
Author

breezytm commented Jul 15, 2017

Great. Thanks for spending your weekend looking into this. If you need anything else, please, don't hesitate to ask. Besides your wiki how-to guides are on point.

@breezytm
Copy link
Author

And oh, If that is the case I don't get why the Aspect Ration with TVH Live Channels doesn't show. In the log it clearly states that it knows the resolution. Not a big deal as it doesn't break or prevent me from watching live tv. So far this app has been the most solid app I have used on Android TV for Live TV. But if you like I can create a new issue to track it. Let me know. The closed captions is more serious for me as I have some household member visiting from another country who doesn't fully understand english.

07-14 18:34:51.872 3323 3323 D ie.macinnes.tvheadend.player.ExoPlayerUtils: Processing track: 1920x1080, id:1

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

Yea, please do file an issue :) Include any detail you can (e.g. those logs and sample etc), I'll never remember to come looking over here again for them ;)

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

So, it looks like ExoPlayer doesn't currently support CEA 607/708 inside MPEG2 aka H262 (Which is what I assume is in your sample, I haven't double checked that yet).

google/ExoPlayer#2565

@breezytm
Copy link
Author

Is Android TV Live Channels using a different player than the one you are using with this app? Or is the limitation on the stream encoder (mpeg2/h262) that is being passed to TVHeadend Lives Channels by TVHeadend server the problem?

My confusion here is, if the stream is the same exact stream whether its from Android Live Channel HDHomerun Beta Tuner or TVHeadend Live Channels, it is still the stream with the same container and the same codecs. I am just a little confused. That's all.

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

Each Live Channels plugin app provides their own video player, so this one vs the HDHomerun Beta Tuner will be different players. They'll both (eventually) hand off the separated video/audio/etc streams to your devices hardware decoders.. But a lot happens in the middle :)

We make use of Google's ExoPlayer project, HDHomerun Beta Tuner probably uses something else which doesn't have a bug re detecting EIA/CEA-607/608 captions within H262 (aka MPEG2 video) streams.

As near as I can tell, what TVHeadend is providing us does have the correct subtitles embedded within it, the problem is, we're (well - ExoPlayer, which we use) is not picking up on them.

Hopefully that ExoPlayer bug will be resolved soon, and then they should start working in this app.

@breezytm
Copy link
Author

Ha. That makes sense now. Perhaps VLC would have been a better player since it plays pretty much everything and anything. Ever a stream from the gods is playable by VLC :)

Again, thanks for looking into this.

@kiall
Copy link
Owner

kiall commented Jul 15, 2017

We used to support VLC :) But, tying it into TVHeadend properly wad hard (e.g. DVR and timeshift was simply impossible without using TVH's custom protocol :()... and it resulted in all video decoding happening in software, rather than on the dedicated decoder hardware.. Which meant stuttering on lower power devices, or high bitrate channels (e.g. 4k).

@breezytm
Copy link
Author

I see what you mean. In that case, great decision to move away from it. My playback with this app is butter. Specially after I enabled timeshift on the server end with 60 minutes buffer, ffmpeg on the client as well as passthrough. Right now I have no issues. CC would have been great but since it is not possible right now I won't cry wolf over it. I'll just let my guests know it's time to pack up their stuff and go back where they came from. Hopefully there she won't need any closed captions :D Clearly I don't share their troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants