Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Blob to Video, Please Help
Old 01-11-2008, 10:18 AM Blob to Video, Please Help
Average Talker

Posts: 21
Trades: 0
All,

I have stored a WMV Video file in a Blob format in a MySQL database.

What I want to do now is to be able to insert a link into a Object class so I can stream the video. You know the embeded Windows Media Players.

Would this be possible?
JamesU2002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-11-2008, 11:43 AM Re: Blob to Video, Please Help
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Yes, Put a link to a file that has a WMV video file header, then echo the information from the database. For example:
PHP Code:
// We'll be outputting a WMV
header('Content-type: application/wmv');

// It will be called downloaded.wmv
header('Content-Disposition: attachment; filename="downloaded.wmv"');

// Now echo the contents
echo "Info from database"
Thats not 100% correct, but a good start
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 01-11-2008 at 11:45 AM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 01-11-2008, 12:27 PM Re: Blob to Video, Please Help
Average Talker

Posts: 21
Trades: 0
Here is what I have so far

PHP Code:
$query "SELECT * FROM video"
$result  mysql_query($query) or die('Error, query failed'); 
$row mysql_fetch_array$result ); 

    
header("Content-Disposition: attachment; filename=$row[videoname]"); 
    
header("Content-length: $row[size]"); 
    
header("Content-type: $row[type]"); 
The row - videoname is the actual file name so i.e. thisismyvideo.wmv
The size row is how big the file size is. The Type stores the type of file the video is so video/x-ms-wmv.

Then finaly there is another row (not mentioned above) called 'content' that is the actual BLOB.

Just confused where I should go next. Should I include the row 'content' (the blob) in the above somewhere?

Because what I need to do is get it so I can stream it via this:

HTML Code:
<OBJECT id="VIDEO" width="320" height="240" 
    style="position:absolute; left:0;top:0;" 
    CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
    type="application/x-oleobject"> 
    <PARAM NAME="URL" VALUE=">URL HERE"> 
    <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> 
    <PARAM NAME="AutoStart" VALUE="True"> 
    <PARAM name="uiMode" value="none"> 
    <PARAM name="PlayCount" value="9999"> 
</OBJECT
JamesU2002 is offline
Reply With Quote
View Public Profile
 
Old 01-11-2008, 12:55 PM Re: Blob to Video, Please Help
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Put a link in that code above where it says "<PARAM NAME="URL" VALUE="URL HERE">
" to a file that runs the #1 code.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 01-11-2008, 01:23 PM Re: Blob to Video, Please Help
Average Talker

Posts: 21
Trades: 0
That won't work because there is no "URL" as such. The video is stored as a BLOB in the MySQL Database. If I echo the BLOB ('content' row) then it just displays lots and lots and lots of numbers and characters.

I'm just not sure how to basicaly convert it back from BLOB into a URL Form so it can be streamed.

Any ideas?
JamesU2002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Blob to Video, Please Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.33555 seconds with 12 queries