Project

General

Profile

HowTO: TVHeadend with PowerVU

Added by B C almost 6 years ago

Prerequisites

  • build OSEmu from the tvheadend branche in my repository: https://github.com/L-S-D/OSEmu/tree/tvheadend
  • start OSEmu like this: ./OSEmu -a user:pass -p1234 -s tvheadendhostip -r 9981 17999 -c /path/to/PowerVU_keyfile -b
  • create a PowerVU streaming profile with mpeg-ts passthrough and enable PAT and SDT rewrite
  • create a PowerVU user with PW PowerVU (or whatever) with PowerVU as streaming profile
  • use this script to generate an m3u file for iptv automux creration:
#!/bin/bash
# you must have installed jq (apt-get install jq) 

############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts"                                 
OSEmu="osemuipaddress:17999" 
profile="PowerVU"     
userpass="PowerVU:PowerVU"           
###############  END CONFIG  ###################

echo \#EXTM3U
grep -rnwl $tvh_data_path'/tvheadend/input/dvb/networks' -e '\"caid\": 3584' | while read  -r services      
do
    enabled=$(/usr/bin/jq -c  '.enabled'  $services)
    if [ "$enabled" = "true" ]
    then
        echo \#EXTINF:-1, $(/usr/bin/jq -c -r '.networkname' ${services:0:-81}/config)/$(/usr/bin/jq -c -r '.frequency/1000' ${services:0:-42}/config)$(/usr/bin/jq -c -r '.polarisation' ${services:0:-42}/config)/$(/usr/bin/jq -c -r  '.svcname'  $services)
        echo http://[email protected]$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1
    fi
done  

for testing you might strip down the generated m3u just to one channel of interest at the beginnning

  • add an IPTV Automatic Network to tvh (v627 or later), enable Skip Initial Scan, Maximum Input Streams: 1 and set URL to file:///path/filename.m3u

If all succeeded you should have a single channel on each mux automatically created after initial scanning which can be played and added to channels just like any other service. Don't use the service on sat directly as this won't play. start ./OSEmu with -v instead of -b to see some log output which should be like this:

[Emu] stream client connected
[Emu] stream client request /stream/service/f185b1ebb025ce2a32aee936f9e161be?profile=PowerVU&descramble=0&emm=1
[Emu] stream found pmt pid: 15F7 for sid 26F
[Emu] stream found ecm_pid: 19DF
[Emu] stream found video pid: CBC
[Emu] stream found audio pid: CC6
[Emu] stream found audio pid: C94
[Emu] stream found audio pid: C96

Have fun
LSD


Replies (43)

RE: HowTO: TVHeadend with PowerVU - Added by faisaly 1932 over 5 years ago

ok now something work and blank screen

[Emu] stream client request /stream/service/6e5b40d1fba197a9db6ba688a33dbca3?profile=PowerVU&descramble=0&emm=1:0:0:1
[Emu] stream found pmt pid: 1389
[Emu] stream found video pid: 488
[Emu] stream found audio pid: 460
[Emu] stream found audio pid: 462
[Emu] stream found audio pid: 46A
[Emu] stream found audio pid: 46C
[Emu] stream client disconnected
2015-11-19 00:18:47.968 [   INFO] mpegts: 11804V in 9E - tuning on Conexant CX24123/CX24109 : DVB-S #0
2015-11-19 00:18:48.426 [   INFO] subscription: 0001: "HTTP" subscribing to service "9E/11804V/Sports", weight: 100, adapter: "Conexant CX24123/CX24109 : DVB-S #0", network: "9E", mux: "11804V", profile="PowerVU", hostname="127.0.0.1", client="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0" 
2015-11-19 00:18:48.478 [WARNING] linuxdvb: Unable to provide UNC value.
2015-11-19 00:19:09.698 [   INFO] subscription: 0001: "HTTP" unsubscribing, hostname="127.0.0.1", client="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0" 

may be about ecm_pid ...

RE: HowTO: TVHeadend with PowerVU - Added by faisaly 1932 over 5 years ago

Joe Miller User

After Reconfig Profile everything ok.

thank you so much

RE: HowTO: TVHeadend with PowerVU - Added by p k over 5 years ago

Thanks for the tutorial. I almost got it working. In fact, it works very well with VLC, but when I try to use it in Kodi, it stays in "Testing" status, seems like Kodi thinks that stream is still scrambled and then asks tvheadend to descramble it.

