HDMI for Channels

What's the latency on these devices? I found a variant with a HDMI out. My dad has a hearing aid that pairs with his iPhone, and I was wondering if I could use it to stream to his iPhone (either via the Channels app, or VLC, or whatever) at the same time the rest of us are watching the TV. The hearing aid company does make a TV box, which we have, but it only works with one of our TV setups.

1 Like

I don't know for a fact but I'm sure the devs are working on this or at least considering it. Maybe we will get a nice - maybe early - Christmas present. :laughing: (Wishful thinking :grin:)

Assuming that HDCP doesn't get in the way, it should be possible.
I'm not sure whether the devs will be willing to discuss this though.

This HDMI encoder method is for live TV but, technically, all the pieces are available to be able to do what you mentioned, I think. What you do in your own space and time is your business. It may be best to leave it at that. :wink:

The way I understand it, any HDMI encoder that provides a stream that is compatible with Channels (HLS, TS) should work fine.

1 Like

Thank you for this. It works well and if the channel IDs don't often change I think it provides a better experience versus waiting for the voice search to complete.

I did find that I had to specify the application with the following full command to get this to work on the onn 4k Google TV device.

adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/8xN3o2PSL5s?onboard=1 -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
2 Likes

I wonder if this could be baked into the tuning script. Tune, delay, and then enable subtitles. I realize they'd be burned in, but it would better than nothing when people really need them.

1 Like

Yeah, I’d personally have no problem with them being burned in for most programs. I turn them off for sports and news because they are delayed and that distracts me more than it helps (I have some hearing but it’s hard for me to make out dialog in part due to processing disorder and in part exposure to very loud noise over an extended period of time without ear protection).

Does anyone know if caption tracks can be toggled with ADB?

If it is a series of button presses it could be automated.

This works for me with YTT on a Nvidia shield. While the video is playing do:

adb shell "input keyevent 19; input keyevent 20; sleep 1; input keyevent 21 21 21 21 21 21; sleep 1; input keyevent 22 22; sleep 1; input keyevent 23"

It is about timing.

I run it a second time and it turns off the captions. The thing would be how to set a button or something to trigger it.

It only has a problem when you try to run it during one of those customized youtubetv commercials that sits like a layer over your video screen.

1 Like

I found you a solution of sorts. If you tune the channel from the guide once it turns on cc. If you tune it a second time it turns it off:

#/bin/bash
IPADD=192.168.1.171

#STARZ
if [ $1 = "842" ];then
sh /opt/opendct/stopbmitune0.sh
adb -s $IPADD shell "am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/-Y5vv28gO_I?onboard=1; sleep 9"
adb -s $IPADD shell " sleep 8; input keyevent 19; input keyevent 20; sleep 1; input keyevent 21 21 21 21 21 21; sleep 1; input keyevent 22 22; sleep 1; input keyevent 23"
fi

The first thing is to stop YTT if it is playing. Next it tunes the channel of choice. Finally after waiting for the channel to tune it turns on cc (or turns off if it is on).
If you go back to guide or stop and then tune the same channel it should tune and do the opposite with cc (turn it off if it is on or on if it is off).

You might have to tweak the timing based on your device. What I have here works on a NVIDIA shield.

3 Likes

That is amazing — thank you for that!

My first HDMI encoder box just arrived, I will be diving in to tinker after dinner tonight. I’m excited about this new project.

2 Likes

@tmm1 with people starting to have a play around with this I was thinking,

Would it be worth having some sort of indication (unsure the best implementation of this) on the guide if someone is already tuning a channel so that other users/clients will know and can join the same channel or avoid changing the current channel (with it being hdmi there can only be one?)

Not sure if I had it set up weird but the other day I was trying to quickly switch channels when the custom channel was set to 1 stream limit and was getting an error that all the streams were taken.

I had one encoder a while back dusted it off hooked up to my Shield fired up the HDHomeRun App tuned to HBO and can watch in Channels DVR.

#EXTM3U
#EXTINF:-1 channel-id="Testencoder" channel-number="1.2" tvc-guide-placeholders="86400",Testencoder
http://192.168.50.237:8080/0.ts

2 Likes

Next Step is to create an M3U for all channels then find a way to change the channels in the HDHR App.

Hm, I wonder if would be possible to use fHDHR as a tuner for one of these encoders and then present it as a HDHR tuner to channels.
Setup a origin within fHDHR that would essentially run the adb command to change the channel.

2 Likes

I dont remember where I backed up my adb scripts for that app when I used to feed it into sagetv. It was so clunky and atrociously designed. How do you get rid of the osd after tuning? Does it automatically disappear?

1 Like

Yes it disappears ... I just wanted to show it was the HDHR App. The m3u would have to launch a command to change the Channel.

2 Likes

I purchased and returned a “URayCoder UHE265-1L.“ It was one of the h265 models with an hdmi output. It worked well enough but the video was terribly over saturated and there was nothing I could do to correct that.

Switched it out for this “J-Tech Digital” model. It’s h264 only but has no image saturation issues. If you keep the input and output at 720p60 the cpu load drops to ~25% and the latency drops so much you can actually use the remote with the connected device without having to wait two seconds for the results of each button press to be displayed. I’m good with this. There is likely a “URayCoder” or other brand of this exact device. The software is basically the same (very bad and full of security issues lol).

I have it connected to the 4k “onn” brand Google device from Walmart ($20).

I found it better to set the device itself to go to sleep after being idle for 20 minutes instead of having it sleep immediately when the stream closes. I just have it configured to force quit the YouTube TV app before and after loading a channel via a URL to make sure it doesn’t load a channel behind the timeline where the user can’t fast forward to “live.”

I really only did this because I thought it would be an interesting project but was surprised at how effective it is. With some refinement I think this could definitely be a reasonable way to get streaming TV content into Channels DVR.

3 Likes

Got HDMI Box #1 installed last night. Pretty cool, thanks for the heads up about that eBay deal, @boukmandutty! So I factory reset it, see that it defaults to a 192.168.1.xxx address. I had to change my laptop's IP to connect directly and manually configure it for my network.

I also turned on HLS, under the "Access" menu, it was "closed" (?) by default:

The stream I'm using for this box is http://10.0.1.171:8080/hls/show.m3u8
Still learning as I go...

1 Like

I left my HLS off and used the MPEGTS stream. I think that would require less resources and complexity on the encoder, and should reduce latency.

In your screenshot I think that's listed as Main HTTP and available at http://10.0.1.171:8080/main`

2 Likes

How do you go about firing these commands/scripts? Instead of using terminal every time?

3 Likes

You would need to install golang (apt install go, brew install golang, or download from golang.org)

Then download the git repo for androidhdmi-for-channels

Run go build in that folder and it will make a androidhdmi-for-channels program you can run. That program acts as a proxy between the DVR and the ADB device, and runs the shell scripts for you when the DVR requests a specific channel or closes a stream.

4 Likes

OK, thanks for that, I changed HLS back to "closed," and then rebooted the box, and I've got it now streaming with http://10.0.1.171:8080/main instead, as my Custom Channel 99000. I also changed Stream Format, from HLS to MPEG-TS, to match.

Now to figure out the Mac server side of things, and adb commands to tune into NBCU channels via YTTV. I'll hopefully get to that in a few days.