AndroidHDMI-for-Channels (ah4c) - FireTV LiveTV capture

In terms of future plans for this particular ah4c project variant, I'm planning to merge the DirecTV script with this FireTV LiveTV version.

In other words, you'll be able to use a common set of tuners for DTV app and LiveTV guide capture (Prime Channels and others). HDMI encoder with FireTV devices required (4K MAX, 3rd Gen Cube, or better recommended).

1 Like

Well, its close.
Its not matching channels for some reason.
It will either stop on the wrong channel, or go right on by and give up.
here is my current m3u

#EXTM3U

#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://192.168.1.2:7654/play/tuner/5MAXHD

#EXTINF:-1 channel-id="ACMAXHD" tvc-guide-stationid="59948",ActionMAX HD East
http://192.168.1.2:7654/play/tuner/ACMAXHD

#EXTINF:-1 channel-id="MAXHD" tvc-guide-stationid="34933",Cinemax HD East
http://192.168.1.2:7654/play/tuner/MAXHD

#EXTINF:-1 channel-id="MAXHDP" tvc-guide-stationid="35975",Cinemax West
http://192.168.1.2:7654/play/tuner/MAXHDP

#EXTINF:-1 channel-id="SZEAHD" tvc-guide-stationid="72015",Encore Action HD East
http://192.168.1.2:7654/play/tuner/SZEAHD

#EXTINF:-1 channel-id="STZENHD" tvc-guide-stationid="36225",Encore HD East
http://192.168.1.2:7654/play/tuner/STZENHD

#EXTINF:-1 channel-id="MGMHD" tvc-guide-stationid="65669",MGM+
http://192.168.1.2:7654/play/tuner/MGMHD

#EXTINF:-1 channel-id="MGMDRHD" tvc-guide-stationid="103828",MGM+ DRIVE-IN
http://192.168.1.2:7654/play/tuner/MGMDRHD

#EXTINF:-1 channel-id="MGMHTH" tvc-guide-stationid="67929",MGM+ HITS
http://192.168.1.2:7654/play/tuner/MGMHTH

#EXTINF:-1 channel-id="MGMMRHD" tvc-guide-stationid="74073",MGM+ MARQUEE
http://192.168.1.2:7654/play/tuner/MGMMRHD

#EXTINF:-1 channel-id="MOMAXHD" tvc-guide-stationid="59373",MoreMAX HD East
http://192.168.1.2:7654/play/tuner/MOMAXHD

#EXTINF:-1 channel-id="MOVIEHD" tvc-guide-stationid="59963",MovieMAX HD East
http://192.168.1.2:7654/play/tuner/MOVIEHD

#EXTINF:-1 channel-id="OUTMAXHD" tvc-guide-stationid="59952",OuterMAX HD East
http://192.168.1.2:7654/play/tuner/OUTMAXHD

#EXTINF:-1 channel-id="STRZCIH" tvc-guide-stationid="67236",Starz Cinema HD East
http://192.168.1.2:7654/play/tuner/STRZCIH

#EXTINF:-1 channel-id="STZCHD" tvc-guide-stationid="57569",Starz Comedy HD East
http://192.168.1.2:7654/play/tuner/STZCHD

#EXTINF:-1 channel-id="STZEHD" tvc-guide-stationid="57573",Starz Edge HD East
http://192.168.1.2:7654/play/tuner/STZEHD

#EXTINF:-1 channel-id="STZHD" tvc-guide-stationid="34941",Starz HD East
http://192.168.1.2:7654/play/tuner/STZHD

#EXTINF:-1 channel-id="STZHDP" tvc-guide-stationid="34949",Starz HD West
http://192.168.1.2:7654/play/tuner/STZHDP

#EXTINF:-1 channel-id="STRZIBH" tvc-guide-stationid="67235",Starz inBlack HD East
http://192.168.1.2:7654/play/tuner/STRZIBH

#EXTINF:-1 channel-id="STZKHD" tvc-guide-stationid="57581",Starz Kids & Family HD East
http://192.168.1.2:7654/play/tuner/STZKHD

