AndroidHDMI for Channels (ah4c): A virtual channel tuner using HDMI Encoder(s) + streaming stick(s)

A few clarifications on this:

There wouldn't actually be two STREAMER_APP values -- more like one semi-universal one.

So, you could do something like scripts/onn/all, and then in your all.m3u you could pass the name of the app to open, along with the channel identifier. Something like:

#EXTM3U

#EXTINF:-1 channel-id="8" tvc-guide-stationid="25102",USA Network
http://{{ .IPADDRESS }}/play/tuner/nbc~usa

Where the last part of the URL nbc~usa would be parsed in each script to open the nbc app, and then tune to usa network. Details would be different, but that would be the idea.

Does this not work on browser

They're not going to work on a regular browser. The deep links are an android thing and requires the app to be installed and you to use the Android Debug Bridge (adb)

ok

How do you export Gracenote data into usable xml data?

Does directv-free-stream have gracenote?

Peacock has guide data has been added if you guys want to make a strategy for recording it

New bnhf/ah4c:latest (aka bnhf/ah4c:2024.10.30) pushed this morning with support for resending deeplinks after x hours or minutes to prevent "Are you still watching?" (or similar) prompts.

This has been implemented in the dtvdeeplinks and xfinity scripts. Use of the most recent Docker Compose (dated 2024.10.30) is required, along with setting the KEEP_WATCHING environment variable. 4h for 4 hours is a good starting point.

This works for recordings, or watching live, and results in only a very brief interruption as the station is retuned. Well worth it for long recordings such as golf or tennis tournaments, which would otherwise be ruined after x hours. Also great when watching back-to-back movies on premium movie channels live.

If you don't wish to use this feature, simply leave the KEEP_WATCHING variable unset.

2 Likes

If I'm using an Android TV with TV Tunner in it (for example a tv box or smart tv) is there any method to stream the current tv channel?

1 Like

I recently received my latest encoder purchase from eBay, a TBS2603SE. This is a 4-year-old or so box that does 1080p/60 with both h.265 and 264. The interesting thing is that when you go into system details it says the model is ENC1H, so I wonder if it's a rebadged original Linkpi box.

The gist of it is that I got a really good deal on a new box and it works perfectly, no A/V sync or black level issues (which I've had before, I've returned two other encoders before this one - a Linkpi ENC1-V3 and an iSeevy). So if you see one of these for sale for less than $100 it's probably worth it.

I know I had said I was going to switch to using the deep links method for my DirecTV Stream months ago, but vacations and life in general got in the way. However, I'd started to see some issues with the "legacy" method where after searching for a channel it displayed another screen before tuning the channel (I think with a programs vs. on now tabbed view as I remember) and recordings were missed.

So I just whipped up a very janky PHP script that took my DirecTV Stream all channels JSON file and converted it to the deep links m3u format and switched over to that for all 255 channels that I supposedly have. Some quick manual tests show this is working great - much faster and hopefully more reliable than the old method. I'll see how my scheduled recordings go over the next few days.

Thanks yet again @bnhf for this project and your help with getting this all working!

2 Likes

Recently it seems like about 50% of my recordings don't record because it doesn't change the channel from the home screen. I am not sure what to do. Have lost 3 recordings of Yellowstone recently as well as some Wrestling shows. I am unsure as to what to do to ensure that it changes the channel and not sit at the home page. (home screen

Are you using deeplinks?

No, I am using Osprey's and using the directtv M3U

Hopefully @spammedeeper or @kprice will see this, as I didn't write the osprey/dtvstream scripts.

They're not too complicated as I recall though. Do you have any sense of where they're failing?

1 Like

I think they are just trying to change channels too soon.

@krazijoe Two things:

  1. On Osprey make sure your resume/wake action goes to last channel, not Home Screen.

Settings > Preferences > Turn off “start at home”

  1. I did have a similar issue with premature tuning when box was not fully awake or there was small network latency. This became worse after recent updates, but not regular enough for me to commit changes to project. Your network is just different. Try the following change in the prebmitine.sh script.
  • Find section for adbwake (near bottom)
  • First line has the key code wake-up then a pause of sleep. Change sleep from 2 to 4. Should look something like this:

$adbTarget shell input keyevent KEYCODE_WAKEUP; sleep 4;

  • Increase that sleep number as much as you need to provide reliable tuning in your Environment.

Please note the wake-up time from deep sleep is slower, when Osprey has powered down for more than 4 hours. You will just need to play to tune best for your use case.

Excuse any Typos. Added this post via phone.

3 Likes

I got an ADTH tuner box, which I'm hoping to use as an android endpoint. Any way i can find out the deep links for the tuner itself?

thinking it's "com.tolka.airialtv_atsc_launcher" but I'm admittedly a little over my head on this one

Question. How would I delay sending video feed to channels for five or so seconds after my script issues the following command?

adb -s $TUNERIP shell "am start -a android.intent.action.VIEW -d  https://watch.sling.com/1/channel/"$content_id"/watch"

There's no easy way that I'm aware of -- however it may be possible...

There's support for a "T" process, using env var CMDx, where x corresponds to ENCODERx_URL. The value would typically be an ffmpeg command, and whatever is output from ENCODERx_URL would be the input, and stdout is sent to CDVR (using a "-" at the end of the ffmpeg command).

So, if you can craft an ffmpeg command that would delay output for 5 seconds, followed by passing the stream through -- that could work. Hopefully this could be done with minimal impact on the ah4c proxy. This is untested by me, but @KompilerDJ used this approach for taking input from various capture cards, and sending it to CDVR after some ffmpeg encoding.

You can look at a couple of examples of ffmpeg commands on the sullrich/ah4c GitHub repo. I believe he used this approach for Magewell and Hauppauge capture cards. Look for the .env files with those card names.

Figured it out. It required using the command section of the env file to direct the tuning process to a simple script.

I am using a uray network encoder and the goal was to have the video feed from slingtv or YouTube tv start when the program I am trying to tune starts instead of showing the home screen of the app and the launching process.

env looks like this:

CHANNELSIP="192.168.1.199"
IPADDRESS="192.168.1.199"
STREAMER_APP="scripts/onn/slingtv"
#STREAMER_APP="scripts/shieldtv/youtubetv"
NUMBER_TUNERS="3"
ALERT_SMTP_SERVER="smtp.gmail.com:587"
ALERT_AUTH_SERVER="smtp.gmail.com"
ALERT_EMAIL_FROM=""
ALERT_EMAIL_PASS=""
ALERT_EMAIL_TO=""
ALERT_WEBHOOK_URL=""
ALLOW_DEBUG_VIDEO_PREVIEW="FALSE"


CMD1="scripts/onn/test/tuner1.sh"
ENCODER1_URL="http://192.168.1.168/8.ts"
TUNER1_IP="192.168.1.133:5555"

tuner1.sh is a simple script to delay for a couple of seconds and then tune:

#!/bin/bash
sleep 6
ffmpeg  -i $ENCODER1_URL -f mpegts -codec\:v copy -codec\:a copy -

1 Like