Nov 20 20:53:29 tvheadend tvheadend27793: subscription: 002B: "HTTP" subscribing to service "sat/12345V/FOO", weight: 100, adapter: "Technisat SkyStar USB HD (DVB-S/S2) : DVB-S #0", network: "sat", mux: "12345V", profile="PowerVU", hostname="127.0.0.1", username="PowerVU", client="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0"
Nov 20 20:53:29 tvheadend tvheadend27793: linuxdvb: Technisat SkyStar USB HD (DVB-S/S2) : DVB-S #0 - status GOOD (SIGNAL | CARRIER | VITERBI | SYNC | SIGNAL)
Nov 20 20:53:29 tvheadend tvheadend27793: linuxdvb: Technisat SkyStar USB HD (DVB-S/S2) : DVB-S #0 - locked
Nov 20 20:53:29 tvheadend tvheadend27793: mpegts: 12345V in sat - open PID 0000 (0) [20/0x2006058]
Nov 20 20:53:29 tvheadend tvheadend27793: mpegts: 12345V in sat - open PID 0001 (1) [16/0x2007478]
Nov 20 20:53:29 tvheadend tvheadend27793: mpegts: 12345V in sat - open PID 0010 (16) [16/0x2008898]
Nov 20 20:53:29 tvheadend tvheadend27793: mpegts: 12345V in sat - open PID 0011 (17) [20/0x2009cb8]
Nov 20 20:53:29 tvheadend tvheadend27793: mpegts: 12345V in sat - open PID 0011 (17) [16/0x200b0d8]
Nov 20 20:53:30 tvheadend tvheadend27793: service: sat/12345V/FOO: Status changed to [Hardware input]
Nov 20 20:53:30 tvheadend tvheadend27793: service: sat/12345V/FOO: Status changed to [Hardware input] [Input on service]
Nov 20 20:53:30 tvheadend tvheadend27793: service: sat/12345V/FOO: Status changed to [Hardware input] [Input on service] [Demuxed packets]
Nov 20 20:53:30 tvheadend tvheadend27793: service: sat/12345V/FOO: Status changed to [Hardware input] [Input on service] [Demuxed packets] [Reassembled packets]
Nov 20 20:53:30 tvheadend tvheadend27793: webui: Start streaming /stream/service/02d1c7cc70fb3dfbbd6ab81dc30d7750?profile=PowerVU&descramble=0&emm=1:0:0:fff
Nov 20 20:53:30 tvheadend tvheadend27793: service: iptv/BAR iptv/FOO: Status changed to [Hardware input]
Nov 20 20:53:30 tvheadend tvheadend27793: service: iptv/BAR iptv/FOO: Status changed to [Hardware input] [Input on service]
Nov 20 20:53:30 tvheadend tvheadend27793: service: iptv/BAR iptv/FOO: Status changed to [Hardware input] [Input on service] [No access]
Nov 20 20:53:30 tvheadend tvheadend27793: service: iptv/BAR iptv/FOO: Status changed to [Hardware input] [Input on service] [No available descrambler] [No access]
Nov 20 20:53:30 tvheadend tvheadend27793: service: iptv/BAR iptv/FOO: Status changed to [Hardware input] [Input on service] [Demuxed packets] [No available descrambler] [No access]

Is there a workaround for that or maybe an ugly patch for tvheadend?
Sometimes I have managed to start the stream even in Kodi, but I cannot reproduce it.

RE: HowTO: TVHeadend with PowerVU - Added by p k over 5 years ago

Thanks, this one works. I tried OSEmu from same repo but from master branch.

RE: HowTO: TVHeadend with PowerVU - Added by Joe User over 5 years ago

So while debugging a bit, I found one problem. While the url generated by the scripts works for decrypting/playing the stream from TVHeadend, it was not sending emm info. Finally I noticed that alhough TVHeadend wasn't complaining (even in debug logs), it did not parse the "emm=1" properly. To get it to work, you need to add another "&" between "emm=1" and the trailing sid info for oscam. (":0:0:4")

So to get the emm pids to be sent, the url needs to be changed to something like:

http://pvu:[email protected]:17999/stream/service/5207215882cb76f456a5d65ecfba2124?profile=PowerVU&descramble=0&emm=1&:0:0:4

Here are updated scripts to automatically generate the correct urls.

VLC Playlist:

#!/bin/bash
# you must have installed jq (apt-get install jq)

############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts" 
OSEmu="192.168.1.10:17999" 
profile="PowerVU" 
userpass="pvu:pvu" 
###############  END CONFIG  ###################

echo \#EXTM3U
grep -rnwl $tvh_data_path'/tvheadend/input/dvb/networks' -e '\"caid\": 3584' | while read  -r services
do
    enabled=$(/usr/bin/jq -c  '.enabled'  $services)
    sid_dec=$(/usr/bin/jq -c  '.sid'  $services)
    sid=$(printf '%x' $sid_dec)
    desc=$(/usr/bin/jq -c -r '.networkname' ${services:0:-81}/config)/$(/usr/bin/jq -c -r '.frequency/1000' ${services:0:-42}/config)$(/usr/bin/jq -c -r '.polarisation' ${services:0:-42}/config)/$(/usr/bin/jq -c -r  '.svcname'  $services)
    if [ "$enabled" = "true" ]
    then
        echo \#EXTINF:-1, $desc
        echo http://[email protected]$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1\&:0:0:$sid
    fi
