Jump to content

Image script works on one server, fails on other


roel018

Recommended Posts

Hi all,

 

I have written a script that get's a CGI video stream from my webcam's build-in server (streaming MJPEG content). The script just reads the incoming streaming data and outputs it into an HTML IMG tag. This works great on one server (my developer's server).

 

However, on my online, shared hosting server (where it is supposed to run), it doesn't work - probably due to the fact that the failing server is buffering the incoming data (since phpinfo() tells me output_buffering is set to 4096 - and on the server where it does work on it is set to 0, well, actually it just says 'No value') ..  In fact, it does spit put something (a whole lot of images in a fraction of a second) after it has downloaded the 4 mb of data, but then it starts buffering again.. So what do I do? Do I just mail my shared hosting provider and to set the output_buffering (local or master values? - I don't know the difference) to 0/NoValue ?? Or are there any other things I'm missing here to get this to work?

 

One important other difference between the servers is that the server where it works on runs php version 5 and mine runs version 4.4.8 - Could this pose a problem as well??? (I can activate PHP 5 by request).

 

phpiknfo() results from WORKING server: http://www.emotiontracker.com/test1-results-derek.htm

phpiknfo() results from FAILING server: http://www.emotiontracker.com/test1-results-roel.htm

 

Hope to get some insights into how to approach this problem

 

P.s. it concerns a Windows Server so setting .htaccess is not an option.

 

Thanks in advance!

Roel.

Link to comment
Share on other sites

Well, i could if I used an Apache server, but I'm using Windows Server 2003

 

Here's the code:

<?php
  header('Content-type: multipart/x-mixed-replace;boundary=endofsection');
  print "\n--endofsection\n";

  $pmt = array("-", "\\", "|", "/" );
  for( $i = 0; $i <10; $i ++ ){
      sleep(1);
      print "Content-type: text/plain\n\n";
      print "Part $i\t".$pmt[$i % 4];
      print "--endofsection\n";
      ob_flush();
      flush();
  }
  print "Content-type: text/plain\n\n";
  print "The end\n";
  print "--endofsection--\n";
?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.