Sign up here and you can log into the forum!

Freeview: IPTV Live TV Streams

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

Re: IPTV Live TV Streams   

Postby Parnas » Sat May 15, 2010 4:48 am

absorber123 wrote:Please help me for how to use "mount -o bind" specific to this case.

For instance:

Code: Select all
mkdir /tmp/umsp_plugins
cp -a /etc/umsp/plugins/*.php /tmp/umsp_plugins
mount -o bind /tmp/umsp_plugins /etc/umsp/plugins

Then, /etc/umsp/plugins magically becomes writable, as it's now a synonym for /tmp/umsp_plugins, and you can install your own plugins there.
Just remember that /tmp is a temporary area whose contents are not kept across reboots. So, if you're putting your own scripts therein, remember to keep a backup copy in a permanent storage area. 8-)

You have to execute these commands after each reboot, so you may want to put them in a shell script for easiness of use.
Parnas
n00b
 
Posts: 16
Joined: Thu Apr 22, 2010 3:25 pm
Location: Como (Italy)

Re: IPTV Live TV Streams   

Postby mmikel » Sat May 15, 2010 10:37 pm

After some experimetns, I was made some changes to original freeview proxy plugin

# cat http-stream.php
Code: Select all
<?php

function _pluginMain($prmQuery) {
  $items = _pluginCreateChannelList();
  return $items;
}

function _pluginCreateChannelList() {
  $videoItems = array (
     'EuroSport' => 'http://.............:3000/TS/S36.0E-112-5-20506.ts', //<- channel from my first VDR server
     'RBK' => 'http://localhost:4080/udp/225.50.64.1:1234', //<- UDP multicast from my LAN, converted to http stream by udpxy
     'EuroNews'  => 'http://.........:3000/TS/S36.0E-112-6-20611', //<- channel from my second VDR server
     'Premiere'  => 'http://localhost:4080/udp/225.50.65.8:1234', //<- another UDP multicast from my LAN, converted to http stream by udpxy
  );

  foreach ($videoItems as $name => $url) {
    $url_data = array('itemurl' => $url);
    $url_data_string = http_build_query($url_data);

    $retMediaItems[] = array (
      'id' => 'umsp://plugins/http-stream?' . $url,
      'dc:title' => $name,
      'upnp:class' => 'object.item.videoitem',
      'res' => 'http://127.0.0.1/umsp/plugins/http-stream-proxy.php?'.$url_data_string,
      'protocolInfo' => 'http-get:*:*:*',
    );
  }
  return $retMediaItems;
}

?>


after adding content-len & content-size headers channels starts showing a much faster

# cat http-stream-proxy.php
Code: Select all
<?php

$rawURL = $_GET['itemurl'];
$parsedURL = parse_url($rawURL);
$itemHost = $parsedURL['host'];
$itemPath = $parsedURL['path'];
$itemPort = $parsedURL['port'];

_http_streamGet($itemHost, ($itemPath ? $itemPath : "/"), ($itemPort ? $itemPort : 80));

function _http_streamGet($prmHost, $prmPath, $prmPort) {
   # print "host: ".$prmHost."\n";
   # print "port: ".$prmPort."\n";
   # print "path: ".$prmPath."\n";
   
   $fp = fsockopen($prmHost, $prmPort, $errno, $errstr, 30);
   if (!$fp) {
      echo "$errstr ($errno)<br />\n";
   } else {
      $out  = "GET ". $prmPath ." HTTP/1.1" ."\r\n";
      $out .= "User-Agent: Wget/1.12 (elf)" ."\r\n";
      $out .= "Host: " . $prmHost . "\r\n";
      $out .= "Cache-Control: no-cache" ."\r\n";
      $out .= "Connection: Close"."\r\n"."\r\n";
      fwrite($fp, $out);     
      $headerpassed = false;
      while ($headerpassed == false) {
         $line = fgets($fp);
         list($tag, $value) = explode(": ", $line, 2);
         
         if (stristr($tag, 'Location')) {
            $target_url = trim($value);
            $url_data_string = http_build_query(array('itemurl' => $target_url));
            header("Location: http://127.0.0.1/umsp/plugins/http-stream-proxy.php?".$url_data_string);
            continue;
         }
         if (trim($line) == "") {
            $headerpassed = true;
            header("Content-Type: video/mpeg");
            header("Content-Size: 65535");
            header("Content-Length: 65535");
         }
         header($line);
      }
      fpassthru($fp);
      fclose($fp);
   }
}

?>


+ with udpxy program ( http://depositfiles.com/files/tdr1i86oh ) I can watch multicast channels from my LAN

# cat S65updxy
Code: Select all
#!/bin/sh

case "$1" in
  start)
    /bin/udpxy -p 4080

    ;;

  stop)
    killall udpxy
   
    ;;

esac



Unfortunately I cant find a method to disable "start\continue" dialog before every channel ((
mmikel
n00b
 
Posts: 8
Joined: Thu May 13, 2010 7:59 pm

Re: IPTV Live TV Streams   

Postby skyball » Sun May 16, 2010 2:32 pm

Hi mmikel,

I also implemented a plugin for watching live TV from VDR on the wdtv live. You can find my thread here: http://forum.wdlxtv.com/viewtopic.php?f=49&t=517. My plugin includes a channel parser, that shows all channels from your VDR on the wdtv...

BTW, thanks for your proxy code with the faster rendering startup. I adapted my proxy to your method.

Greetings, skyball
skyball
Beta Tester
 
Posts: 13
Joined: Fri Apr 16, 2010 2:42 am

Re: IPTV Live TV Streams   

Postby g_krassa » Mon May 17, 2010 8:59 pm

Hi Parnas

I cant seem to get your freeview plugin to work. Basically I copied the freeview.php (all the channels show up as folders ) and also copied the freeview-proxy.php to the umsp/plugin folder. I am using the latest EXT firmware from brad (4.2). The video never show up and from a black screen it goes back to the folder view after about 3 seconds from when I press the play button. I also tried to use the update proxy made by mmikel and still not able to get any video playback.

I hope you can give me a hand on this one. Thanks
g_krassa
n00b
 
Posts: 8
Joined: Fri Apr 16, 2010 4:04 pm

Re: IPTV Live TV Streams   

Postby monsieur » Mon May 17, 2010 10:29 pm

I am also facing the same problems as g_krassa. I do get the list of channels but cannot play any of them. Upon trying to play any of the channels (BBC, Discovery, FashionTV, etc etc), I get a blank screen and then it returns to the channel list. Is there any way to debug this on my end? (Look for some message log somewhere). I was successfully able to play the streams using VLC player.

Appreciate your effort and all the help.
monsieur
n00b
 
Posts: 3
Joined: Mon May 17, 2010 10:17 pm

Re: IPTV Live TV Streams   

Postby Parnas » Fri May 21, 2010 12:38 pm

g_krassa wrote:I hope you can give me a hand on this one. Thanks

Hi guys!

If you can't get any channel to play, despite the URL be working in VLC on a desktop PC, as a first debugging step I would check out the php error log in /tmp/php5 for related information.
Parnas
n00b
 
Posts: 16
Joined: Thu Apr 22, 2010 3:25 pm
Location: Como (Italy)

Re: IPTV Live TV Streams   

Postby arpanet420 » Sun May 23, 2010 4:08 am

hi! I'm also having the same problem as g_krassa and monsieur, my php5 error log says this:

Code: Select all
[01-Jan-2000 00:23:00] PHP Fatal error:  Call to undefined function _pluginMain() in /etc/umsp/control-reply.php on line 108
[01-Jan-2000 00:23:04] PHP Fatal error:  Call to undefined function _pluginMain() in /etc/umsp/control-reply.php on line 108
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44
[01-Jan-2000 00:25:57] PHP Warning:  Cannot modify header information - headers already sent by (output started at /etc/umsp/plugins/freeview-proxy.php:1) in /etc/umsp/plugins/freeview-proxy.php on line 44


No idea what it means, I'm in way over my head trying this :)
anyway, interesting project, thanks!
arpanet420
n00b
 
Posts: 3
Joined: Sun May 23, 2010 4:03 am

Re: IPTV Live TV Streams   

Postby zoster » Sun May 23, 2010 7:28 am

The first error means that the plugin file is missing or has the wrong name.
The second error means that there already was some kind of output (probably an error msg) and that the HTTP headers can't be set anymore.
zoster
WDLXTV Team
 
Posts: 218
Joined: Wed Apr 14, 2010 10:14 am

Re: IPTV Live TV Streams   

Postby ls819011 » Mon May 24, 2010 8:02 am

I was getting "Can not modify header information" error when my .php files were encoded in UTF-8.
ls819011
n00b
 
Posts: 4
Joined: Mon May 03, 2010 10:36 am
Location: Russia

Re: IPTV Live TV Streams   

Postby arpanet420 » Mon May 24, 2010 9:30 am

Whats the "right" encoding? I've tried ISO-8859-1 and WINDOWS-1252 and it still gives me the "Can not modify header information" sorted the " PHP Fatal error" though, thanks zoster!
arpanet420
n00b
 
Posts: 3
Joined: Sun May 23, 2010 4:03 am

PreviousNext

Return to UMSP Plugins

Who is online

Users browsing this forum: davron94 and 1 guest