Sign up here and you can log into the forum!

Problem with UMSP flv streaming (blank picture on playback)

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby aenbacka » Thu Oct 04, 2012 11:19 am

Hi,

My proxy code is as follows:

Code: Select all
<?php
$pageURL = urldecode($_GET['pageURL']); //video page URL
$format = 'x-flv';

  $cmd = "/usr/local/bin/yle-dl $pageURL -o - | cat -";
  header('Content-Type: video/'.$format.'');
  header('Content-Length: 1073741823'); //some sufficient content length
  header('Content-Disposition: attachment; filename="video.flv"');
  header("Accept-Ranges: bytes");
  header("Connection: close");   
  set_time_limit(0);
  passthru($cmd);
?>


I need to try with ffmpeg again, got the same header response error message from MediaLogic as before removing the space after php tag.
aenbacka
n00b
 
Posts: 17
Joined: Sun Jan 23, 2011 10:48 pm

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby aenbacka » Fri Oct 05, 2012 3:11 am

It is also strange, by processing the flv output from rtmpdump with ffmpeg:

Code: Select all
ffmpeg -i - -vcodec copy -acodec copy -f flv pipe:1 | cat


I get no output at all (but by processing the raw flv output directly from rtmpdump I get picture and sound, but out of sync). Any ideas what could be the reason for this?

The flv output produced by ffmpeg with the above command is of some reason non-seekable (tested with VLC), however the original flv is seekable (from rtmpdump).
aenbacka
n00b
 
Posts: 17
Joined: Sun Jan 23, 2011 10:48 pm

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby Gui » Fri Oct 05, 2012 5:31 am

Try this:

Code: Select all
<?php
$pageURL = urldecode($_GET['pageURL']); //video page URL
$format = 'x-flv';

  header('Content-Type: video/'.$format.'');
  header('Content-Length: 1073741823'); //some sufficient content length
  header('Content-Disposition: attachment; filename="video.flv"');
  header("Accept-Ranges: bytes");
  header("Connection: close");
  $cmd = "ffmpeg -y -i '$pageURL' -vcodec copy -acodec copy -f flv pipe:1"; 
  set_time_limit(0);
  passthru($cmd);
?>
User avatar
Gui
Developer
 
Posts: 161
Joined: Wed Jan 11, 2012 4:19 pm
Location: Hellgarve

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby aenbacka » Fri Oct 05, 2012 6:03 am

Thanks for the post,

However $pageURL contains the url of a web page from which a specialised script (i.e., yle-dl $pageURL -o -) needs to extract the parameters that will be passed to rtmpdump in order to produce the flv output. Ffmpeg will need to take the output produced by rtmpdump .
aenbacka
n00b
 
Posts: 17
Joined: Sun Jan 23, 2011 10:48 pm

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby Gui » Fri Oct 05, 2012 9:05 am

ok then you could try the same with the output produced by rtmpdump.
User avatar
Gui
Developer
 
Posts: 161
Joined: Wed Jan 11, 2012 4:19 pm
Location: Hellgarve

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby aenbacka » Fri Oct 05, 2012 10:42 am

Thanks a lot for your suggestion, now I get both audio and video output in sync! :) Seems to work fine now when i removed the cat stage.
I have noticed that after playing back a few clips (having interrupted the process in the middle) playback seems to systematically fail. I get the following MediaLogic debug output:

Code: Select all
while
timeout
while
timeout
while
timeout
while
timeout
while
timeout
while
timeout
while
timeout
while
timeout
while
NW_Http_ParseResponse 266 http get header timeout
MA_GetServerProperty 714 replace method get with head
(MPAuxiliary.c , 927 )server_type = 0
[ERR:MediaPlayer:MA_HttpPrepareProc:933]get server property failed
[ERR:MediaPlayer:mp_open:376] errNo=-8
SMD_SendMallocCommand enter
SMD_SendCommand 8
SMD_GetCommand 4 8
[ERR:MediaPlayer:mp_open:514]Leave MP_CreateInstance with error
SMD_SendMallocCommand enter
SMD_SendCommand 8
SMD_GetCommand 4 8


(the "while..timeout" part multiple times). Before this playback initiation has worked several times. Could this be due to me interrupting (stopping) the stream before it has processed it completely?
aenbacka
n00b
 
Posts: 17
Joined: Sun Jan 23, 2011 10:48 pm

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby Martor » Fri Oct 05, 2012 10:54 am

Hi aenbacka,

i see in your log something with HEAD not GET, try this at the beginning of your proxy PHP:

Code: Select all
if ( $_SERVER['REQUEST_METHOD'] == 'HEAD' )
   {   
      header('HTTP/1.0 200 OK');
      header('Connection: Close');
      header('Content-Type: video/x-flv');
      return;
   }


I will try what Gui suggested, my still passing only 30seconds of the stream :(
1.02.21_V_WDLXTV.COM_WDLXTV_LIVE-0.5.1.1
Martor
DLX'er
 
Posts: 98
Joined: Sat Apr 10, 2010 9:58 pm
Location: Czech Republic

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby Gui » Fri Oct 05, 2012 11:10 am

Here is an working flv proxy example you may change and adapt to your projects.

Code: Select all
<?php


if ( $_SERVER['REQUEST_METHOD'] == 'HEAD' )
{
   header('HTTP/1.1 200 OK');
   header('Host: media32.justin.tv');
   header('User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0');
   header('Connection: keep-alive');
   header('Cookie: language=en');
   header('Range: bytes=162-');
   header('Content-Type: video/x-flv');
   return;
}

$rawURL = $_GET['itemurl'];

   doTheMiracle($rawURL);


function doTheMiracle($prmUrl)
{
   header('Content-type: video/x-flv');
   header('Content-Disposition: attachment; filename="wdlxtv.flv"');
   if(isset ($_SERVER['CONTENT_LENGTH']))
            header("Content-Length: {$_SERVER['CONTENT_LENGTH']}");
         else
            header('Content-Length: 1073741823');
         // jump to the specific range if the MediaPlayer specifies it (when navigating)
         if(isset ($_SERVER['HTTP_RANGE']))
            header("Range: {$_SERVER['HTTP_RANGE']}");
   header('Cache-control: no-cache');
   header("Accept-Ranges: bytes");
   header('Connection: keep-alive');
   $cmd = "ffmpeg -y -i '$prmUrl' -vcodec copy -acodec copy -f flv pipe:1";
   set_time_limit(0);
   passthru($cmd);
}


?>


Good luck.
User avatar
Gui
Developer
 
Posts: 161
Joined: Wed Jan 11, 2012 4:19 pm
Location: Hellgarve

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby Martor » Fri Oct 05, 2012 11:28 am

Thanks Gui, I will give it a try now ;)
Keep you updated.

Martin
1.02.21_V_WDLXTV.COM_WDLXTV_LIVE-0.5.1.1
Martor
DLX'er
 
Posts: 98
Joined: Sat Apr 10, 2010 9:58 pm
Location: Czech Republic

Re: Problem with UMSP flv streaming (blank picture on playba   

Postby aenbacka » Fri Oct 05, 2012 11:49 am

Thank you Gui and Martor for the examples, very much appreciated. I will make change to my proxy concerning handling of the HEAD request.
aenbacka
n00b
 
Posts: 17
Joined: Sun Jan 23, 2011 10:48 pm

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 0 guests

cron