ADBTuner: A "channel tuning" application for networked Google TV / Android TV devices

I agree with this. ah4channels provides the ability to really get into custom, app-specific commands in ways that I don't anticipate ever supporting in ADBTuner.

At some point I might add some advanced features to customize the am start command, but it won't be sufficient enough to handle "press down 3 times, wait 2 seconds, click play" or things like that and it definitely won't be piping video to ffmpeg.

There is also probably a place for using a computer or a Pi as a "tuner" connected to one of those HDMI devices. With browser automation tools you would have much more control (ex. find button labeled ESPN, click on it). I don't know if that's an extension of ah4channels or something else, but something to think about.

I might need a little more detail to understand exactly what you're doing here, but similar to my response to @Fofer, the ah4channels project has what I think you're talking about. A custom FFMPEG command can be specified for each tuner, and could be tied to a specific item in the EPG to execute it.

@turtletank has done an outstanding job with this project, but my understanding is that he'd like to limit the scope of it to apps that support deep links. This project, and ah4channels can be run side-by-side, and could each control two HDMI inputs on a four-port encoder. They are not mutually exclusive. :wink:

I got it!

https://link.fubo.tv/al1%3Fv%3D1%26a%3Dplay%26t%3Dchannel%26channel_id%3D129560

(Where the number on the end is the channel number)

Now to integrate with ADBTuner!

1 Like

