I've been working on a FireTV LiveTV version of the ah4c project (androidhdmi-for-channels) that will allow those with HDMI encoders and FireTV devices to capture basically anything you can get to appear in the FireTV's LiveTV guide.
Since there's no real search function for "LiveTV" on these devices, we're basically stepping through the device's LiveTV guide for a channel match -- which means you want limit the number of channels in the LiveTV guide to maybe 60 or so maximum (it'll search top down or bottom up based on whichever is quicker).
There are some steps to prepare your FireTV device, but here's the docker-compose (recommended for use with Portainer-Stacks) to give you an idea how this is going to function:
version: '3.9'
services:
ah4c:
image: bnhf/ah4c:prime
container_name: ah4c2
hostname: ah4c2
dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
ports:
#- 5037:5037 # Port used by adb-server
- 7664:7654 # Port used by this androidhdmi-for-channels proxy
- 7665:8000 # Port used by ws-scrcpy
environment:
- IPADDRESS=${IPADDRESS} # Hostname or IP address of this androidhdmi-for-channels extension to be used in M3U file (also add port number if not in M3U)
- NUMBER_TUNERS=${NUMBER_TUNERS} # Number of tuners you'd like defined 1, 2, 3 or 4 supported
- TUNER1_IP=${TUNER1_IP} # Streaming device #1 with adb port in the form hostname:port or ip:port
- TUNER2_IP=${TUNER2_IP} # Streaming device #2 with adb port in the form hostname:port or ip:port
- TUNER3_IP=${TUNER3_IP} # Streaming device #3 with adb port in the form hostname:port or ip:port
- TUNER4_IP=${TUNER4_IP} # Streaming device #4 with adb port in the form hostname:port or ip:port
- ENCODER1_URL=${ENCODER1_URL} # Full URL for tuner #1 in the form http://hostname/stream or http://ip/stream
- ENCODER2_URL=${ENCODER2_URL} # Full URL for tuner #2 in the form http://hostname/stream or http://ip/stream
- ENCODER3_URL=${ENCODER3_URL} # Full URL for tuner #3 in the form http://hostname/stream or http://ip/stream
- ENCODER4_URL=${ENCODER4_URL} # Full URL for tuner #4 in the form http://hostname/stream or http://ip/stream
- STREAMER_APP=${STREAMER_APP} # Streaming device name and streaming app you're using in the form scripts/streamer/app (use lowercase with slashes between as shown)
- CHANNELSIP=${CHANNELSIP} # Hostname or IP address of the Channels DVR server itself
#- 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=""
- LIVETV_ATTEMPTS=${LIVETV_ATTEMPTS} # For FireTV Live Guide tuning only, set maximum number of attempts at finding the desired channel
- CREATE_M3US=${CREATE_M3US} # Set to true to create device-specific M3Us for use with Amazon FireTV LiveTV channels -- requires a FireTV device
- TZ=${TZ} # Your local timezone in Linux "tz" format
volumes:
- /data/ah4c/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
- /data/ah4c/m3u:/opt/m3u # m3u files will be stored here and hosted at http://<hostname or ip>:7654/m3u for use in Channels DVR - Custom Channels settings
- /data/ah4c/adb:/root/.android # Persistent data directory for adb keys
restart: unless-stopped
Note I'm mapping port 7654 to 7664 in the above example, but that's because I have another version of this container for DirecTV app capture on 7654. Use the original port unless you have more than one running too.
And, your environment variables should look something like this:
You can spin-up the container if you'd like to use the included version of ws-scrcpy (found on port 8000, or whatever you map it to on your ah4c host) to interact with your streaming devices, but don't set the $CREATE_M3US variable to true until you're ready to create the device-specific M3Us necessary to capture the channels in the FireTV LiveTV guide (prepare your LiveTV guide first!).
It's not unusual to have hundreds of channels in that guide, and you want to get that number down to less than 60 or so to have this extension work effectively for you. It's also recommended to go through Privacy Settings, Data Usage Monitoring, Notification Settings and Featured Content in Preferences to limit ads, pop-ups, monitoring and the like:
The most important thing though is to hide sources in the channel guide that you don't want to use. For example, here's my channel guide sources:
You can see I have everything except Prime Video Channels hidden. This gives me 24 channels in the guide, and then I have 3 channels within that group hidden leaving me with 21 total:
Your "master" livetv.m3u should then reflect the same channels you have showing in the guide. Here's mine for the premium channels I'm subscribed to:
#EXTM3U
#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://{{ .IPADDRESS }}/play/tuner/5MAXHD
#EXTINF:-1 channel-id="ACMAXHD" tvc-guide-stationid="59948",ActionMAX HD East
http://{{ .IPADDRESS }}/play/tuner/ACMAXHD
#EXTINF:-1 channel-id="MAXHD" tvc-guide-stationid="34933",Cinemax HD East
http://{{ .IPADDRESS }}/play/tuner/MAXHD
#EXTINF:-1 channel-id="MAXHDP" tvc-guide-stationid="35975",Cinemax HD West
http://{{ .IPADDRESS }}/play/tuner/MAXHDP
#EXTINF:-1 channel-id="SZEAHD" tvc-guide-stationid="72015",Encore Action HD East
http://{{ .IPADDRESS }}/play/tuner/SZEAHD
#EXTINF:-1 channel-id="STZENHD" tvc-guide-stationid="36225",Encore HD East
http://{{ .IPADDRESS }}/play/tuner/STZENHD
#EXTINF:-1 channel-id="MGMHD" tvc-guide-stationid="65669",MGM+
http://{{ .IPADDRESS }}/play/tuner/MGMHD
#EXTINF:-1 channel-id="MGMDRHD" tvc-guide-stationid="103828",MGM+ DRIVE-IN
http://{{ .IPADDRESS }}/play/tuner/MGMDRHD
#EXTINF:-1 channel-id="MGMHTH" tvc-guide-stationid="67929",MGM+ HITS
http://{{ .IPADDRESS }}/play/tuner/MGMHTH
#EXTINF:-1 channel-id="MGMMRHD" tvc-guide-stationid="74073",MGM+ MARQUEE
http://{{ .IPADDRESS }}/play/tuner/MGMMRHD
#EXTINF:-1 channel-id="MOMAXHD" tvc-guide-stationid="59373",MoreMAX HD East
http://{{ .IPADDRESS }}/play/tuner/MOMAXHD
#EXTINF:-1 channel-id="MOVIEHD" tvc-guide-stationid="59963",MovieMAX HD East
http://{{ .IPADDRESS }}/play/tuner/MOVIEHD
#EXTINF:-1 channel-id="OUTMAXHD" tvc-guide-stationid="59952",OuterMAX HD East
http://{{ .IPADDRESS }}/play/tuner/OUTMAXHD
#EXTINF:-1 channel-id="STRZCIH" tvc-guide-stationid="67236",Starz Cinema HD East
http://{{ .IPADDRESS }}/play/tuner/STRZCIH
#EXTINF:-1 channel-id="STZCHD" tvc-guide-stationid="57569",Starz Comedy HD East
http://{{ .IPADDRESS }}/play/tuner/STZCHD
#EXTINF:-1 channel-id="STZEHD" tvc-guide-stationid="57573",Starz Edge HD East
http://{{ .IPADDRESS }}/play/tuner/STZEHD
#EXTINF:-1 channel-id="STZHD" tvc-guide-stationid="34941",Starz HD East
http://{{ .IPADDRESS }}/play/tuner/STZHD
#EXTINF:-1 channel-id="STZHDP" tvc-guide-stationid="34949",Starz HD West
http://{{ .IPADDRESS }}/play/tuner/STZHDP
#EXTINF:-1 channel-id="STRZIBH" tvc-guide-stationid="67235",Starz inBlack HD East
http://{{ .IPADDRESS }}/play/tuner/STRZIBH
#EXTINF:-1 channel-id="STZKHD" tvc-guide-stationid="57581",Starz Kids & Family HD East
http://{{ .IPADDRESS }}/play/tuner/STZKHD
#EXTINF:-1 channel-id="THMAXHD" tvc-guide-stationid="59954",ThrillerMAX East
http://{{ .IPADDRESS }}/play/tuner/THMAXHD
Add or subtract channels from this M3U to match the channels you have available. Once this setup is complete, you can redeploy the container with CREATE_M3US set to true. This will step through the guide on each of your defined devices to create a device-specific slave playlist that'll be used to tune to the appropriate channel.
There's an M3U editor that can be found at [http://<your_hostname_ip:7654], and then click on M3U editor followed by livetv.m3u. Channels should be added using their "official" unique call sign for the channel-id, and for the last part of the http://{{ .IPADDRESS }}/play/tuner/5MAXHD URL (shown in bold).
The channels in your livetv.m3u need to exactly match what's in the LiveTV guide on your devices (which also need to match each other). The "Channel Name" in particular should match letter-for-letter and case-for-case with your streaming device, as everything is sorted in strict alphabetical order.
I've been using this for a week or so myself, and it's been working well. Creating a version that will automagically create the device-specific M3Us was a touch tricky, but appears to be working fine also.