#EXTINF:-1 channel-id="THMAXHD" tvc-guide-stationid="59954",ThrillerMAX East
http://192.168.1.2:7654/play/tuner/THMAXHD

#EXTINF:-1 channel-id="AMCPLUS" tvc-guide-stationid="114759",AMC+
http://192.168.1.2:7654/play/tuner/AMCPLUS

#EXTINF:-1 channel-id="HBO" tvc-guide-stationid="10240",HBO
http://192.168.1.2:7654/play/tuner/HBO

#EXTINF:-1 channel-id="HBO 2" tvc-guide-stationid="10241",HBO 2
http://192.168.1.2:7654/play/tuner/HBO 2

#EXTINF:-1 channel-id="HBOCOMEDY" tvc-guide-stationid="18429",HBO COMEDY
http://192.168.1.2:7654/play/tuner/HBOCOMEDY

#EXTINF:-1 channel-id="HBOFAM" tvc-guide-stationid="34879",HBO FAMILY
http://192.168.1.2:7654/play/tuner/HBOFAM

#EXTINF:-1 channel-id="HBOSLAE" tvc-guide-stationid="74447",HBO SIGNATURE
http://192.168.1.2:7654/play/tuner/HBOSLAE

#EXTINF:-1 channel-id="HBO" tvc-guide-stationid="10244",HBO WEST
http://192.168.1.2:7654/play/tuner/HBO

#EXTINF:-1 channel-id="HBOZONE" tvc-guide-stationid="18431",HBO ZONE
http://192.168.1.2:7654/play/tuner/HBOZONE

#EXTINF:-1 channel-id="PPLUSHISUN" tvc-guide-stationid="121825",HISTORY & UNDISCOVERED
http://192.168.1.2:7654/play/tuner/PPLUSHISUN

#EXTINF:-1 channel-id="PPLUSM" tvc-guide-stationid="121830",MOVIES
http://192.168.1.2:7654/play/tuner/PPLUSM

#EXTINF:-1 channel-id="SHOWTM" tvc-guide-stationid="87770",SHOWTIME
http://192.168.1.2:7654/play/tuner/SHOWTM

#EXTINF:-1 channel-id="SHOWTIME" tvc-guide-stationid="11117",SHOWTIME WEST
http://192.168.1.2:7654/play/tuner/SHOWTIME

There are definitely issues with your M3U, and I'll give you a more complete response on that shortly. In the meantime, could you post the generated device-specific M3U as well?

I would guess in your case that's going to be the IP address of the FireStick with a .m3u at the end. It'll be found in the same folder with livetv.m3u.

Ok, so to distill it down, here are the issues I see:

Call signs never have spaces, and are always unique. Don't use SD call signs or Gracenote IDs if HD versions are available. This screen capture from Zap2It shows appropriate call signs for HBO:

As you can see HBO HD East's call sign should be HBOHD, and HBO HD West should be HBOHDP for example. Right clicking on the logo next to HBOHD and opening the image in a new tab would show you what the Gracenote Station ID should be for that channel:

https://zap2it.tmsimg.com/h3/NowShowing/19548/s19548_ll_h15_aa.png?w=55