I'll have to check out that project to see if it streamlines what I do. Right now I have a two step process, but it is manual so not ideal:

  1. I enter this command in Terminal on the Mac (I've already installed FFMPEG), for example, if I want to record for 2 hours and ten minutes, from my HDMI encoder at IP address 192.168.7.152, to a file named mymovie.mp4
ffmpeg -t 02:10:00 -i http://192.168.7.152/0.ts mymovie.mp4
  1. I start playing content on the streaming device attached to the encoder with IP address of 192.168.7.15. (Let's say I want to record a movie from Amazon Prime. I remote into the encoder's streaming stick using VLC, start Amazon Prime, find the content, and start playing the content).

It's not an automatic process at all, so I'll definitely check out ah4channels, which I hadn't heard of previously. Where can it be found? I came up empty in a Google search, and it is only mentioned twice in these forums, as best I can tell.

(By the way, if anybody knows how to split my post off to its own topic, feel free to do so. I don't want to sidetrack this great project of @turtletank)

Interesting, it works great for one channel, but when I add another the second one never launches the Fubo app (yet the first one continues to work just fine).

What I could get from the logs:

2023-07-23 21:57:23.626 - lib.adb - ADB: 192.168.5.197 - am start -S -a android.intent.action.VIEW -d " https://link.fubo.tv/al1%3Fv%3D1%26a%3Dplay%26t%3Dchannel%26channel_id%3D726500001" com.fubo.firetv.screen
2023-07-23 21:57:29.207 - server - Tuner: Compatibility Mode - Stream released after 6.14 seconds. Display was on, application (com.fubo.firetv.screen) was closed.
1 Like

ah4channels=androidhdmi-for-channels (sullrich fork) -- ah4channels was just my attempt to differentiate the sullrich fork from the original. As you know, I containerized the original extension, and later the fork. It's become a really capable project, with some impressive features:

and for the Docker container:

https://hub.docker.com/repository/docker/bnhf/androidhdmi-for-channels

I haven't added ffmpeg to the container yet though, but that would be easy enough to do if there's interest. Support for custom transcoding is already in the source, and was being used by @KompilerDJ for the internal capture cards he was using.

I think it's important for users of this project, that mostly came from the original androidhdmi-for-channels, to understand there's a "companion" project that can already address many of the "blue sky" features people are likely to conjure up. Especially now that ADBTuner is addressing the core functionality many were struggling with.

3 Likes

Two step reply here, because you've just described exactly what PlayOn does -- which is also nicely integrated into Channels DVR. PlayOn is flat-out awesome when it comes to static content like you're talking about. I use it with pretty much all of my streaming services. PlayOn recording credits are cheap in bulk, and typically last me quite a while.

With all the fantastic CDVR extensions that have been developed, like this one, it's more important than ever to choose the right tool for the job. :slight_smile:

1 Like

I've used PlayOn Cloud, and even have some credits remaining. I do have some concern with using it now that Netflix is looking for account sharing, as the cloud version will be using a different IP address than I normally use. But that might be unnecessary worry on my part. I do find the Netflix recordings in PlayOn to be solid, but the Disney+ ones weren't the greatest. I'm on a Mac, so unfortunately can't use the desktop version.

Cool, I see there are a bunch, which one are you using? The free "Google Home" is working for me, but the functionality feels a bit buried. What other remote app have you found that works well?

Good points and thanks for the informative replies, it all makes a lot of sense. I'm going to install the docker of ah4channels (sullrich fork) and run it concurrently alongside ADBTuner as described.

True that!

I tried to install using the command listed on linked page, but got this error:

fofer@CDVRServer ~ % docker pull bnhf/androidhdmi-for-channels
Using default tag: latest
Error response from daemon: manifest for bnhf/androidhdmi-for-channels:latest not found: manifest unknown: manifest unknown

Installing via this instead worked fine:

docker pull bnhf/androidhdmi-for-channels:alpha2

This reminded me of an old thread someone posted awhile ago to create a manual Channels recording from terminal. I took that and created a Keyboard Maestro macro that prompted the user for some information about the recording (channel#, duration, title and a bunch of optional parameters) then it creates a json file with that data and commands Channels to start the recording. I tried it on one of my ADBTuner channels and it worked great. I filled in the required fields, clicked ok, then ADBTunder went to work tuning the channel while ChannelsDVR started recording. This could work for deep links in ADBTuner or ah4channels.

The key command to start the recording after you populate the json file is:

curl -XPOST --data-binary @/tmp/CDVRrecording.json http://(ip-of-channels):8089/dvr/jobs/new
1 Like

With great power comes great responsibility :laughing:, i.e. you need a lot more than that:

version: '3.9'
services:
  androidhdmi-for-channels:
    image: bnhf/androidhdmi-for-channels:alpha2
    container_name: ah4channels-alpha
    hostname: ah4channels
    dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
    ports:
      - 5037:5037 # Port used by adb-server
      - 7654:7654 # Port used by this androidhdmi-for-channels proxy
    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=""
    volumes:
      - /data/androidhdmi-for-channels/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
      - /data/androidhdmi-for-channels/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/androidhdmi-for-channels/adb:/root/.android # Persistent data directory for adb keys
    restart: unless-stopped

Portainer is your friend here...

Can we maybe move the android-hdmi troubleshooting to that thread?

It’s absolutely cool to discuss that and other projects here, just don’t want confusion with docker-compose files and such.

Yes, absolutely.

I have the URay encoder as a second tuner and I have audio sync issues, even after using the suggested settings. I have ordered two J-Tech HD enconders (https://www.amazon.com/gp/product/B0761X6L3C/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) the first one is perfect, no sync issues, CPU is around 70% when encoding. On the second unit I purchased the CPU was constantly over 100% and the image stuttered.

I just bought the Exvist H265 video encoder and wanted to know if i neded some specific settings.
The tuner i'm using is an ONN 4k.
I have it all setup just want to make sure picture is good on my 55 In tv etc.
Any settings would be good to know.
Assistance appreciated.

Update on the non-launching on subsequent channels problem, it seems to have solved itself with a complete reinstall. It does persist with the FireTV 4K stick (2018), but given the giant warnings I'm ok with that :slight_smile:

Now if only my encoder would arrive!

Mine took a bit to arrive.
So far so good.

1 Like

I saw that encoder but went with the J-Tech instead :man_facepalming: . Could've saved a bunch with the Exvist too!

The “LinkPi ENC1-V2” has worked well for me.

That one would've saved me even more! Tempting to go dual encoders now haha