Sign up here and you can log into the forum!

sat-top-box (upcoming)

youtube/live365/pandora/flickr replacements & other web services

sat-top-box (upcoming)   

Postby rezmus » Tue Apr 06, 2010 3:39 am

sat-top-box proxy allows you to stream tv over lan from dbox2 or dreambox sat-top-box. post your comments / requests / found bugs here.
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm

Re: sat-top-box (upcoming)   

Postby migube » Wed Apr 14, 2010 12:46 am

I will test with my DM7000 Pli Fw :)
-----
WdTvLive - LG BD390 - Philips 47PFL8404h - Yamaha RXV-667 - DM7000 - Synology 107+ - HP Touchpad (Webos)
migube
Global Moderator
 
Posts: 163
Joined: Thu Apr 08, 2010 7:23 am

Re: sat-top-box (upcoming)   

Postby gra » Wed Apr 14, 2010 5:26 am

Would it be possible to add support to VDR / streamdev?

I'm currently watching Satellite channels (both SD and high definition channels) on WDTV live throught mediatomb as UPNP server and VDR/streamdev as source and it's working (even if changing channels take too much - 30sec), so it should be easy to add...
gra
n00b
 
Posts: 2
Joined: Mon Apr 12, 2010 5:04 am

Re: sat-top-box (upcoming)   

Postby Mattep » Tue Apr 20, 2010 12:59 pm

I would like to test this thing with my DM800HD. When is it ready to test?
Mattep
n00b
 
Posts: 1
Joined: Tue Apr 20, 2010 12:54 pm

Re: sat-top-box (upcoming)   

Postby Toni » Sun Apr 25, 2010 6:12 am

I did some hacking based on the apple-trailers UMSP plugin, and came up with this (code below). It works with my Dreambox DM7025, but there are some problems
  • It takes about 30-45 seconds before the playback starts
  • It also seems to play only for a couple of minutes
  • And of course it is not able to show DVB subtitles

There's a very good Dreambox web interface specification here:
http://dream.reichholf.net/wiki/Enigma2:WebInterface

I was thinking that I could also implement a better interface for recorded movies, now I'm running ushare on the Dreambox itself for streaming recordings. Also the live TV channel selection could be enhanced by utilizing the epg data (like http://dreambox/web/epgnow?bRef=1:0:1:335:9dd0:7e:820000:0:0:0), for showing what is currently running.

I have never coded anything on php before, so this is largely based on copy-paste & Googling & looking at wget output. So please forgive me if there are any stupid coding errors.


... use your favourite method to add the new plugin, I just hardcoded it into /etc/umsp/media-items.php. I'm running the 1.02.21_B-RAD.CC_EXT3-BOOT_LIVE-0.4.2.0 firmware...

/etc/umsp/plugins/dreambox.php
Code: Select all
<?php

function _pluginMain() {

   # Hardcoded Dreambox address
   $dreamboxAddress = 'dm7025';
   
   # Services URL, list all channel from the Favourites bouquet
   $dreamboxServiceUrl = 'web/getservices?sRef=1:7:1:0:0:0:0:0:0:0:FROM%20BOUQUET%20%22userbouquet.favourites.tv%22%20ORDER%20BY%20bouquet';
   
   $reader = new XMLReader();
   $channellistXML = file_get_contents('http://' . $dreamboxAddress . '/' . $dreamboxServiceUrl);
   
   $reader->XML($channellistXML);
   while ($reader->read()) {
      if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'e2service')) {
         #
         # Read channelinfo child nodes until end
         #
         do {
                 $reader->read();
                      if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'e2servicereference')) {
               $newChannel['id']  = $reader->readString();
            }   
                 if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'e2servicename')) {
               $newChannel['title'] = $reader->readString();
                 }
         } while (!(($reader->nodeType == XMLReader::END_ELEMENT) && ($reader->localName == 'e2service')));
         #
         # New channelinfo item parsed. Now add as media item:
         #
      
         $retMediaItems[] = array (
            'id'          => $newChannel['id'],
            'res'         => 'http://localhost/umsp/plugins/dreambox-proxy.php?itemUrl=http://' . $dreamboxAddress . ':8001/' . $newChannel['id'],
            'dc:title'       => $newChannel['title'],
            'upnp:class'      => 'object.item.videoitem',
            'upnp:album_art'   => 'http://localhost/umsp/picons/' . rawurlencode($newChannel['title']) . '.png',
#            'upnp:album_art'   => 'ftp://root:root@' . $dreamboxAddress . '/etc/picon/' . $newChannel['title'] . '.png',
            'protocolInfo'     => 'http-get:*:video/mpeg:*'
         );
      } # end if
   } #end while
   return $retMediaItems;   
} # end function
?>


/etc/umsp/dreambox-proxy.php
Code: Select all
<?php

# itemUrl is like
# itemUrl=http://dm7025:8001/1:0:1:11:1001:20F6:EEEE0000:0:0:0:

$rawURL = $_GET['itemUrl'];
$parsedURL = parse_url($rawURL);