Which in this case should be 19548 (use the number after /NowShowing/ as it's sometimes different from the .png filename.

The Channel Name (which is after the comma on the first line of each M3U record) should exactly match the channel name in the FireTV LiveTV guide. I'd suggest that should be down to the case level for best alphabetical sorting, i.e. use upper and lower case to match:

Manage Channels - Prime Video Channels is the best place to see the exact channel name you should use.

Clearly I don't have a grasp on the m3u's

Here is the device specific m3u.

#EXTM3U

#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://192.168.1.2:7654/play/tuner/

#EXTINF:-1 channel-id="ACMAXHD" tvc-guide-stationid="59948",ActionMAX HD East
http://192.168.1.2:7654/play/tuner/57

#EXTINF:-1 channel-id="AMCPLUS" tvc-guide-stationid="114759",AMC+
http://192.168.1.2:7654/play/tuner/11

#EXTINF:-1 channel-id="MAXHD" tvc-guide-stationid="34933",Cinemax HD East
http://192.168.1.2:7654/play/tuner/67

#EXTINF:-1 channel-id="MAXHDP" tvc-guide-stationid="35975",Cinemax West
http://192.168.1.2:7654/play/tuner/38

#EXTINF:-1 channel-id="SZEAHD" tvc-guide-stationid="72015",Encore Action HD East
http://192.168.1.2:7654/play/tuner/71

#EXTINF:-1 channel-id="STZENHD" tvc-guide-stationid="36225",Encore HD East
http://192.168.1.2:7654/play/tuner/52

#EXTINF:-1 channel-id="HBO" tvc-guide-stationid="10240",HBO
http://192.168.1.2:7654/play/tuner/18

#EXTINF:-1 channel-id="HBO 2" tvc-guide-stationid="10241",HBO 2
http://192.168.1.2:7654/play/tuner/74

#EXTINF:-1 channel-id="HBOCOMEDY" tvc-guide-stationid="18429",HBO COMEDY
http://192.168.1.2:7654/play/tuner/49

#EXTINF:-1 channel-id="HBOFAM" tvc-guide-stationid="34879",HBO FAMILY
http://192.168.1.2:7654/play/tuner/33

#EXTINF:-1 channel-id="HBOSLAE" tvc-guide-stationid="74447",HBO SIGNATURE
http://192.168.1.2:7654/play/tuner/35

#EXTINF:-1 channel-id="HBO" tvc-guide-stationid="10244",HBO WEST
http://192.168.1.2:7654/play/tuner/50

#EXTINF:-1 channel-id="HBOZONE" tvc-guide-stationid="18431",HBO ZONE
http://192.168.1.2:7654/play/tuner/58

#EXTINF:-1 channel-id="PPLUSHISUN" tvc-guide-stationid="121825",HISTORY & UNDISCOVERED
http://192.168.1.2:7654/play/tuner/32

#EXTINF:-1 channel-id="MGMHD" tvc-guide-stationid="65669",MGM+
http://192.168.1.2:7654/play/tuner/41

#EXTINF:-1 channel-id="MGMDRHD" tvc-guide-stationid="103828",MGM+ DRIVE-IN
http://192.168.1.2:7654/play/tuner/22

#EXTINF:-1 channel-id="MGMHTH" tvc-guide-stationid="67929",MGM+ HITS
http://192.168.1.2:7654/play/tuner/66

#EXTINF:-1 channel-id="MGMMRHD" tvc-guide-stationid="74073",MGM+ MARQUEE
http://192.168.1.2:7654/play/tuner/80

#EXTINF:-1 channel-id="MOMAXHD" tvc-guide-stationid="59373",MoreMAX HD East
http://192.168.1.2:7654/play/tuner/30

#EXTINF:-1 channel-id="MOVIEHD" tvc-guide-stationid="59963",MovieMAX HD East
http://192.168.1.2:7654/play/tuner/12

#EXTINF:-1 channel-id="PPLUSM" tvc-guide-stationid="121830",MOVIES
http://192.168.1.2:7654/play/tuner/34

#EXTINF:-1 channel-id="OUTMAXHD" tvc-guide-stationid="59952",OuterMAX HD East
http://192.168.1.2:7654/play/tuner/56

#EXTINF:-1 channel-id="SHOWTM" tvc-guide-stationid="87770",SHOWTIME
http://192.168.1.2:7654/play/tuner/21

#EXTINF:-1 channel-id="SHOWTIME" tvc-guide-stationid="11117",SHOWTIME WEST
http://192.168.1.2:7654/play/tuner/83

#EXTINF:-1 channel-id="STRZCIH" tvc-guide-stationid="67236",Starz Cinema HD East
http://192.168.1.2:7654/play/tuner/24

#EXTINF:-1 channel-id="STZCHD" tvc-guide-stationid="57569",Starz Comedy HD East
http://192.168.1.2:7654/play/tuner/16

#EXTINF:-1 channel-id="STZEHD" tvc-guide-stationid="57573",Starz Edge HD East
http://192.168.1.2:7654/play/tuner/68

#EXTINF:-1 channel-id="STZHD" tvc-guide-stationid="34941",Starz HD East
http://192.168.1.2:7654/play/tuner/44

#EXTINF:-1 channel-id="STZHDP" tvc-guide-stationid="34949",Starz HD West
http://192.168.1.2:7654/play/tuner/19

#EXTINF:-1 channel-id="STRZIBH" tvc-guide-stationid="67235",Starz inBlack HD East
http://192.168.1.2:7654/play/tuner/69

#EXTINF:-1 channel-id="STZKHD" tvc-guide-stationid="57581",Starz Kids & Family HD East
http://192.168.1.2:7654/play/tuner/78

#EXTINF:-1 channel-id="THMAXHD" tvc-guide-stationid="59954",ThrillerMAX East
http://192.168.1.2:7654/play/tuner/54

In this case especially, the M3U needs to spot-on, but you are in the ballpark -- a few adjustments and you'll be there. Once you have the M3U the way you want it, restart the container (re-pull and redeploy switch set to on) and a new device-specific version will be generated for you.

EDIT: Also, make sure the URL part after /play/tuner/ exactly matches the channel-id, once you've sorted those out.

EDIT2: I have made some minor improvements today, so when you're ready to build the device-specific M3U again, go ahead and stop the stack, and add: UPDATE_SCRIPTS=${UPDATE_SCRIPTS}
to the environment section of your docker-compose and UPDATE_SCRIPTS and true to the environment variables section. That'll pull the most recent ah4c:prime image and update the scripts as well.

Here's a partial screenshot to show you what it should look like:

1 Like

When everything is hunky-dory, we don't want to see any records like this in your device-specific M3U:

#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://192.168.1.2:7654/play/tuner/

Note the missing unique ID after /play/tuner/. We can't have any of these missing, but having the one in the first record is the worst of all -- as that's how we confirm we're at the top of the guide.

Ok,
I'm trying to get just the channels you have included since I have all of those.
I have noticed that Cinemax West is different than what I am seeing.
I removed "HD" because that is what I am seeing on the FireTV.

One other thing I noticed is there is a banner in the middle of the guide for a TV Series. Perhaps that is messing things up?

This is the device m3u now.

#EXTM3U

#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://192.168.1.2:7654/play/tuner/55

#EXTINF:-1 channel-id="ACMAXHD" tvc-guide-stationid="59948",ActionMAX HD East
http://192.168.1.2:7654/play/tuner/57

#EXTINF:-1 channel-id="MAXHD" tvc-guide-stationid="34933",Cinemax HD East
http://192.168.1.2:7654/play/tuner/67

#EXTINF:-1 channel-id="MAXHDP" tvc-guide-stationid="35975",Cinemax West
http://192.168.1.2:7654/play/tuner/38

#EXTINF:-1 channel-id="SZEAHD" tvc-guide-stationid="72015",Encore Action HD East
http://192.168.1.2:7654/play/tuner/71

#EXTINF:-1 channel-id="STZENHD" tvc-guide-stationid="36225",Encore HD East
http://192.168.1.2:7654/play/tuner/16

#EXTINF:-1 channel-id="MGMHD" tvc-guide-stationid="65669",MGM+
http://192.168.1.2:7654/play/tuner/52

#EXTINF:-1 channel-id="MGMDRHD" tvc-guide-stationid="103828",MGM+ DRIVE-IN
http://192.168.1.2:7654/play/tuner/18

#EXTINF:-1 channel-id="MGMHTH" tvc-guide-stationid="67929",MGM+ HITS
http://192.168.1.2:7654/play/tuner/74

#EXTINF:-1 channel-id="MGMMRHD" tvc-guide-stationid="74073",MGM+ MARQUEE
http://192.168.1.2:7654/play/tuner/49

#EXTINF:-1 channel-id="MOMAXHD" tvc-guide-stationid="59373",MoreMAX HD East
http://192.168.1.2:7654/play/tuner/33

#EXTINF:-1 channel-id="MOVIEHD" tvc-guide-stationid="59963",MovieMAX HD East
http://192.168.1.2:7654/play/tuner/35

#EXTINF:-1 channel-id="OUTMAXHD" tvc-guide-stationid="59952",OuterMAX HD East
http://192.168.1.2:7654/play/tuner/50

#EXTINF:-1 channel-id="STRZCIH" tvc-guide-stationid="67236",Starz Cinema HD East
http://192.168.1.2:7654/play/tuner/58

#EXTINF:-1 channel-id="STZCHD" tvc-guide-stationid="57569",Starz Comedy HD East
http://192.168.1.2:7654/play/tuner/32

#EXTINF:-1 channel-id="STZEHD" tvc-guide-stationid="57573",Starz Edge HD East
http://192.168.1.2:7654/play/tuner/41

#EXTINF:-1 channel-id="STZHD" tvc-guide-stationid="34941",Starz HD East
http://192.168.1.2:7654/play/tuner/22

#EXTINF:-1 channel-id="STZHDP" tvc-guide-stationid="34949",Starz HD West
http://192.168.1.2:7654/play/tuner/66

#EXTINF:-1 channel-id="STRZIBH" tvc-guide-stationid="67235",Starz inBlack HD East
http://192.168.1.2:7654/play/tuner/80

#EXTINF:-1 channel-id="STZKHD" tvc-guide-stationid="57581",Starz Kids & Family HD East
http://192.168.1.2:7654/play/tuner/30

#EXTINF:-1 channel-id="THMAXHD" tvc-guide-stationid="59954",ThrillerMAX East
http://192.168.1.2:7654/play/tuner/12

Shouldn't be, I have those "ads" too, and I'm accounting for those in the script.

Looks right to me, and actually matches your first attempt, with the exception of the first record. If you updated the ah4c:prime image, hopefully you're seeing some better results now.

EDIT: From here forward, you should have CREATE_M3US set to false. No reason to recreate this file on every container launch, unless you actually need to generate a new device-specific M3U for whatever reason.

Something I just thought of, that might be tripping you up, is that you need to do a "Reload M3U" from the Channels DVR settings page for this specific source, every time you make a change to the "master" (livetv.m3u) and want to test. This is a Channels DVR requirement.

No, its not working.
Seems to always pick the wrong channel.
5 star max and actionmax works, the rest mess up.

Yes I do this....

Does it matter if there are channels in the FireTV guide that are not configured in the m3u?
I didn't hide all the other channels that I eventually want.

Don't forget the visible channels in your guide need to exactly match the M3U. Which means, if you're only using the channels I defined you'd need to hide all other channels, and re-run the create M3Us. Right now I'd guess you have channels (and maybe other sources) that don't match your current M3U.

After you get the initial device-specific M3Us created, if additional channels appear or disappear from the guide it's not as big a deal as you've already captured the correct IDs for the channels you've defined.

Discovering the FireStick IDs can be done manually as well, but this way works as long as everything is lined up properly.

Yes. Read my last.

So they need to be in the same order?

No, because FireTV sorts alphabetically, and I sort the device-specific M3U alphabetically as well. You should be able to compare them to confirm if you like.

@Anvil_DVR

If you want to confirm the IDs manually, you can exec into the container using the Portainer "Quick Action" button for that purpose, and enter:

adb logcat | grep GuideManager

That will continue to run until you Ctrl-C it. Leave it running and step through the guide. You should see lines like this after each guide move:

09-19 20:00:54.567 14043 14043 I GuideManager: Updating mini details for station livetv://stationgroup/item?groupType=STATION_SOURCE&groupId=com.amazon.avod%2F.tvif.AIVTvInputService!!livetv://station/item?9

The number at the very end is what you're after, so you can compare that to what you're getting from the automated process. Not a requirement, but do it if you're feeling inclined.