done

Enigma2 userbouquet:

#!/bin/bash
# you must have installed jq (apt-get install jq)

############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts" 
OSEmu="192.168.1.10%3A17999" 
profile="PowerVU" 
userpass="pvu%3Apvu" 
###############  END CONFIG  ###################

echo \#NAME PowerVU Channels
grep -rnwl $tvh_data_path'/tvheadend/input/dvb/networks' -e '\"caid\": 3584' | while read  -r services
do
    enabled=$(/usr/bin/jq -c  '.enabled'  $services)
    sid_dec=$(/usr/bin/jq -c  '.sid'  $services)
    sid=$(printf '%x' $sid_dec)
    desc=$(/usr/bin/jq -c -r '.networkname' ${services:0:-81}/config)/$(/usr/bin/jq -c -r '.frequency/1000' ${services:0:-42}/config)$(/usr/bin/jq -c -r '.polarisation' ${services:0:-42}/config)/$(/usr/bin/jq -c -r  '.svcname'  $services)
    if [ "$enabled" = "true" ]
    then
        echo \#SERVICE 1:0:1:$sid:0:0:0:0:0:0:http%3A//[email protected]$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1\&%3A0%3a0%3A$sid:$desc
        echo \#DESCRIPTION $desc
    fi
done

RE: HowTO: TVHeadend with PowerVU - Added by p k over 5 years ago

faisaly 1932 wrote:

nemal nemal k

try this OSEmu

https://github.com/L-S-D/OSEmu/tree/tvheadend

work with xbmc

After trying OSEmu from that branch a bit longer. It still seems to have issues with tvh and Kodi.
There is a commit "quick fix for getting rid of the ECM stream in the output by changing its pid to null pid so tvh does not think the service is encrypted.", but it seems that tvh still thinks that the service is encrypted, at least according to services tab (tried different version, atm i'm using 4.1-1212).
So, sometimes it works from Kodi, but sometimes not, just gets stuck with buffering message or shows "No input detected" message.
For me it is not very reliable.

RE: HowTO: TVHeadend with PowerVU - Added by D. S. over 5 years ago

Hello All,

I finally got it running!! Jehhaaaw :D
After updating to TVH-4.1 PowerVU is working with OSEmu.
However if using KODI sometimes the tvheadend process dies while zapping,
but for me it's more about testing AFN than using it on a daily basis.

AWESOME :)

RE: HowTO: TVHeadend with PowerVU - Added by mike tacker over 5 years ago

hi D.S.

could you write a how to? I would love to try it my self.
my osemu is serving the keys, but the channels stay dark, in vlc and kodi.
osemu -> oscam -> dvapi -> tvheadend is how i set it up.

thanks
mike

RE: HowTO: TVHeadend with PowerVU - Added by Joe User over 5 years ago

In the first post is the how to. You do not need osemu->oscam->dvapi->tvheadend. Just use a standalone osemu and use the stream relay connection ONLY. If you have the osemu->oscam->dvapi->tvheadend connected, it will try to decrypt the normal way which does not work.

BTW - if you use my scripts (above) to generate URLs, you can use the standard OSEmu. Also, you can try my latest OSEmu which adds fix for detecting AC3 tracks on some channels and AU through the stream relay connection (must include CAT (pid 0x01) and emm pid in stream, which TVHeadend does do...)
https://github.com/joeusercz/OSEmu

RE: HowTO: TVHeadend with PowerVU - Added by james ba about 4 years ago

A year on is this still the best method to have powervu working within tvheadend?

RE: HowTO: TVHeadend with PowerVU - Added by norman staffd about 4 years ago

Sean Micklem wrote:

Just out of curiosity, what part of the world are you in? Reason I ask is because I don't think this would be at all useful in certain areas of the world, such as North America.

Well Micklem

TVheadend is build for educational purposes and any type of solution is welcome to test, powervu is not only for USA in Europe there is a lot TP that work under PowerVu Solution..

RE: HowTO: TVHeadend with PowerVU - Added by Eric Dec over 3 years ago

I am trying powervu on latest tvheadend 4.3-710, latest oscam and emu patch, but Tvheadend crashes.
Is Powervu working for somebody?
According to that post https://tvheadend.org/issues/3360 it should work! (without oscam stream relay)
Thanks in advance.

RE: HowTO: TVHeadend with PowerVU - Added by Jaroslav Kysela over 3 years ago

Create a bug with the crash report if you have any problems.

RE: HowTO: TVHeadend with PowerVU - Added by Eric Dec over 3 years ago

Thanks for the quick answer, but I Never created a bug before!
Do I need to send a log of tvheadend in debug mode (I am not even sure how to do that, I saw an option in the GUI to do that, but it also ask for a subsystem and I am not sure what to enter?).
With crash report you mean the /var/log/syslog of my OS?
Sorry for my ignorance.

(26-43/43)