HDMI for Channels

Are you using experimental mpegts rewriter ?

Sorry meant to post back not home you can do back then home unless this meses you up.

So I actually have 4 devices in developer mode, but I'm only currently using 2 in Channels. I clicked the home button on each device to bring up their screen on my encoder and all 4 came up, with no allow network debugging screens currently showing. I ran ./adb devices and see that the one that was listed as unauthorized is now "device" again on it's own:

List of devices attached
192.168.1.192:5555 device
192.168.1.204:5555 device
192.168.1.162:5555 unauthorized

I toggled developer options off/on on 192.168.1.162 and ./adb devices show's it as "device" again with no on-screen pop-up message

The fourth device, 192.168.1.120 still has USB debugging on, but doesn't respond to the adb connect command so I rebooted it and now it's listed and responding again.

Thanks, that worked!

No I didn't realize that might help - I guess I should try that first - thanks!

Just finished a Docker container for this project which will support 1-4 tuners. I only have a single tuner URayCoder, so additional tuners are untested -- but hopefully someone here with a multi-tuner setup will give it a shot. I'd recommend using Portainer - Stacks to deploy it, and here's the compose for that:

version: '3.9'
services:
  androidhdmi-for-channels:
    image: bnhf/androidhdmi-for-channels:latest
    container_name: androidhdmi-for-channels
    dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
    ports:
      - 5037:5037
      - 7654:7654
    environment:
      - ADB_DEVICES=${ADB_DEVICES} # Space separated list of adb devices to control in the form hostname:port or ip:port
      - TUNERS=${TUNERS} # Number of tuners you'd like defined 1, 2, 3 or 4 supported
      - TUNER1_URL=${TUNER1_URL} # Full URL for tuner #1 in the form http://hostname/stream or http://ip/stream
      - TUNER2_URL=${TUNER2_URL} # Full URL for tuner #2 in the form http://hostname/stream or http://ip/stream
      - TUNER3_URL=${TUNER3_URL} # Full URL for tuner #3 in the form http://hostname/stream or http://ip/stream
      - TUNER4_URL=${TUNER4_URL} # Full URL for tuner #4 in the form http://hostname/stream or http://ip/stream
    volumes:
      - /data/androidhdmi-for-channels:/opt/scripts # pre/stop/bmituneX.sh scripts will be stored in this bound host directory
    restart: unless-stopped

A couple of things to keep in mind:

You'll want to disconnect any adb devices from your existing development environment to avoid adb connections that are "unauthorized" when they're connected to this container. Also, you'll need to approve them on the Android device, since they'll be connecting to a new adb server.

By binding the /opt/scripts directory to a directory on your Docker host, you'll be able to connect Visual Studio Code to it via the Remote-SSH extension. This creates a pretty nice setup, as you can modify your pre/stop/bmitune.sh scripts on the fly. The scripts are named with 1, 2, 3 and 4 added on to them and used with tuners of the same number.

It's a multi-arch container that'll run on amd64, arm64 and arm/v7. I forked the @tmm1 project mostly to support a variable number of tuners with a single container. If you want to look at the few changes I made to the source it's at GitHub - bnhf/androidhdmi-for-channels: androidhdmi-for-channels

I'm running Docker in a Proxmox container, so if you like to virtualize everything like me, it works just fine. Questions?

4 Likes

Also, thought I'd post my little encoder hardware stack. :slight_smile:

It's a single tuner setup, using a 36W 7-port USB3 hub for power to the Amazon Fire Stick 4K Max (with Ethernet adapter).

It has a nice metal case that's the same height as the URayCoder. A bit more testing with the current setup, and then I'll get a 4-port encoder and use it in one of my racks in a side-by-side configuration.

I've been working with it for a few days with no issues, so here's the link for the interested: https://www.amazon.com/dp/B0793HQ57L

Thanks to everyone who's been contributing to this thread! It's a bit awkward to comb through, but there's lots of useful information.

3 Likes

That is interesting I have a USB 3 Hub but could not power my Firesticks ... I will check this one out.

Something of an add-on to my docker container post above:

As people get their scripts finalized for various streaming devices, let me know and I'll add them to the docker container. With an additional environment variable or two, I would imagine most of your scripts could be used by others with the same devices.