$itemHost = $parsedURL['host'];
$itemPort = $parsedURL['port'];
$itemPath = $parsedURL['path'];

_dreamboxGet($itemHost, $itemPort, $itemPath);

function _dreamboxGet($prmHost, $prmPort, $prmPath) {
   $fp = fsockopen($prmHost, $prmPort, $errno, $errstr);
   if (!$fp) {
      echo "$errstr ($errno)<br />\n";
   } else {
      # Create the HTTP GET request
      
      $out  = "GET $prmPath HTTP/1.0\r\n";
      $out .= "User-Agent: Wget/1.12\r\n";
      $out .= "Accept: */*\r\n";
      $out .= "Host: $prmHost:$prmPort\r\n";
      $out .= "Connection: Keep-Alive\r\n";
      $out .= "\r\n";
   
      fwrite($fp, $out);
      
      # Create HTTP headers for WDTV
      
      header("Connection: Close");
      header("Content-Type: video/mpeg");
      header("Server: stream_enigma2");
      header("Length: unspecified [video/mpeg]");
      
      # Pass thru the DVB transport stream
      
      fpassthru($fp);
      fclose($fp);
   }
}
?>
Toni
Beta Tester
 
Posts: 57
Joined: Sun Apr 25, 2010 5:59 am

Re: sat-top-box (upcoming)   

Postby Toni » Mon Apr 26, 2010 9:34 am

I tried this with VLC player in Windows today, and VLC starts playing the stream through UMSP almost instantaneously. For example, a stream like this works just fine in VLC ('wdtv' is obviously the host name of my WD TV Live box, and 'dm7025' is the dreambox):

http://wdtv/umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:41:2001:20F6:EEEE0000:0:0:0:

Edit: my son tried to watch the Simpsons. It worked, but only for a while. What also makes me curious is the number of lines in the /var/log/lighthttp.log file (I haven't set the time & date on the box yet, it seems :D). If I use VLC, I just get one line in the access.log...

Code: Select all
127.0.0.1 localhost:80 - [02/Jan/2000:22:11:59 +0000] "HEAD /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:31:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 0 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:11:59 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:31:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 8128 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:12:19 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:31:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 10868360 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:12:31 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:31:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 6334360 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:12:32 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:31:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 155504 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:12:38 +0000] "HEAD /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:61:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 0 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:12:38 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:61:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 8128 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:13:03 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:61:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 10786456 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:13:31 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:61:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 10860256 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"
127.0.0.1 localhost:80 - [02/Jan/2000:22:24:17 +0000] "GET /umsp/plugins/dreambox-proxy.php?itemUrl=http://dm7025:8001/1:0:1:61:2001:20F6:EEEE0000:0:0:0: HTTP/1.0" 200 296660329 "-" "INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks"


So for me it seems that it really started to stream at 22:13:31, and streamed 282 megabytes of data before stopping.
Toni
Beta Tester
 
Posts: 57
Joined: Sun Apr 25, 2010 5:59 am

Re: sat-top-box (upcoming)   

Postby rezmus » Tue Apr 27, 2010 10:46 am

upnp client sends 2 x HEAD requests and 1 x GET before real GET that it used to stream data. i don't know about dream, but on db2 streamts server starts for each one of them, it should not happen as it eats cpu/bandwitch resources. u can try to drop these dummy requests in php.

i haven't worked much on it yet, but only stable streaming method for me was tmp file method (start wget and kill it with wdtvext when leaving video_run.xml). still i had to wait 20-30s for good playback, it starts even with less data, but after a few seconds it loose audio, when u wait 20-30s no playback issues.
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm

Re: sat-top-box (upcoming)   

Postby Toni » Tue Apr 27, 2010 9:17 pm

Argh :evil:

What about this thing of aborting the playback after a while? The last 'GET' request transferred 296660329 bytes (282 megabytes) of data. Is there some internal buffering issue with streaming with php & lighthttpd? I searched the wdtv forum, and got the impression there might be such issues...

Anybody interested in figuring out what's wrong with the streaming? I could work on the Dreambox interface, getting the bouquets and recording lists to show up.
Toni
Beta Tester
 
Posts: 57
Joined: Sun Apr 25, 2010 5:59 am

Re: sat-top-box (upcoming)   

Postby rezmus » Wed Apr 28, 2010 4:00 am

i don't remeber having such issue with tmp file streaming method.
rezmus
Developer
 
Posts: 111
Joined: Mon Apr 05, 2010 8:40 pm

Re: sat-top-box (upcoming)   

Postby Toni » Wed Apr 28, 2010 4:03 am

rezmus wrote:i don't remeber having such issue with tmp file streaming method.


But don't you run out of space that way? I mean, the DVB data stream is like 2 gigabytes per hour. How do you trick the player to play a growing file, are you just claiming it's a very large file?
Toni
Beta Tester
 
Posts: 57
Joined: Sun Apr 25, 2010 5:59 am

Next

Return to WDTVL Proxy Project

Who is online

Users browsing this forum: No registered users and 1 guest

cron