My powervu linux streaming setup.

joeuser

Registered
Messages
199
Tested on a (Debian Wheezy 64bit) Linux PC with an old Skystar2 (DVB-S only) pci card. I assume you have a working card/usb tuner and a basic build environment already setup. Or, if you don't want to build your own, you can try the attached binaries.

MuMuDVB is a streaming server which can stream via multicast and/or unicast (http). I disable the multicast and use just the http streaming. It uses the default port of 4242 to listen for connections. The feature I use is a url with the sid of the channel you want to watch. (e.g. http://127.0.0.1:4242/bysid/2) So, I have made a patch for oscam-emu/OSEmu to translate the usual powervu stream relay http request url (e.g. http://192.168.1.12:17999/1:0:1:2:1:9:5A0000:0:0:0:) which is made to osemu's stream relay to the "bysid" format. So the basic path is from stb/vlc/(any video stream client) via http to OSEmu port 17999, which then does an http connection to MuMuDVB for the desired sid which then streams back the channel (including ecm pid) to OSEmu which decrypts the stream and sends it to the requesting client. Since I am using this mostly with the AFN channels on 9E, I also made a patch to allow multiple clients to connect at the same time to the same or different channels. (Made possible by the fact that all the channels are on the same transponder.) It is also useful for the 4W HBO package...

Here is a basic howto.

1. Download OSEmu

Code:
git clone https://github.com/oscam-emu/OSEmu.git

Basic instructions for building/use are here: https://github.com/oscam-emu/OSEmu


(or optionally you can use oscam-svn with oscam_emu patch)


3. Add the following changes to request correct channel by sid from MuMuDVB: (tested with both oscam_emu and OSEMU...)

Code:
--- a/module-emulator-stream.c  2015-08-21 02:56:39.752592000 +0200
+++ b/module-emulator-stream.c  2015-08-21 02:59:46.387344000 +0200
@@ -521,7 +521,7 @@
        }
 }

