XFINITY Stream/HDHomeRun with NEXTPVR Backend into Channels

This is something I have been testing with XFINITY Stream NEXTPVR Free Donation) and Channels DVR.. Tuning is a bit slow but when you are recording with a 30 second Pre-Padding it is no Problem.

REQ
HDMI Capture Device FireStick(XFINITY Stream) Windows machine required to run NEXTPVR for now.

2 Likes

Looking forward to seeing more on this. Could even be possible to record some on demand content?...hmm

Yes the dev that I have been testing for already has an on-demand feature implemented it is just a matter of documentation. Once we are ready you can easily implement into Channels DVR.... using M3U

This is just a sample using NEXTPVR ui recording on demand ..

- GIF - Imgur

3 Likes

This is what we have working right now .... Using HDMI Encoder or USB Encoder

Can Record using HDHomeRun Primes all Channels.... including DRM using a device that can View these... Also when ATSC 3.0 DRM is supported by Silicondust.

Can Record from XFINITY Stream using FireTV or any device that can View it... You can Create own Scripts to record from other LiveTV Services.

Can Record on Demand.

Sample Scripts .

HDHR

@echo off

setlocal
set device=:5555
SET PATH=%PATH%;C:\platform-tools\
set first=2.1

SET "var="&for /f "delims=0123456789." %%i in ("%1") do set var=%%i
if defined var (
    echo "error:  invalid character"
    goto :ends
)

set line=
set channel=%1
set /a counter=0

:loop
    set /a counter += 1
    if %counter% EQU 2 (
        set line=%line%;input keyevent
    )
    set digit=%channel:~0,1%
    set channel=%channel:~1%
    if "%digit%" NEQ "." (
        if "%line%" == "" (
            set line=shell input keyevent KEYCODE_%digit%;sleep 1.0
        ) else (
            set line=%line% KEYCODE_%digit%
        )
    ) else  (
        set line=%line% KEYCODE_PERIOD
    )
if NOT "%channel%" == "" goto loop
set channel=%1
if "%channel%" == "%first%" (
    set line=%line%;input keyevent 111; sleep 0.25;input keyevent 19 66
) else (
    set line=%line%;input keyevent 111; sleep 0.25; input keyevent 66
)

if %counter% gtr 6 (
    echo "error: max 6 characters"
    goto :ends
)

adb connect %device% >NUL
set ret=%errorlevel%
if "%ret%" NEQ "0" (
    echo "error: adb not found"
    goto :ends
)

adb -s %device% shell "dumpsys power | grep =Awake" >NUL
set ret=%errorlevel%
if "%ret%" == "1" adb -s %device% shell input keyevent KEYCODE_WAKEUP ; sleep 2

adb -s %device% shell pidof com.silicondust.view >NUL
set ret=%errorlevel%
if "%ret%" == "0" goto home:
    adb -s %device% shell am force-stop com.silicondust.view >NUL
    adb -s %device% shell sleep 1
    adb -s %device% shell am start -W -n com.silicondust.view/.App >NUL 2>NUL
    adb -s %device% shell sleep 6
    goto :adbtune

:home
    adb -s %device% shell "am start -W -n com.silicondust.view/.App | grep -q WARM"
    set ret=%errorlevel%
    if "%ret%" == "0" (
        adb -s %device% shell sleep 4
    )

:adbtune

adb -s %device% shell sleep 0.5; input keyevent 19 19 19;sleep 0.5; input keyevent 21 21 21 66

adb -s %device% %line%

@REM ffmpeg -v panic -re -f dshow -rtbufsize 40M -video_size 1280x720 -framerate 30  -i video="USB3. 0 capture":audio="Digital Audio Interface (USB3. 0 capture)"  -vcodec h264_qsv -b:v 4000k -acodec aac -f mpegts -
@REM ffmpeg -v panic -re -i http://172.16.3.60/1.ts -codec copy -f mpegts -
@REM curl -s http://172.16.3.60/1.ts
adb -s %device% shell sleep 5

adb -s %device% shell sleep 1; input keyevent 4

:ends

Xfinity Stream

@echo off
goto downarrow
:begin
setlocal
set device=192.168.50.161:5555
SET PATH=%PATH%;C:\platform-tools\

adb connect %device% >NUL
set ret=%errorlevel%
if "%ret%" NEQ "0" (
    echo "error: adb not found"
    goto :ends
)

rem adb -s %device% shell input keyevent 4

set channel=%1

adb -s %device% shell am start -n com.xfinity.cloudtvr.tenfoot/com.xfinity.common.view.LaunchActivity
adb -s %device% shell sleep 1
adb -s %device% shell input keyevent 21;sleep 0;input keyevent 20 20 20 20 20 20 66


if %channel% EQU 807 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,2% 66
if %channel% EQU 851 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,5% 66
if %channel% EQU 853 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,8% 66
if %channel% EQU 855 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,11% 66
if %channel% EQU 858 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,14% 66
if %channel% EQU 876 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,17% 66
if %channel% EQU 878 adb -s %device% shell sleep 4;input keyevent %downarrow:~0,20% 66

curl -s http://192.168.50.236:8000/main1

rem adb -s %device% shell input keyevent 4 4 4 3

rem adb -s %device% shell am start -n com.xfinity.cloudtvr.tenfoot/com.xfinity.common.view.LaunchActivity
adb -s %device% shell sleep 2;input keyevent 4;input keyevent 4;input keyevent 4;input keyevent 3

adb -s %device% shell settings put global window_animation_scale 0
adb -s %device% shell settings put global transition_animation_scale 0
adb -s %device% shell settings put global animator_duration_scale 0
adb -s %device% shell settings put secure sleep_timeout 0
adb -s %device% shell settings put system screen_off_timeout 2147460000

rem adb -s %device% shell disconnect
:ends
exit
rem adb disconnect
:downarrow
set downarrow=20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
goto begin
exit
1 Like
1 Like