icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old August 9th, 2007, 3:24 AM   #1 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
Video Streaming

I'm in the process of making a video streaming system where I can specify the file in the URL, and the script will play the file in the DivX player.

I last asked for help in this thread, but feel a more up-to-date thread would help:
Streaming

Basically, I'm doing this in a special way, where...

+ Video is specificed in a variable (stream.php?video=file.avi)
+ stream_file.php will specify location, open, and read the file.
+ The video player on stream.php will play stream_file.php's file.avi

I've tried this, but it seems that it just wants to keep "connecting". this method has worked with WMV files, but I really would like to use .avi files with the DivX player.

Anyone have a solution that may work? Thank you.
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2007, 4:41 AM   #2 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,227 posts
Gave thanks: 18
Thanked 86 times
If you're wanting to use the DivX player, I suspect the extension will need to .divx and the appropriate mime type added through cpanel for it.. whatever that is, and the correct mime type header sent out if using that script in the other thread.

I'll see if I can get something working on my site out of curiousity.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks MarkRH for this great post!
GamingHybrid (August 9th, 2007)
Old August 9th, 2007, 6:18 AM   #3 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,227 posts
Gave thanks: 18
Thanked 86 times
I got a single embedded video to stream. It did not matter if i used a .avi or .divx extension of if I added a video/divx mime type or not.

I did notice that I had to use complete URLs for it to work, relative paths would fail.
I then tried using that php script as the src with video=file.avi and I got the same constant connecting.

So... now I'm like really tired.. lol..

My guess is you'd have make a sort of wrapper script where you sent it the filename and then it would generate the complete embed html code with the URL to the video. Hmmm...
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks MarkRH for this great post!
GamingHybrid (August 9th, 2007)
Old August 9th, 2007, 6:18 AM   #4 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
Quote:
Originally Posted by MarkRH View Post
If you're wanting to use the DivX player, I suspect the extension will need to .divx and the appropriate mime type added through cpanel for it.. whatever that is, and the correct mime type header sent out if using that script in the other thread.

I'll see if I can get something working on my site out of curiousity.
Actually, the player supports .divx or .avi

A test can be found here (warning, I used my only avi available at the time, a World of Warcraft trailer :O)

Basically I'm trying to have a file specified in a .php document to be played in the player (aka, making the player's src that .php document). This is so that no one can download/leech (mainly download) that video... as I'm setting up a permission system for that...

So, something along the lines of having the .php do a fopen() or so, the file I want ot be played, and then src-ing that .php in the embed (and param) code of the player.

Yet so far it doesnt work Just gets stuck on loading...

(Also, it seems that the src needs to have a .divx or .avi extension or the play wont bother trying at all! So I did a variable thing, basically file.php?video=file.avi)
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2007, 6:19 AM   #5 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
Oh, and the link given is a hard coded thing, not sourced to the .php file.... as it doesnt work yet :P

I just set that up to test the player. It pwns, but it's tweaking doesnt.
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2007, 6:21 AM   #6 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
And you already replied lol.

Actually, that makes sense then! I'll try to modify my code with a url. Too bad I can'tlocate the files outside the /public_html/, but since even that is "hidden" with php, I don't think it matters if I use my domain then, hehe.
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2007, 7:53 PM   #7 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
Here is what I've been trying to use...

stream.php - where the video player is:
PHP Code:
<html>
<html>
<head>
<title>Viewing <?=$_GET['vid']?></title>
</head>
<body>
<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="425" height="350" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="Stage6" />

  <param name="bufferingMode" value="null" />
  <param name="allowContextMenu" value="false" />
  <param name="src" value="stream_file.php?vid=<?=$_GET['vid']?>" />

<embed src="stream_file.php?vid=<?=$_GET['vid']?>" custommode="Stage6" width="425" height="350" bufferingMode="null"  allowContextMenu="false"  pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
<br>No video? Get the DivX Web Player for <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayerInstaller.exe">Windows</a> or <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayer.dmg">Mac</a>
</body>
</html>
And then, stream_file.php, is coded with:
Code:
<?PHP

$video = "/videos/".$_GET["vid"];

header("Content-Type: video/x-msvideo"); //that is an avi video
readfile($video); 

?>
As you see, very simple, but it doesnt seem to want to operate. The player just keeps "connecting". as seen here: http://www.gaminghybrid.com/stream.php?vid=ssbb.divx

http://www.gaminghybrid.com/videos/ as you can see, the file is in there, but the player just doesn't want to play.

Same issue with an .avi file. Just keeps "connecting"...

(I know the script isn't secured yet, but it is still in alpha for functionality first)
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2007, 9:10 PM   #8 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,227 posts
Gave thanks: 18
Thanked 86 times
Basically running into the same problem. stream.php may work by changing it to:
PHP Code:
<html>
<html>
<head>
<title>Viewing <?=$_GET['vid']?></title>
</head>
<body>
<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="425" height="350" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="Stage6" />

  <param name="bufferingMode" value="null" />
  <param name="allowContextMenu" value="false" />
  <param name="src" value="http://www.gaminghybrid.com/videos/<?=$_GET['vid']?>" />

<embed src="http://www.gaminghybrid.com/videos/<?=$_GET['vid']?>" custommode="Stage6" width="425" height="350" bufferingMode="null"  allowContextMenu="false"  pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
<br>No video? Get the DivX Web Player for <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayerInstaller.exe">Windows</a> or <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayer.dmg">Mac</a>
</body>
</html>
I think to make happen what you want to happen, some mod_rewrite wizardy would have to be done... sort of like this being the url to an image in my gallery:
Code:
http://gallery.markheadrick.com/d/683-2/turtle_02aug2007.jpg
which is actually being sent out by a php script since the images are above /public_html/

Wonder if I can use my gallery as an example to figure something out... hrmmm.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks MarkRH for this great post!
GamingHybrid (August 10th, 2007)
Old August 9th, 2007, 10:37 PM   #9 (permalink)
Bow before Surpass!
Super #1
 
Joined in Sep 2004
1,547 posts
Gave thanks: 91
Thanked 49 times
the issue I'm facing is possibly that the server is confused about the file type...

I'm going to try a .htaccess trick, hopefully what I'm looking for will work...
__________________
GamingHybrid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On