-static int32_t connect_to_stream(char *http_buf, int32_t http_buf_len, char *stream_path)
+static int32_t connect_to_stream(char *http_buf, int32_t http_buf_len, int srvid )
 {
        struct sockaddr_in cservaddr;
        IN_ADDR_T in_addr;
@@ -549,20 +549,20 @@
                { return -1; }
        if(emu_stream_source_auth)
        {
-               snprintf(http_buf, http_buf_len, "GET %s HTTP/1.1\nHost: %s:%u\n"
+               snprintf(http_buf, http_buf_len, "GET /bysid/%i HTTP/1.1\nHost: %s:%u\n"
                                "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\n"
                                "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n"
                                "Accept-Language: en-US\n"
                                "Authorization: Basic %s\n"
-                               "Connection: keep-alive\n\n", stream_path, emu_stream_source_host, emu_stream_source_port, emu_stream_source_auth);
+                               "Connection: keep-alive\r\n\r\n", srvid, emu_stream_source_host, emu_stream_source_port, emu_stream_source_auth);
        }
        else
        {
-               snprintf(http_buf, http_buf_len, "GET %s HTTP/1.1\nHost: %s:%u\n"
+               snprintf(http_buf, http_buf_len, "GET /bysid/%i HTTP/1.1\nHost: %s:%u\n"
                                "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\n"
                                "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n"
                                "Accept-Language: en-US\n"
-                               "Connection: keep-alive\n\n", stream_path, emu_stream_source_host, emu_stream_source_port);
+                               "Connection: keep-alive\r\n\r\n", srvid, emu_stream_source_host, emu_stream_source_port);
        }

        if(send(streamfd, http_buf, strlen(http_buf), 0) == -1)
@@ -715,7 +715,7 @@

        while(!exit_oscam && clientStatus != -1 && streamConnectErrorCount < 3  && streamDataErrorCount < 15)
        {
-               streamfd = connect_to_stream(http_buf, 1024, stream_path);
+               streamfd = connect_to_stream(http_buf, 1024, data->srvid);
                if(streamfd == -1)
                {
                        cs_log("[Emu] warning: cannot connect to stream source");


4. Command-line for OSEMU
Code:
./OSEmu -v -a user:pass -p1234 -s 127.0.0.1 -r 4242:17999

5. Install MuMuDVB
(I have tested with version 1.7.1 installed with "apt-get install mumudvb" on Debian, and also built/tested 1.7.3 and 2.0. All work ok, but beware that some of the config options are slightly different between versions....)
https://github.com/braice/MuMuDVB

6. Example configuration file for MuMuDVB. Default is for adapter0, you may need to change to reflect your hardware.
http://www.mumudvb.net/doc/mumudvb-2.0.0/README_CONF.html
Code:
freq=11804
pol=v
srate=27500
unicast=1
#multicast=0
multicast_ipv4=0
multicast_ipv6=0
rewrite_sdt=1
rewrite_pat=1
sap=0
#autoconfiguration=full
#autoconf_unicast_start_port=1001
#autoconf_scrambled=1
dvr_buffer_size=40

channel_next
name=Sports
service_id=1
pids= 1160 1120 1122 1130 1132 1064 5001 6001 500 92

channel_next
name=Atlantic
service_id=2
pids= 1260 1220 1722 1330 1232 1064 1061 7018 7025 7023 5002 6002 500 92

channel_next
name=Spectrum
service_id=3
pids= 1360 1320 1322 1130 1322 1132 1332 5003 6003 500 92

channel_next
name=Pacific
service_id=4
pids= 1460 1420 1422 1030 1830 5004 6004 500 92

channel_next
name=News
service_id=5
pids= 1560 1520 1522 1530 1532 5005 6005 500 92

channel_next
name=Sports2
service_id=6
pids= 1660 1620 1930 1630 1032 1064 5006 6006 500 92

channel_next
name=Guide
service_id=7
pids= 1760 1332 1722 1730 1732 1064 5007 6007 500 92

channel_next
name=Fam/Pulse
service_id=9
pids= 1960 1920 1222 1822 1832 1064 5009 6009 500 92

channel_next
name=Movie
service_id=10
pids= 1060 1020 1822 1230 1432 1064 5010 6010 500 92

channel_next
name=HD SPORTS
service_id=11
pids= 1410 1400 5011 6011 500 92

7. I made some patches for MuMuDVB to enable autconfigure to find and add the ECM pids. Here are the patches, or you can use the included binary....
Code:
diff -Naurx '.*' -x Makefile MuMuDVB/src/autoconf_pmt.c MuMuDVB.my/src/autoconf_pmt.c
--- MuMuDVB/src/autoconf_pmt.c  2015-07-27 13:56:33.364435803 +0200
+++ MuMuDVB.my/src/autoconf_pmt.c       2015-07-27 04:41:18.820723051 +0200
@@ -71,6 +71,34 @@
        char language[4]="";
        int pos=0;

+       //For CAM debugging purposes, we look if we can find a CA descriptor to display CA system IDs
+       //Also find ECM pid...
+       while(pmt_find_descriptor(0x09,pmt->data_full+PMT_LEN,PMT_LEN+program_info_length,&pos))
+       {
+               descr_ca_t *ca_descriptor;
+               ca_descriptor=(descr_ca_t *)(pmt->data_full+PMT_LEN+pos);
+               pid=HILO(ca_descriptor->CA_PID);
+               pid_type=PID_ECM;
+               log_message( log_module,  MSG_DEBUG,"  ECM \tPID %d\n",pid);
+               pids[*num_pids]=pid;
+               pids_type[*num_pids]=pid_type;
+               snprintf(temp_pids_language[*num_pids],4,"%s",language);
+               (*num_pids)++;
+
+               int casysid = 0;
+               while(casysid<32 && ca_sys_id[casysid] && ca_sys_id[casysid]!=HILO(ca_descriptor->CA_type) )
+                       casysid++;
+               if(casysid<32 && !ca_sys_id[casysid])
+               {
+                       ca_sys_id[casysid]=HILO(ca_descriptor->CA_type);
+                       log_message( log_module,  MSG_DETAIL,"CA system id 0x%04x : %s\n", HILO(ca_descriptor->CA_type), ca_sys_id_to_str(HILO(ca_descriptor->CA_type)));//we display it with the description
+               }
+               if(casysid==32)
+                       log_message( log_module,  MSG_WARN,"Too much CA system id line %d file %s\n", __LINE__,__FILE__);
+               pos+=ca_descriptor->descriptor_length+2;
+       }
+
+       pos=0;
        //we read the different descriptors included in the pmt
        //for more information see ITU-T Rec. H.222.0 | ISO/IEC 13818 table 2-34
        for (int i=program_info_length+PMT_LEN; i<=section_len-(PMT_INFO_LEN+4); i+=descr_section_len+PMT_INFO_LEN)
@@ -131,8 +159,6 @@
                        log_message( log_module,  MSG_DEBUG,"  Audio ATSC A/53B \tPID %d\n",pid);
                        break;

-
-
                case 0x06: /* Descriptor defined in EN 300 468 */
                        if(descr_section_len) //If we have an accociated descriptor, we'll search inforation in it
                        {
@@ -253,30 +279,6 @@
                }
                log_message( log_module,  MSG_DEBUG,"  PID Language Code = %s\n",language);

-               //For CAM debugging purposes, we look if we can find a CA descriptor to display CA system IDs
-               if(descr_section_len)
-               {
-                       int pos;
-                       int casysid;
-                       pos=0;
-                       while(pmt_find_descriptor(0x09,pmt->data_full+i+PMT_INFO_LEN,descr_section_len,&pos))
-                       {
-                               descr_ca_t *ca_descriptor;
-                               ca_descriptor=(descr_ca_t *)(pmt->data_full+i+PMT_INFO_LEN+pos);
-                               casysid=0;
-                               while(casysid<32 && ca_sys_id[casysid] && ca_sys_id[casysid]!=HILO(ca_descriptor->CA_type) )
-                                       casysid++;
-                               if(casysid<32 && !ca_sys_id[casysid])
-                               {
-                                       ca_sys_id[casysid]=HILO(ca_descriptor->CA_type);
-                                       log_message( log_module,  MSG_DETAIL,"CA system id 0x%04x : %s\n", HILO(ca_descriptor->CA_type), ca_sys_id_to_str(HILO(ca_descriptor->CA_type)));//we display it with the description
-                               }
-                               if(casysid==32)
-                                       log_message( log_module,  MSG_WARN,"Too much CA system id line %d file %s\n", __LINE__,__FILE__);
-                               pos+=ca_descriptor->descriptor_length+2;
-                       }
-               }
-

                pids[*num_pids]=pid;
                pids_type[*num_pids]=pid_type;
diff -Naurx '.*' -x Makefile MuMuDVB/src/log.c MuMuDVB.my/src/log.c
--- MuMuDVB/src/log.c   2015-07-27 13:56:33.368435802 +0200
+++ MuMuDVB.my/src/log.c        2015-07-26 14:59:31.885148189 +0200
@@ -824,6 +824,8 @@
                return "Teletext";
        case PID_EXTRA_SUBTITLE:
                return "Subtitling";
+       case PID_ECM:
+               return "ECM";
        case PID_UNKNOW:
        default:
                return "Unknown";
diff -Naurx '.*' -x Makefile MuMuDVB/src/mumudvb.h MuMuDVB.my/src/mumudvb.h
--- MuMuDVB/src/mumudvb.h       2015-07-27 13:56:33.368435802 +0200
+++ MuMuDVB.my/src/mumudvb.h    2015-07-26 14:57:19.761149329 +0200
@@ -184,7 +184,8 @@
        PID_EXTRA_VBIDATA,
        PID_EXTRA_VBITELETEXT,
        PID_EXTRA_TELETEXT,
-       PID_EXTRA_SUBTITLE
+       PID_EXTRA_SUBTITLE,
+       PID_ECM
 };

 /**@brief file descriptors*/

8. Example configuration file for MuMuDVB with autoconfiguration
Code:
freq=10935
pol=H
srate=13750
coderate=5/6
unicast=1
#multicast=0
multicast_ipv4=0
multicast_ipv6=0
multicast_ttl=0
rewrite_sdt=1
rewrite_pat=1
sap=0
autoconfiguration=full
autoconf_scrambled=1
dvr_buffer_size=100
dvr_thread=0

#new_channel
#name=ALL
#service_id=111
#pids=8192

9. Some example playlists and user bouquet files.
VLC playlist:
Code:
#EXTM3U
#EXTINF:0,HBO Hungary
http://192.168.1.10:17999/1:0:1:2:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO Hungary Original Audio
http://192.168.1.10:17999/1:0:1:14:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO Comedy Hungary
http://192.168.1.10:17999/1:0:1:2A:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO Comedy International
http://192.168.1.10:17999/1:0:1:31:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO Comedy Hungary/Czech
http://192.168.1.10:17999/1:0:1:33:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO Hungary (AC3)
http://192.168.1.10:17999/1:0:1:34:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO2 Hungary
http://192.168.1.10:17999/1:0:1:C9:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO2 Czech
http://192.168.1.10:17999/1:0:1:CA:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO2 OrigHu
http://192.168.1.10:17999/1:0:1:CB:1:1:DE82AB7:0:0:0:
#EXTINF:0,HBO2 for DTH
http://192.168.1.10:17999/1:0:1:CC:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax International
http://192.168.1.10:17999/1:0:1:E6:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax Hungary
http://192.168.1.10:17999/1:0:1:E7:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax Poland
http://192.168.1.10:17999/1:0:1:E9:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax International 2
http://192.168.1.10:17999/1:0:1:EC:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax 2 Hungary
http://192.168.1.10:17999/1:0:1:F1:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax 2 Poland
http://192.168.1.10:17999/1:0:1:F3:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax 2 International
http://192.168.1.10:17999/1:0:1:F6:1:1:DE82AB7:0:0:0:
#EXTINF:0,Cinemax 2 Hungary/Czech
http://192.168.1.10:17999/1:0:1:FB:1:1:DE82AB7:0:0:0:
userbouquet.HBO.tv
Code:
#NAME HBO
#SERVICE 1:0:1:5:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a2%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Hungary
#DESCRIPTION HBO Hungary
#SERVICE 1:0:1:7:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a14%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Hungary Original Audio
#DESCRIPTION HBO Hungary Original Audio
#SERVICE 1:0:1:9:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a2A%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Comedy Hungary
#DESCRIPTION HBO Comedy Hungary
#SERVICE 1:0:1:11:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a31%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Comedy International
#DESCRIPTION HBO Comedy International
#SERVICE 1:0:1:13:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a33%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Comedy Hungary/Czech
#DESCRIPTION HBO Comedy Hungary/Czech
#SERVICE 1:0:1:15:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3a34%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO Hungary (AC3)
#DESCRIPTION HBO Hungary (AC3)
#SERVICE 1:0:1:17:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aC9%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO2 Hungary
#DESCRIPTION HBO2 Hungary
#SERVICE 1:0:1:19:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aCA%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO2 Czech
#DESCRIPTION HBO2 Czech
#SERVICE 1:0:1:21:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aCB%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO2 OrigHu
#DESCRIPTION HBO2 OrigHu
#SERVICE 1:0:1:23:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aCC%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:HBO2 for DTH
#DESCRIPTION HBO2 for DTH
#SERVICE 1:0:1:25:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aE6%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax International
#DESCRIPTION Cinemax International
#SERVICE 1:0:1:27:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aE7%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax Hungary
#DESCRIPTION Cinemax Hungary
#SERVICE 1:0:1:29:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aE9%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax Poland
#DESCRIPTION Cinemax Poland
#SERVICE 1:0:1:31:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aEC%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax International 2
#DESCRIPTION Cinemax International 2
#SERVICE 1:0:1:33:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aF1%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax 2 Hungary
#DESCRIPTION Cinemax 2 Hungary
#SERVICE 1:0:1:35:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aF3%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax 2 Poland
#DESCRIPTION Cinemax 2 Poland
#SERVICE 1:0:1:37:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aF6%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax 2 International
#DESCRIPTION Cinemax 2 International
#SERVICE 1:0:1:39:0:0:0:0:0:0:http%3a//192.168.1.10%3a17999/1%3a0%3a1%3aFB%3a1%3a1%3aDE82AB7%3a0%3a0%3a0%3a:Cinemax 2 Hungary/Czech
#DESCRIPTION Cinemax 2 Hungary/Czech
#SERVICE 1:0:1:2:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:14:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:2A:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:31:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:33:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:34:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:C9:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:CA:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:CB:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:CC:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:E6:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:E7:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:E9:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:EC:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:F1:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:F3:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:F6:1:1:DE82AB7:0:0:0:^M
#SERVICE 1:0:1:FB:1:1:DE82AB7:0:0:0:^M
10. Included in the attached tar:

OSEmu directory containing latest source code already modified with bysid patch and a 64bit binary.
MuMuDVB directory containing latest source code already modified with ecm pid autoconfig patch and a 64bit binary.
Example playlists and user bouquets.
Start scripts for OSEmu and MuMuDVB with example command line options.

https://mega.nz/#!6VJgQLwC!71w1EbwckMYyCJTfDSnuDnrZaDsOin5CbEFs5QqvQZE
 

cupof

Registered
Messages
143
heres mine
nice and easy

start a powervu channel
example hd sports

start dreambox control center
or putty

telnet


Code:
wget -O "/hdd/movie/hdsports.flv" http://192.168.1.5:8001/1:0:1:B:B:16:21:0:0:0:http://127.0.0.1:17999/1:0:1:B:1:9:5A0000:0:0:0:

that is now saving to /hdd/movie

open webif via browser

select movies
stream your file via small tv icon far right

stream opens in vlc
works on any device

Code:
http://192.168.1.5:80/file?file=/hdd/movie/hdsports.flv
 
Last edited:

joeuser

Registered
Messages
199
Please explain in more detail how you can stream 5 channels at the same time with your method?
 

joeuser

Registered
Messages
199
I forgot to add that since osemu now supports multiple clients, you can watch/record all channels on the same transponder at the same time - including the same channel on multiple devices at the same time. the Only limit is your cpu and network bandwidth....
 
Top