Submit them as a PR if you're GitHub savvy, or PM me with them and we'll see if we can make the container a way for people that aren't as interested in a "voyage of discovery" to utilize this nice little extension for Channels DVR.

3 Likes

If you would like to try and have less power cords.

I don't have the same encoder, but the one I have (LinkPi ENC1v2) can be powered with 5v so I was able to power it with a usb hub using this adaptor. My device was also labeled "12v" but it runs just fine with 5v.
https://www.amazon.com/dp/B09ZQNWDZS

These also work for me. They convert 5v to 12v:
https://www.amazon.com/dp/B09M3LMSS3

The Fire Stick I'm using hadn't been updated in a while, so I did 3 updates in a row -- with no warnings about power, so it seems to be a good one for this purpose.

Wow, this is awesome, @bnhf. Way to supercharge this HDMI project! I can't wait to dive in and update my setup, with two encoders and a Mac server. Strategizing ahead of time, I am following your prescribed steps. As far as these instructions go:

How is this part handled? Via developer menu commands on the devices themselves, adb commands in Terminal, or...?

This part is cool too. I'm new to this but see there are versions for Windows, Mac, Debian, Ubuntu, Red Hat, Fedora, and SUSE. Sweet!

In your existing androidhdmi-for-channels environment, adb disconnect [host or ip]:5555 should do it. It's possible rebooting your streaming device would accomplish the same thing -- but I'd recommend the disconnect approach.

Right? Visual Studio Code, and its many extensions, is an absolute gem. You can do development on your local system, a remote system via ssh, or even in a docker container. Great integration with GitHub.com and GitHub Desktop.

1 Like

Same. I don't know where to start anymore. I have a Chromecast for Google TV ready to go, just not sure how to get it going and what else I need for Hulu with Live tv and Unraid.

This is part of the issue I'm addressing by dockerizing this project. About everything you need to get going is in one place and configured for you, with the current exception of the custom tuning scripts. I'll add those too though for any streaming device, as they're submitted to me. Some have already been posted in this thread. I know Unraid likes to use its own docker templates, but my understanding is that you can use containers from Docker Hub too, and even install Portainer.

I have several containers I use in conjunction with Channels DVR, and I have all of them installed under Docker in a single Proxmox CT (though this could be any Linux, Windows or Mac host) . I also have a control container for my APC UPS and Tailscale, so I can access the whole works from anywhere.

Also keep in mind that this is a proxy, in other words this project can run on any system on your LAN, not just on your Unraid box. A RaspberryPi or other SBC would be sufficient. Everything you see below is running in a very low resource environment:

1 Like

I tried the experimental mpeg-ts rewriter - it definitely seems better as some test recordings were good, but I still had some test recordings with issues - for example, I recorded the NBC nightly news (30 min) and it indicated 26+ hours in length - then I manually ran the 2 fixes (timestamp and video index) and it was 30 minutes - are there some encoder settings that I need to change? (Turn off high profile?) - I am currently using MPEG4, high profile, CBR, 10Mbps, Custom 60 fps

My config/environment has been really stable since fixing the remote issue and now I am turning attention to cleaning up the scripts and making things feel less "hacky".

First set of changes is to add a encoder ip and tuner ip to the main.go file so that we(hopefully this will be considered for merging) only need to maintain one set of scripts for multiple tuners/encoders.

Feedback welcome!

1 Like

I'm going to start working on reducing the number of tuning scripts required for the Docker container version of this project. In addition, I want to create an directory structure that makes sense. So, here are my ideas, which I'd like to get some feedback on:

I believe all that's necessary to have a single script work for any tuner is to be able to pass the adb device name as a parameter. Right now the channel name/number is passed as $1, so the adb device name could be the second parameter. Am I missing anything else that might be needed?

Secondly, to support multiple streaming devices and apps, I'm thinking that under /opt/scripts we could organize by device/app/script. Make sense?

Funny. You posted on the same topic at almost the same time! Let's coordinate on this.

1 Like

Have a look at my main.go where I am passing the encoder and tuner ip's.

Also really like the idea of making scripts available via a directory structure.