Following a really interesting thread on the chattyfig Flashcomm list I have now been able to put together a simple video player which is capable of requesting and playing parts of a flv video file that have not previously been downloaded.
This is a neat feature because it is usually only possible to play and seek to a part of a video that has already been downloaded unless you deploy a streaming media server.
Here's the working example. You need Player 8 for this but that's only because I encoded the video using VP6. The rest is compatible with Player 7.
I have uploaded my progress and included all sources.
It should be noted that due to the support of Buraks it was much easier to implement this idea. A new version of flvmdi injects an object containg two arrays into the flv's metadata. It contains the exact starting position in bytes and timecode of each keyframe. Using this information we can request any part of the flv file starting at a specified keyframe. Check this post for more info on flvmdi - the injection is NEEDED if you want the PHP seeking to work.
Thanks to everyone on the chattyfig list who contributed to this and also to Brian Bailey for blogging about his efforts. Thanks also to Lee Brimelow whose scrubber I have used and modified for this app.
*** UPDATE ***
I have made some small changes now:
- the 'buffering' no longer appears once the video has ended. This was done by simply introducing a new variable 'ending' and checking for a NetStream.Buffer.Flush message.
- loading bar shows the download progress again, although this is not that important as you can seek beyond that point anyway :-). But it will be good to further extend the app so that it will not request the file via PHP once it has loaded completely. We could seek normally once download is complete.
- source files have been updated
- another update (09/2007): updated sources by xmoov.com are now available at
http://flashcomguru.com/downloads/phpstream_update.zip
UPDATE: Steve Savage has now ported this to Coldfusion:
http://www.realitystorm.com/experiments/flash/streamingFLV/index.cfm

This work is licensed under a Creative Commons Attribution 2.0 England & Wales License.

#1 by Patrick Mineault on 11/2/05 - 4:03 PM
#2 by stoem on 11/2/05 - 4:12 PM
I am very excited about Red5. What I like about this approach is its easy implementation. A webserver and PHP - it doesn't get much easier than that.
#3 by sean moran on 11/2/05 - 4:45 PM
Also I noticed that the video doesn't really end well...gets to the end and flashes Buffing Video. Perhaps some simple check to autoRewind or something.
Thanks again!
#4 by Todd Dominey on 11/2/05 - 9:41 PM
#5 by Jake Hilton on 11/2/05 - 9:59 PM
#6 by C. Jason Wilson on 11/3/05 - 4:14 AM
#7 by Ritesh Jariwala on 11/3/05 - 4:52 AM
I had checked your php file. You are reading whole flv file at a time, i think this will become then progressive download. You need to read file from the seek point. I will suggest you to improve your coding in php to read from any given location by clicking on progress bar while playing flv.
#8 by Ritesh Jariwala on 11/3/05 - 4:56 AM
#9 by stoem on 11/3/05 - 9:20 AM
Glad to hear it's useful to you though. Make sure to email me if you improve it. I think Patrick Mineault's suggestion is a good one, once the file has been downloaded completely we should use the cached version and not request the file again.
#10 by freddy on 11/3/05 - 5:33 PM
Also, I think is not possible to replay the video from cache if you skip some part of the video, as the stream changes everytime you change the play position you get only the remaining part and not the full video, is this right?
anyway, good stuff, keep it going ;)
#11 by Kimmy on 11/3/05 - 9:59 PM
I tried to use this method with a huge video (68Mo, 40mn) and the player is freezing when i try to seek.
Do you think it comes from PHP script or actionscript ?
Anyway, very good job, i really like it and would like to enhance the player .
#12 by Burak KALAYCI on 11/4/05 - 12:13 AM
I think for a huge video, the search in the actionscript could get a big performance improvement by using binary search.
Best regards,
Burak
www.asvguy.com
#13 by Ritesh Jariwala on 11/4/05 - 4:12 AM
Post the link of big flv somewhere, i like to test.
#14 by Kimmy on 11/4/05 - 11:37 AM
I think the problem do not come from actionscript as it freezes when i try to seek to the begining of the movie.
The actionscript routine should retrieve the number of the keyframe very quickly in this case so probably it comes from PHP.
I got another question, what should happen if a user try to play a file bigger than the space defined for Temporary Internet Files. Would it crash ?
And one more question : i can't understand why the movie will be downloaded even if you seek to the end of the movie at the begining.
#15 by Kimmy on 11/4/05 - 11:42 AM
Why classic players are not able to read a FLV with keyframe location metadata injected in it ?
Regards
#16 by stoem on 11/4/05 - 11:46 AM
I would also assume that the 'slowness' may come from PHP but I do not know.
Question 2: What do you mean by 'classic players'? The keyframe info can be read by any player which 'listens' for the 2 new arrays. However only flvs injected with flvmdi27b will hold this info.
#17 by Kimmy on 11/4/05 - 1:45 PM
http://www.rich-media-design.com/test/scrubber.htm...
Concerning classic players, i understand that keyframe info can be read by player asking for this metadata. But what i mean is that with 'classic players' (not yours) i can read a FLV file without keyframe info metadata but not FLV file containing these metadata.
Strange as other players do not process such metadata so it should not create an issue.
Regards
#18 by Tom Krcha on 11/4/05 - 4:39 PM
i've tried ... everything works fine,
but I actually dont know how to use Buraks FLVMDI. I dont which metadata should I add to my FLVs.
With golfers.flv everything goes great. With my FLVs it doesnt SEEK.
Please tell me where is the problem
Thanks
Tom
#19 by stoem on 11/4/05 - 4:53 PM
I'll post an article shortly that shows you how it's done.
#20 by Tom Krcha on 11/4/05 - 4:55 PM
Kind regards
tom.krcha.com
#21 by stoem on 11/4/05 - 5:30 PM
#22 by Michal Tatarynowicz on 11/17/05 - 9:11 AM
while (!feof($fh))
{
print (fread($fh, filesize($file)));
}
..are causing the problem. When you fread($handle, $buffer_size), the interpreter allocates $buffer_size bytes for reading. This causes a problem with large files or, to be more specific, files larger than the memory available to the PHP script. Changing the above to this:
while (!feof($fh))
{
print (fread($fh, 10000));
}
Fixes the problem. You can use a much larger buffer (up to little less than your script memomry limit), but please do some performance testing first.
#23 by stoem on 11/19/05 - 1:10 PM
your comments and fix is much appreciated. However I never claimed that this script is anywhere near production ready, it's merely a proof of concept. In fact I don't even know PHP very well so keep that in mind. Anything posted on my site is meant to be for demo purposes only.
Again, thank you very much for your comments.
#24 by mario on 11/21/05 - 1:00 PM
#25 by Kimmy on 11/22/05 - 9:40 AM
Thanks to Michal's new PHP script, we were able to play a huge video using PHP streaming method
(about 90Mo / 40 Min).
Performance seem to be ok when several users try to get the video.
We are looking for a PHP expert that could enhance the script in order to increase performance.
Here is the sample (Flash Player 8 is needed as we used On2 VP6 codec) :
http://www.rich-media-project.com/test4/cool.html
#26 by stoem on 11/22/05 - 11:36 AM
#27 by Fabio on 11/30/05 - 4:25 AM
I'm not an expert in PHP, so. I came here to ask about the path. I'd like to make this video works through the internet. How should I set this path: 'C:/.../clips/'
I tryied 'http://www.myurl.com/videos/' and I put my flv into the folder videos, but is not working.
I'll appreciate your help,
Thanks
Fabio
#28 by stoem on 11/30/05 - 9:13 AM
that path is a local webserver filepath, it cannot be substituted by a URL. It will only work if you have access to a webserver running PHP.
#29 by Fabio on 11/30/05 - 8:23 PM
It's working now!
Do you know where can I find a FLA sample with a component lists with xml to apply to this?
Best,
F
#30 by Fabio on 11/30/05 - 10:22 PM
What should be wrong with my playear, when I drag the button on the progress bar the video doesn't go to the frame and the buffering message start blinking without stopping.
Thanks for your help,
Fabio
#31 by Rob Sandie on 12/2/05 - 7:06 PM
#32 by David on 12/8/05 - 8:22 PM
#33 by stoem on 12/8/05 - 8:57 PM
#34 by Klaus on 12/16/05 - 6:38 PM
it says unexpectet file format. Is the zip file corruptet or ?
#35 by stoem on 12/17/05 - 9:54 AM
#36 by Alexandre on 12/17/05 - 7:54 PM
I'm on a big scholar project with it but i try to find a way to use it with flvplayback (or netstream but i don't know how to inject cue point to the flv correctly, and dynamically) ... because of netstream doesn't support cuepoint adding ! ThX
Sorry for my english ...
#37 by Can on 1/3/06 - 12:09 AM
This is a real good one. I am trying to use the Media Server only for realtime streams for a project of mine so this could help. What could be some problems using this in a project with a lot of users? Has anyone tried? Thanks a lot.
#38 by Can on 1/3/06 - 12:37 AM
#39 by stoem on 1/3/06 - 8:38 AM
I do not know FLVTool2 but I would imagine that it will not offer the functionality of flvmdi (which is needed to make this PHP solution work).
#40 by Fredz./ on 1/7/06 - 5:47 PM
For everyone's information: FLVTool2 is the first tool that implement this feature. FLVMDI followed a day after since I've explained Nicolas (from FLVMDI) how this really cool feature works. He's as soon implement it in his version for others benefit of.
just my two cents on history.
Cheers!
#41 by David on 1/7/06 - 6:15 PM
Have you seen Rich Media Project amazing PHP player at :
http://www.rich-media-project.com/test4/cool3.html...
I have written a mail to this french company and they told me that PHP streaming components will be available soon.
Have someone heard about other products ?
David
#42 by Fredz./ on 1/7/06 - 6:25 PM
Other than this, I think the link you posted looks like a great example of the usage of this PHP seeking technique that has been elaborated and enhanced by multiple peoples.
#43 by Burak KALAYCI on 1/7/06 - 6:52 PM
"For everyone's information: FLVTool2 is the first tool that implement this feature."
I don't really care which tool implemented it first. For the record: Stefan Richter (Flashcomguru), asked about this to us on October 25, 2005. We releassed a beta version of FLVMDI with this feature on November 2, 2005.
I think "the idea" was important here; if it had occured to us, we would have implemented this years ago.
So thanks again Frederic and Stefan.
Best regards,
Burak
#44 by Fredz./ on 1/7/06 - 7:29 PM
Sorry I did a mistake, your right Burak.
"FLVTool2 is the first tool that implement this feature. FLVMDI followed a day after since I've explained Nicolas (from FLVMDI) how this really cool feature works."
Should be changed to:
FLVMDI is the first tool that implement this feature. FLVTool2 followed a day after since I've explained Nicolas (from FLVTool2) how this really cool feature works.
:)
Cheers
#45 by Fredz./ on 1/7/06 - 8:18 PM
#46 by Seth on 1/9/06 - 7:34 PM
Thanks
#47 by stoem on 1/9/06 - 8:50 PM
#48 by Alexandre on 1/17/06 - 11:13 PM
VP6 allow to put keyframes every x frames/s but object keyframe doesn't work ... so using flvmdi !
For me after using flvmdi, I have too much keyframes (double or more) but i have de keyframe object, cool ... but don't really works on the player ...
I just want your settings when you encode video in VP6 ... which is the best codec for flv (i can't return to sorenson) ...
THX and sorry for my english !
#49 by Burak KALAYCI on 1/18/06 - 2:06 PM
As far as we are aware there's no bug with FLVMDI.
If you think any problem is related to FLVMDI, or, have a suggestion how we can improve it, please let me know (burakk at buraks.com).
Thanks,
Best regards,
Burak
#50 by Alexandre on 1/18/06 - 4:33 PM
So, I think about something : it should be so good to delete all keyframes from a flv movie and to put keyframes with personnal interval (10 frames / s or 1 kframe / s ... for example) with FLVMDI ! We already can ? say me how ! :D
I just wanted to know how encode with on2 vp6 for flv streaming with php ... thanks.
Alexandre
#51 by Terry on 1/20/06 - 5:30 PM
But otherwise I seem to have it working. Thanks a bunch!
#52 by Terry on 1/20/06 - 5:36 PM
In other words, I want to use this to stream my video, but when I take the video off the server, I don't want people to still be able to see the video from their cache (In other words copyright protecting it). Is this possible?
#53 by terry on 1/25/06 - 7:53 PM
I needed this, as I have a 30MB file to stream. And each time the user changes position (the way the php file originally works), the rest of the file from the scrub point gets re-downloaded. So if a user is in the first few seconds of watching and waits until the whole video downloads (all 30MB), and then the user scrubs back to the say the third second from the beginning, almost the whole 30MB will be downloaded again at the users FULL connection speed. I don't want to waste that much bandwidth.
The code below is limited to 30k/2sec or 15k/sec. Using 30k/sec is more of an average than 15k/sec as the limit is over 2 seconds instead of one, giving the download more of a chance to allow bursts to get the player the amount of file it needs to continue playing while the bandwidth limiting sleep is happening.
Hope this posts readable!
//set below to be your bandwidth
$bytes_per_timeframe = 30000;
$time_frame = 2;
while (!feof($fh)) {
// get start time
list($usec, $sec) = explode(" ", microtime());
$time_start = ((float)$usec + (float)$sec);
print (fread($fh, $bytes_per_timeframe));
// get end time
list($usec, $sec) = explode(" ", microtime());
$time_stop = ((float)$usec + (float)$sec);
// Sleep if output is slower than bytes per timeframe
$time_difference = $time_stop - $time_start;
if ($time_difference < (float)$time_frame) {
usleep((float)$time_frame*1000000 - (float)$time_difference*1000000);
}
}
#54 by terry on 1/25/06 - 7:57 PM
Also, my bandwidth limit above of 15k/sec is pretty low. Obviously you can change it to 100k/s for videos that need more bandwidth.
#55 by stoem on 1/25/06 - 8:10 PM
Thanks again.
#56 by terry on 1/26/06 - 1:18 AM
#57 by Sha on 1/27/06 - 1:24 AM
Would be glad of any pointers and suggestions&
Thanks
#58 by fredz on 1/27/06 - 2:34 AM
#59 by Jeroen on 1/27/06 - 2:58 PM
Without loading the complete file into the player !?
Like that the php file sends chunks of the file to the player, and the player stats playing directly without having the complete 40mb loaded.
anyone ideas on this?
I tried some things with the code 'terry' posted above at 1/25/06 7:53.
But the video doesn't start directly, it starts when the complete 40mb file is loaded.
#60 by stoem on 1/27/06 - 3:02 PM
that is exactly what this script is supposed to do: making it possible to seek to a point in time that hasn't yet been downloaded. As you can see from the demo on the page this works well.
#61 by Jeroen on 1/27/06 - 3:14 PM
When I test it with a 40mb .flv file I have here, it doesn't start playing at all.
It does nothing.
#62 by kimmy on 1/27/06 - 3:21 PM
Concerning switching between local and PHP mode i found a working solution (still beta testing) but it is not really interesting with giant movies.
The main point is to be able to kill the php file in Temporary Internet Files folder.
Anyone has an idea on how we can make this :
From Flash ?
In the PHP script ?
#63 by stoem on 1/27/06 - 4:08 PM
Still will always be flawed. We may be able to discourage local caching but at the end of the day the file you are playing is available online and for that reason it can be downloaded.
Have you experimented with the headers, trying to get the browser to expire the file right away?
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
Will that make any difference?
#64 by terry on 1/28/06 - 4:11 PM
I realize that its not going to be 100 percent. I just need to weed out the vast majority from being able to easily watch the file again, especially if their browser is too lazy to check for a new version.
However, I moved the name of the file into the php script and set the file name with an identifier from the swf file. So the URL won't contain the flv file name. In other words the url will be www.mysite.com/stream/flvprovider?name=clip1&p.... In the php file, clip1 equates to the flv file I want to play.
I also replaced the line in restartIt()
from...
ns.play( _vidURL );
to...
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + 0;
the _vidURL is then no longer used, so I also removed the variable. (jeroen -- do this and I think your problem will be solved because now the file always comes form the php and is constantly regulated)
Since the php file streams the flv file from the backend, the actual flv file name is never seen by the viewer or their machine. If the person is smart enough to download the flv file by just entering the correct url parameters on the php file (www.mysite.com/stream/flvprovider?name=clip1&p...), then they will be able to get the file as a download. However, they will have to save the file as an flv file and then create an swf file to play the flv file (or find an flv player). This all takes some intelligence, which weeds out a vast majority (80%) of the internet viewers.
#65 by terry on 1/28/06 - 4:15 PM
if (ns.time >= ns.duration - 3){
bufferClip._visible = false;
}
#66 by terry on 1/28/06 - 4:21 PM
(Thanks to flashcomguru for posting his original code, or I would not be able to do this. I am hugely appreciative as it got me started.)
#67 by stoem on 1/28/06 - 4:48 PM
Would you mind sending me your updated code? stefan AT flashcomguru.com
I'd like to check it out and give it a test run. I think other people will also find it very useful. A cheap (if not totally reliable) way to achieve some DRM with flv files. Great stuff.
#68 by Jeroen on 1/28/06 - 8:42 PM
And i've moved the .flv file location outside the http docroot, so they're not accessible directly.
Also i've used terry's code earlyer with $bytes_per_timeframe = 256000;
The working demo i've setup now:
An flashvideo behind an pay per minute phone number.
If the viewer(caller) hangs up the phone, the flvprovider stop's sending blocks of the flv video, and the player stops playing after the current buffer ( 256000b) is empty.
It looks like it's working correctly now, and the viewer can't even watch the part he've already seen after hanging up the phone.
I'm going to clean up the code a bit tomorrow, it's kinda messy now ;)
#69 by stoem on 1/29/06 - 11:50 AM
please post your files so we can keep track of the modifications and additions that everyone adds to this.
Thanks!
#70 by terry on 1/30/06 - 12:35 AM
also, i realized my post above with the line:
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + 0;
should have been (I copied the trace instead of the line that actually does the work - but the idea is the same)
ns.play( _phpURL + "?file=" + _vidName + "&position=" + 0);
#71 by demiurgu on 1/30/06 - 12:43 PM
#72 by stoem on 1/30/06 - 1:49 PM
#73 by demiurgu on 1/30/06 - 2:15 PM
#74 by terry on 1/30/06 - 4:59 PM
You seem to be on the same page with me...
I just realized that we can make the player even better by including whether or not the buffer is full in the variables that are sent to the php file.
In other words, we can check the current buffer time:
_bufferFull = 1;
if(ns.bufferLength<ns.bufferTime){
_bufferFull = 0; // False
}
then add it to the call to the php file:
my_ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i] + "&bufferFull=" + _bufferFull);
The php file then has the the ability (with a check of the incoming _bufferFull variable)to remove or increase the bandidth limit until the buffer is full!! Thus, increasing the amount of feedback and making the performance for the user better.
#75 by terry on 1/30/06 - 5:03 PM
#76 by rex on 1/30/06 - 7:35 PM
this is the dreamsolution for my videosite!
But (I think) I'm in the same path-trouble as demiurgu:
"when I drag the button on the progress bar the video doesn't go to the frame and the buffering message start blinking without stopping. I use flvmdi to inject metadata on flv and i am able to read this data so metadata is corect"
What are the right $path?
Please, give me a hint. ;) thx!
#77 by YG on 1/30/06 - 7:35 PM
#78 by terry on 1/31/06 - 4:13 AM
For Linux, if you have access to the command line, navigate to the directory where your flv file is stored and type "pwd" (present working directory).
That comand will show your current path, which is the path to your flv file because you are in the flv folder. Set the $path variable to that output. (should be something similar in form to: /home/users/www/flv/ -- make sure you include the training slash if its not there)
#79 by demiurgu on 1/31/06 - 8:03 AM
#80 by Jeroen on 1/31/06 - 9:59 AM
I had some problems when I first tried the script with my own .flv file.
The reason why it didn't play the file was because apache/php didn't had the rights to access the file.
( I forgot to chmod the file )
@terry:
Indeed we're on the right page. I didn't had time the last 3 days to work on the code. So I've no progress on new things.
I won't have any time next week to work on it.( wintersports )
So I'll pick it up again after 12 Feb.
#81 by rex on 1/31/06 - 12:20 PM
The next problem was the memorylimit of my php-host (16MB),
because my FLVs are 290 to 450 MB! (each)
The example golfers.flv run and seek correct - but my FLVs run only once and don't seek a later position.
The hint from Michal Tatarynowicz are the solution:
>>> print (fread($fh, filesize($file)));
to
>>> print (fread($fh, 10000));
@demiurgu
some time its run, somtimes not? Eventually it is the filesize (or a late seekposition) of your flv. Test the hint from Michal.
Thanks!
#82 by Alexandre on 1/31/06 - 2:16 PM
But there is one thing : why choose 10000 instead of filesize ? it's in bits, if memory limit is 16MB, why not choose 16000000 (or a bit less) ? ;)
#83 by rex on 1/31/06 - 3:32 PM
You can theoretically use 16384. But the script also runs it self in the memory. A better value: 15360? (sorry for my very bad english!)
Btw. - its a integer (byte) and 1 MB == 1024 Byte...
#84 by YG on 2/1/06 - 10:18 PM
I am trying to implement the xml loader, the thumbnail previewer and the progressive functionality all in one.
(See the thumbnail preview and xml stuff on this site)
Here's what happens:
All five videos play when selected in the list (simple with the tutorial). I placed the srubit function inside the event listener.
Here is what happens:
1) All videos load and play the first time
2) Can scrub the first video
3) Cannot scrub any other video.
4) Scrubber resides on the same location as the first video WHY???
Do I need to reset some values. Is my code completely ridiculuos.
(I hope to port the xml from Php and be able to have it all dynamic...)
Here is a code snippet.
Sorry about the formatting...
//Tell Function to do stuff when a user selects an item
listListener.change = function( evtobj ){
// close any current stream
ns.close();
video.clear();
//create a new stream
ns = new NetStream(nc);
//"attach" (pipe) stream to this video object
video.attachVideo(ns);
//Build FLV file name
var flvfile = evtobj.target.selectedItem.data + ".flv";
var _phpURL ="http://www.name.com/Example12/flvprovider.php"...;;
var ending = false;
var amountLoaded:Number;
var duration:Number = 0;
var loaderwidth = loader.loadbar._width;
loader.loadbar._width = 0;
//ATTEMPT TO RESET X VALUE TO RESET SCRUBBER
loader.scrub._x = 0;
// play selected flv
ns.play(flvfile);
//PULL METADATE FROM INJECTED ARRAY FROM FLVMDI
ns["onMetaData"] = function(obj) {
duration = obj.duration;
// suck out the times and filepositions array, this was added by flvmdi
times = obj.keyframes.times;
positions = obj.keyframes.filepositions;
}
//END OF METADATA FUNCTION
//SCRUBBING FEATURE CALLED WHEN USER MOVES SCRUBBER
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * loaderwidth;
loader.scrub._x = ns.time / duration * loaderwidth;
}
loader.scrub.onPress = function() {
clearInterval (statusID );
ns.pause();
this.startDrag(false,0,this._y,loaderwidth,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
scrubit();
this.stopDrag();
}
function scrubit() {
var tofind = Math.floor((loader.scrub._x/loaderwidth)*duration);
if (tofind <= 0 ) {
restartIt();
return;
}
for (var i:Number=0; i < times.length; i++){
var j = i + 1;
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
trace("match at " + times[i] + " and " + positions[i]);
bufferClip._visible = true;
ns.play( _phpURL + "?file=" + flvfile + "&position=" + positions[i]);
trace("play " + _phpURL + "?file=" + flvfile + "&position=" + positions[i]);
break;
}
}
}
//END OF SCRUBBING FEATURE
}
#85 by terry on 2/2/06 - 2:22 PM
It looks like when you change files, you play the file from the start, so I would expect the headers to get through.
Does everything work if you remove the scubbing? In other words can you change files and have each of them them start and play all the way through from the beginning of the video after changing videos?
One thing I might try (again I'm not a great programmer):
Destroy (or empty) the duration, times, and positions variables before putting the meta data of the new file in them (I'm not sure how the assignment works works, but maybe the new file information just overwrites as much of the arrays as there is information, leaveing any extra length on the array unchanged?)
#86 by YG on 2/3/06 - 10:36 PM
#87 by Terry on 2/4/06 - 6:58 AM
(replace the AT with an @ and remove the spaces)
#88 by terry on 2/8/06 - 4:32 PM
I would think for it to work, it would have to be implemented by a second call from within the swf file to another php file (the way you might load an xml file, or maby through another hidden NetStream?) that somehow communicates with the streamprovider.php (maybe it sets a flag in a file that the streamprovider.php opens and checks every few seconds? or maybe php files can somehow share variables and the swf just periodically calls another php file that injects the variable into the streamprovider.php? ) -- don't now if that makes sense, but if possible, coding it would be a little beyond me.
#89 by demiurgu on 2/10/06 - 2:07 PM
Sorry for my spell.
#90 by Ian Winter on 2/13/06 - 1:47 PM
#91 by stoem on 2/13/06 - 2:55 PM
#92 by jascha on 2/23/06 - 10:45 AM
it looks like keyframes.times and keyframes.filepositions are a large amount of numbers for each frame in the video. Macromedia's video encoder doesn't put this information in the Video, so your scrubber do only work with flvmdi.
On the Website of flvmdi they say, that they do this with a commercial 'flv-library', and they want to keep it secret.
Do you think there is a possibility to build the php to calculate the byte position from a given time position and do like flvmdi does, without having the metadata injected?
#93 by Kris on 3/5/06 - 11:15 AM
#94 by Xris on 3/5/06 - 11:12 PM
Very great stuff, it works on the demo but not in my environment.
When moving to another position, I always got StreamNotFound. I got this message without having done any modification on the source code (except, of course, the URL).
Thanks in advance to provide any advise.
Cheers.
Xris
#95 by stoem on 3/6/06 - 8:07 AM
#96 by Xris on 3/7/06 - 2:42 PM
Actually, the problem was coming from the (fread($fh, filesize($file)); line.
Replacing the filesize by a constant fixed the problem.
Now, let's try to have it running with FLVPlayBack.
Did someone already succeed ?
Cheers.
Xris
#97 by Alexandre on 3/14/06 - 6:56 PM
FLVPlayback needs a XML file (from Flash Communication Server) or a *.flv for the contentPath parameter. Any other extensions (php here) doesn't work.
Anyway, to get back metadata from FLV using FLVPlayback, I create a netStream connection and get them (ns.play() + onMetaData + ns.close()). There is no onMetaData method for FLVPlayback. You must use a listener like that :
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
trace("canSeekToEnd is " + my_FLVPlybk.metadata.canSeekToEnd);
trace("Number of cue points is " + my_FLVPlybk.metadata.cuePoints.length);
trace("Frame rate is " + my_FLVPlybk.metadata.framerate);
trace("Height is " + my_FLVPlybk.metadata.height);
trace("Width is " + my_FLVPlybk.metadata.width);
trace("Duration is " + my_FLVPlybk.metadata.duration + " seconds");
};
my_FLVPlybk.addEventListener("metadataReceived", listenerObject);
But I couldn't access to keyframes object by this method.
I think there is no way to stream FLV with FLVPlayback and this method. Sorry ! :(
#98 by stoem on 3/14/06 - 7:37 PM
I think in order to make this work with FLVPlayback we would need to modify a few of its classes. I am sure the metadata can also be added but right now the event may simply dispatch a hardcoded series of properties.
I will look into modifying another, simpler player to provide this functionality. FLVPlayback is good but has some baggage that we don't need for this PHP streaming scenario.
stoem
#99 by stoem on 3/15/06 - 10:52 AM
here's a MX 2004 version of the scrubber.fla:
www.flashcomguru.com/downloads/scrubber.zip
#100 by PhillFlash on 3/17/06 - 4:59 PM
http://philflash.inway.fr/phpstream
This is a beta version.
All sources are available.
Philippe
#101 by stoem on 3/17/06 - 5:07 PM
#102 by PhillFlash on 3/17/06 - 11:58 PM
This is a beta.
All is ok with Internet Explorer but with Mozilla Firefox
there are some bugs.
With Firefox, we will get "NetStream.Play.Stop" events
if there is a seek.
I'm working on a solution but the problem is difficult...
Philippe
#103 by Jason Naga on 3/19/06 - 7:42 AM
#104 by Podawan on 3/21/06 - 1:48 PM
www.post-television.com
The generated FLV contains the metadata to use PHP streaming.
Podawan
#105 by Steve Savage on 4/1/06 - 4:50 PM
http://www.realitystorm.com/experiments/flash/stre...
The code probably needs some work, and the site's definitely does, but the code does work.
#106 by stoem on 4/1/06 - 5:00 PM
I thought it would never happen. Great stuff, I'll give it a try as soon as I the chance as most of my apps run on CF too.
PS: my real name is Stefan Richter ;-)
#107 by Ben on 4/2/06 - 9:51 AM
Great program. Looks like it will be quite handy.
Just a thought. In the following line in the as code
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
then ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
might want to put a check just before that and have something like this
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
if(times[j]==tofind) // check upper boundary
i=j;
bufferClip._visible = true;
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
}
Also, if anyone can point me to some code that reads/seeks binary files in asp i would be happy to change the code to work in asp.
With the php code:
print (fread($fh, filesize($file)));
Might be a good idea to check where abouts in the file you. Say if the flv is 10mb and u seek to the mid part of the flv then fread from mid to the length of the file won't it read 5mb of garbage ? Been awhile since i've used these functions so i'm probably wrong :)
Just curious you will never have the complete flv in the temp int folder ? Unless the user watches the whole video without seeking ?
Terry would it be possible to get a copy of the code you are working on ? Looks interesting. Email is benassi at tpg.com.au
#108 by Alexandre on 4/3/06 - 7:30 PM
In our project, we work with huge file (2 hours and 1 keyframe by second !) and the actual code seems to be optimized ton find the right position on the positions tab.
Instead of linear search on the tab, I thought to cut the tab in 2 parts while the searched value (tofind) is on one part. So, to be clear, if we have 3000 keyframes, we don't test 3000 times the tab as actual. In this code we have only 11/12 loops (3000/2^12) instead of 3000.
The code :
function scrubit() {
//Value can be a float ...!
var tofind = (loader.scrub._x/loaderwidth)*duration;
if (tofind <= 0 ) {
restartIt();
return;
}
var moitie = times.length; //get number of keyframes to test
var tab_test:Array = times; //Copy of the times tab
var positions_test:Array = positions; //Copy of the positions tab
var j = null;
var valeur = 0; //Index of the searched value in the tab
if (moitie > 0) {
//Showing buffer clip
bufferClip._visible = true;
/*************************
Here, we cut tabs on 2 parts. If value is superior of the value in the middle of the tab,
we delete (slice) the left part of the tab. If value is inferior, we delete the right of the tab.
We do many times and when the tab has only 2 values, we verify
*************************/
while (tab_test.length != 1) {
/************************
This if can be deleted if you want the inferior value (in the exemple, it will be 11 and not 12)
of the tab near the value to find.
Exemple : if tofind = 11.6 and the time tab has two value 11 and 12, it's the value 12 which
will be selected. We take this position and find the searched positions on the tab positions
************************/
if (tab_test.length == 2) {
var ecart = (tab_test[1] - tab_test[0])/2;
var verif = tab_test[1] - tofind;
if (verif < ecart) valeur = 1;
if (verif >= ecart) valeur = 0;
break;
}
else {
j = Math.round(moitie/2);
if (tofind > tab_test[j]) {
tab_test = tab_test.slice(j, tab_test.length);
positions_test = positions_test.slice(j, positions_test.length);
}
else {
tab_test = tab_test.slice(0, j);
positions_test = positions_test.slice(0, j);
}
moitie = tab_test.length;
}
}
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + positions_test[valeur]);
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions_test[valeur]);
}
}
Perhaps there is error(s) beacause I write it for the function scrub_it() quickly (I tested it correctly with my own tab not times and positions added to a flv).
Here is the original code :
var tab:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,116,120,
121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var positions:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,
116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var toFind = 234.6;
trace("Taille du tableau
#109 by Alexandre on 4/3/06 - 7:34 PM
Perhaps there is error(s) beacause I write it for the function scrub_it() quickly (I tested it correctly with my own tab not times and positions added to a flv).
Here is the original code :
var tab:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,
116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var positions:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114
,115,116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var toFind = 234.6;
var moitie = tab.length;
var tab_test:Array = tab;
var positions_test:Array = positions;
var j = null;
var valeur = 0;
while (tab_test.length != 1) {
if (tab_test.length == 2) {
var ecart = (tab_test[1] - tab_test[0])/2;
var verif = tab_test[1] - toFind;
if (verif < ecart) valeur = 1;
if (verif >= ecart) valeur = 0;
break;
}
else {
j = Math.round(moitie/2);
if (toFind > tab_test[j]) {
tab_test = tab_test.slice(j, tab_test.length);
positions_test = positions_test.slice(j, positions_test.length);
}
else {
tab_test = tab_test.slice(0, j);
positions_test = positions_test.slice(0, j);
}
moitie = tab_test.length;
}
}
trace("Position" + positions_test[valeur]);
And SORRY FOR MY ENGLISH ...
Alexandre
#110 by stoem on 4/3/06 - 8:20 PM
#111 by Steve Savage on 4/4/06 - 10:14 PM
function scrubit() {
var b_match = false
var f_percentage = loader.scrub._x/loaderwidth;
var i_selected = Math.floor(f_percentage*duration);
/* Guess that the key frame I'm looking for is about the same percentage through
the array of times/keyframes as the position that was selected in the "scrub" slider.
*/
var i_guess = Math.floor(f_percentage*times.length);
if (i_selected <= 0 || i_guess <=0) {
restartIt();
return;
}
do {
if(times[i_guess-1] <= i_selected && times[i_guess+1] >= i_selected) {
trace("match at " + times[i_guess] + " and " + positions[i_guess]);
bufferClip._visible = true;
ns.play( _streamerURL + "?vidID=" + _vidID + "&vidFile=" + _vidFile + "&vidPosition=" + positions[i_guess]);
trace("play " + _streamerURL + "?vidID=" + _vidID + "&vidFile=" + _vidFile + "&vidPosition=" + positions[i_guess]);
break;
}
else if (times[i_guess] >= i_selected) {
i_guess = i_guess - 1; }
else { i_guess = i_guess + 1; }
}
while (i_guess >= 0 && i_guess < times.length)
}
The next step will be to apply Newton's Method for further improvement.
#112 by Alexandre on 4/5/06 - 12:06 AM
Steve Savage -> Another approach that I thought before. The code works near perfect only if the "video encoding" adds keyframes as much as secondes ! But I doesn't thought about pourcentage ! Very good idea.
For example (a video of 100 secondes, more easy)
loaderwidth = 100;
loader.scrub._x = 10;
var f_percentage = 0.1;
var i_selected = 10;
//There is as much as keyframes than secondes (times.length = 100)
var i_guess = 10;
-->The code make one loop only ! So quick :)
//There is 2 keyframes by secondes (times.length = 200)
var i_guess2 = 20;
-->The code make 10 loops to find the good index.
//There is 1 keyframe by 4 secondes (times.length = 25)
var i_guess3 = 2;
-->The code make only one loop I think ! Cool !
With my code and same video :
1-4 loops
2-5 loops (better)
3-3 loops
Another example with a huge video (4000 secondes)
loaderwidth = 100;
loader.scrub._x = 10;
var f_percentage = 0.1;
var i_selected = 400;
//There is as much as keyframes than secondes (times.length = 4000)
var i_guess = 400;
-->1 loop
//There is 2 keyframes by secondes (times.length = 8000)
var i_guess2 = 800;
-->The code make 400 LOOPS to find the good index (ouch ! but better as actually)
//There is 1 keyframe by 4 secondes (times.length = 1000)
var i_guess3 = 100;
-->1 loop
With my code and same video :
1-12 loops
2-13 loops (better way only here)
3-10 loops
I think I haven't take the best examples here but ... I can say that your code works perfect with small files and/or with keyframes number <= secondes.
If we need precision and a lot of keyframes, my way can be quicker. But finally the two codes are really fast.
A BONUS : with my code, I work with float value (Math.floor not used) and find the nearest keyframe and not the "under keyframe" (ex : times[12] for 11.7 value instead of times[11] as actual).
So, I take note about your "pourcentage method" and I'm interested in Newton's method (but can't find a way to implement it correctly ...)
PS :
with this line : "while (i_guess >= 0 && i_guess < times.length)"
I think it should be no scrub in the last keyframe ... "times[i_guess+1]" is undefined if "i_guess = (times.length - 1)" ... so, "while (i_guess >= 0 && i_guess < (times.length - 1))" is the good way ...
!!! : I notice with this postscriptum that the actual method doesn't scrub correctly if we take a value of timeline > of the last keyframe (ex : last keyframe at 100 secondes and we search 100,34 secondes) because of comparaison "if( (times[i] <= tofind) && (times[j] >= tofind ) )" ...!
It's not a problem with my "slice method".
Alexandre
#113 by Alexandre on 4/5/06 - 12:10 AM
Alexandre
#114 by Sudhi on 4/5/06 - 8:09 AM
We have extended this player to an advanced level.
Please check below URL.
http://www.dearmyfriends.com/v13/popup.php?idx=390...
Points covered:
i) dvd kind of chapters ( list of intersting poitnsto jump directly to that video part).
ii) can be viewed in different sizes. ie 1x,2x etc
iii) Previous and Next Video buttons( Yes..the two korean buttons provide this)
iv)Exact loadbar showing what bytes loaded to browser.
v) Enhanced php to send bytes to browser
http://www.dearmyfriends.com/v13/popup.php?idx=390...
Thanks
Sudhi
#115 by Sudhi on 4/5/06 - 8:49 AM
http://fmx.exellen.com/v13/popup.php?idx=311&m...
#116 by stoem on 4/5/06 - 10:13 AM
Sudhi: your page does not contain embed tags for the swf, therefore the page only work in IR and not in Firefox.
Also can you make the source files available?
thanks
#117 by nathan on 4/5/06 - 2:09 PM
#118 by Sudhi on 4/7/06 - 4:51 AM
It is still under improvement, SO I cant open sources at this stage. If you have any thing to say , you can mail me.
http://fmx.exellen.com/v13/popup.php?idx=398
check above video, which is streaming at 2 MBPS.
I have added Embed tag, so it will work in other browsers too..
--Sudhi
#119 by Brian on 4/10/06 - 5:21 PM
#120 by Roger on 4/10/06 - 7:11 PM
<object type="application/x-shockwave-flash" data="scrubber.swf?file=video.flv" width="420" height="315" wmode="transparent" VIEWASTEXT>
<param name="movie" value="scrubber.swf?file=video.flv" />
<param name="wmode" value="transparent" />
</object>
Now from what I have gathered I need it to look like this
<object type="application/x-shockwave-flash" data="scrubber.swf?file=flvprovider.phpfile=" width="420" height="315" wmode="transparent" VIEWASTEXT>
<param name="movie" value="scrubber.swf?file=flvprovider.php?file=video.flv" />
<param name="wmode" value="transparent" />
</object>
and I have tried both and neither work? I get buffer that never buffers. Any idea?
Thanks for your help.
Roger
#121 by Elliot on 4/11/06 - 7:22 PM
Here are the details:
I'm embedding the flash player on a website that uses PHP and MySQL to pull information about a house/property from a database.
There is a PHP variable called $ID which corresponds to the folder that the FLV file sits in on the web server. So there will be a main folder called "properties" with many subfolders inside ("1", "2", "3"....) Inside each subfolder will be a "name.FLV" file which I want the one player to play. The actual SWF Flash Player will sit in the root folder of the webserver.
When I showed videos in the WMV format I used URL's that looked like this to pass the variables.
http://www.domain.com/m.php?video=ID
Then the code for the embedded player would look something like this:
<embed src="properties/< echo $ID; ?>/name.wmv" ></embed>
My question is how do I use the variables that are in the URL to determine which FLV file my flash_player.SWF file plays?
Any help would be greatly appreciated.
Thanks.
Elliot
#122 by Anna on 4/12/06 - 5:46 PM
One problem that has already been mentioned but not solved yet: when the user watches a part of the video and then moves the slider to a previous point in the timeline the video gets downloaded again. I think that this could sum up quickly and waste a *lot* of bandwidth and that's the only reason why I'm hesitating to use this approach.
Do you think it would be possible to solve this problem? I haven't had an idea yet...
#123 by stoem on 4/13/06 - 11:43 AM
In a way this issue is apparent in all streaming server solutions: if a user seeks and plays the same part of a video 3 times then he will consume the bandwidth 3 times. The PHP approach is 'worse' in a way because you may be downloading more footage than you are actually consuming - when you seek to another point that entire process starts again and for every 10 seconds watched you may be downloading 30 seconds worth of footage - in this way a real streaming server is much more efficient. So yes, potentially the PHP method will waste bandwidth.
#124 by Tom on 4/20/06 - 12:52 PM
http://www.rich-media-project.com/products/test2
It is still under development but once again Rich Media Project guyes are pushing PHP technology to the next level...
#125 by phil on 4/23/06 - 8:39 PM
This product would be perfect if only we can protect flv files from being downloaded.
The flv is deleted from the temporary Internet files but if i use a sniffer i can get the link to the php page with the variables required to download the flv (as a php file that just need to be renamed with an flv extension).
1) The swf can be encrypted, but i would still be able to sniff the link and download the file because the variables are sent to the PHP script using a GET method.
I don't think it would be possible to send variables using a POST method but someone has probably an idea concerning this point ?
2) The PHP script can ask for the HTTP referrer but once again it is easy to fake this data.
3) I thought about a cookie but the user would be able to watch the original webpage and download the movie at the same time.
4) Google Video, Youtube, Metacafe, Music movies can be downloaded easily so there is probably no solution to secure movie in flash.
Security is always a problem :(
#126 by stoem on 4/23/06 - 8:51 PM
#127 by dewey on 4/27/06 - 6:21 AM
i get no video in IE.. please help.. firefox works fine.
url: http://onetribedesign.com/bridal/chris.htm
#128 by dewey on 4/27/06 - 6:22 AM
the video on THIS page does NOT work in INTERNET EXPLORER either... only firefox!
#129 by stoem on 4/27/06 - 8:15 AM
#130 by dewey on 4/27/06 - 5:21 PM
thx for checking, but it's still not working for me. i have IE 6.0.2900.......... i also checked it in IE 6.0.2800........ neither will show video.. only audio...
another person told me they could see it in 6.0...
the coldfusion one works in my IE... but i can't use that :-(
any ideas on why I can't see it but you can? i checked IE settings and all is ok there.. :-)
#131 by stoem on 4/27/06 - 5:25 PM
Does the clip on this page work for you?
#132 by dewey on 4/27/06 - 5:28 PM
the clip on this page will work for me in firefox.. just not ie
same with my clips
#133 by jim bachalo on 5/17/06 - 12:34 AM
I am however having a problem implementing...I think my error is in defining the $path variable in the flvprovider.php file.
I have $path = 'http://www.mywebsite.net/subfoldername/';
Is this correct?
If I target flvprovider.php directly in the browser I get the following error:
0ERORR: The file does not exist
Any help greatly appreciated!!
#134 by stoem on 5/17/06 - 9:30 AM
the path needs to be a path on disk, for example c:\myapp\myvideos - not a URL.
Stefan
#135 by jim bachalo on 5/17/06 - 3:25 PM
Thanks...almost there.
I get the following using a script to determine my system path:
Path to server root: /dh/
Path to this file: /home/.test/clientname/sitename.net/mydirectory
So would the correct $path variable be?:
/dh/home/.test/clientname/sitename.net/mydirectory/
Thanks again!
#136 by stoem on 5/17/06 - 3:28 PM
#137 by Scott on 5/18/06 - 7:13 PM
Thanks
#138 by tester on 6/12/06 - 1:04 AM
Could someone please post the content of scrubber.fla here so people without flash mx x.x are able to figure out what happens in there?
Or could anyone just post a sample html or php code fragment, which shows how to tell this thing which special xxx.flv file it should use (where to use parameters)?
(i can't belive its hardcoded in the .swf)
#139 by stoem on 6/12/06 - 9:14 AM
A version for MX 2004 is here: www.flashcomguru.com/downloads/scrubber.zip
all the PHP code is published also.
If your version of Flash is even older than MX 2004 that then you're out of luck, but I'm sure you can find someone to compile a version for you. But don't expect us to hand you everything on a golden plate, if you don't like the way the fla works then change it, that's why it's there. But usually yes, you need Flash to edit a Flash file...
#140 by tester on 6/12/06 - 11:14 AM
first i wanted to say its an exellent work. actually i just wanted to know if im already able to handle parameters for the filename to the swf, which i already have. but its o.k. i have downloaded the 30 day trial of flash from adobe
#141 by Barbara on 6/20/06 - 1:13 PM
All of this is very interesting. Can it be applied when there is only an audio channel within the FLV i.e. no image at all ?
From my understanding, metadatas apply only to video keyframe.
Barbara
#142 by stoem on 6/20/06 - 1:19 PM
#143 by Korben on 6/26/06 - 1:39 PM
#144 by Barbara on 6/26/06 - 1:42 PM
Thanks
Barbara
#145 by Wes O'Haire on 6/29/06 - 12:48 AM
1. I can say something like ns.play("myfile.php?vid_id=1234")
2. PHP will retrieve "vid_id", find the appropriate flv, and feed that flv directly back to the flash for playback.
Basically, I don't want to define the flv in flash. Rather send an id var to php and have php determin the flv based on that, then pipe the flv back to flash (via a fread). Is this possible? Do I make any sense? Sorry guys.
#146 by Steve Savage on 6/29/06 - 12:37 PM
http://www.realitystorm.com/experiments/flash/stre...
#147 by stoem on 7/3/06 - 7:45 AM
http://www.flashcomguru.com/index.cfm/2006/6/18/li...
I only hardcoded the flv name for the demo, I didn't realize so many people would find it difficult to make dynamic... sorry.
#148 by mcnaz on 7/9/06 - 6:37 PM
#149 by mcnaz on 7/9/06 - 6:37 PM
#150 by BANGER on 7/20/06 - 12:35 AM
first, thanks for all the infos and srcs, i was able to get this to run also... cool stuff...
im planning on using this stream way on a big site with about 1M unique users per day...
there could be much bandwidth saved, if it can switch to hdd/cache mode, if a full copy has been saved...
is someone able to edit/switch the code to import this function? it should really make sense and will reduce alot of $$$ traffic costs...
please post your opinions, or msn/icq number for more contact - im also willing to pay for this additional feature, shouldnt be so hard... (im a good coder also in php etc.., but like 10% flash knowlegde hehe)
guess alot of other users are intrested in the cached-after-fulldl solution, what do you think... who is able to do it :)
#151 by nethost on 7/24/06 - 10:27 PM
All looks great - i have a question - is this possible...
Can you send to the swf/flv/php a starting keyframe/timecode and an ending keyframe/timecode and then have a new .flv file produced on the fly dynamically of that subsection of the original .flv file?
I know this doesn't do that now but is this even possible with some coding so that a user can enter a start and end timecode and press "Generate Clip" and it creates a new .flv file of the movie between the start and end timecodes given?
My knowledge on flash is about 10% so any advice appreciated if that is at all possible?
#152 by novice on 7/25/06 - 6:06 AM
I am having troube getting this working, can someone tell me how I use the variables, possibly post an example.
$seekat, $filename, $ext and $file
#153 by shonuff on 7/27/06 - 11:17 PM
Let me also say that I'm not really interested in the partial streaming discussed in this article, although it is a very cool feature! But just getting larger files to initialize and run correctly.
It seems when the netstream.play() method is encountered, IE has an undesired pause/lock-up effect. The larger the file the longer the hickup. My animated buffering clip stops, and any attempt to resize, move or click on the address bar sends the browser into "Not Responding" mode. A varying number of seconds go by and then the video plays as it should and the browser goes back to normal. Firefox and Safari work fine. I thought it was just something wrong in my code but then I tried out your player and the same thing happens.
Has anyone else run into this or better yet solved this?
Here are some links to example files, some with my FLV player I wrote and some using the code posted here...
7mb file runs okay:
http://dev.vectorform.com/test/7meg-mine.htm
40 mb file, slight pause:
http://dev.vectorform.com/test/40meg-mine.htm
150mb file, very noticeable pause:
http://dev.vectorform.com/test/150meg-mine.htm
some of the same files with your FLV player...
http://dev.vectorform.com/test/150meg.htm
http://dev.vectorform.com/test/40meg.htm
#154 by shonuff on 7/28/06 - 12:14 AM
#155 by wes O'Haire on 8/8/06 - 8:59 AM
#156 by Stefan on 8/8/06 - 9:07 AM
#157 by wes O'Haire on 8/8/06 - 9:14 AM
#158 by banger on 8/8/06 - 10:34 AM
thanks
#159 by Stefan on 8/8/06 - 10:36 AM
#160 by Dirk on 8/10/06 - 9:06 PM
I have a question though, hope its not stupid because im a complete newbie ;-)
Im setting up a website for me and mt "artist"friends where we can upload all kinds of media trough our php coded CMS into our MySql database...
Is it possible to upload the encoded flash video file, trough our CMS into our databse, and play it trough this videoplayer on our website (when requested?)
please help and thanks for developing...
Dirk
#161 by mcnaz on 8/14/06 - 9:42 AM
I've created such a plugin for the Xoops CMS, where you can stream FLV video files and even sell viewing access on a Pay Per View basis. Check it out here: http://xprojects.co.uk/modules/news/article.php?st....
I've also got the Flash player incorporated into a complete website hosting solution in http://xtotal.co.uk.
Cheers.
#162 by Al on 9/9/06 - 12:28 AM
Does it make sense, should it work ?
Thanks
#163 by Gilberto on 9/11/06 - 4:11 AM
Parse error: syntax error, unexpected T_STRING in /home/restricted/home/fabiotokarski6565/public_html/flvprovider.php on line 21
I can't figure out what can be done to solve this problem.
Thanks
#164 by Santiago on 9/21/06 - 1:35 AM
#165 by josh on 9/22/06 - 2:46 PM
I've got it working with only a few concerns. The ns.setBufferTime command seems to be ignored by firefox as whatever i set it to it trys to play straight away which results in stuttering.
Also, when a video is playing i cannot move to another page (via simple hyperlink) unless i stop the video first.
Any ideas?
#166 by Eric on 9/24/06 - 2:19 AM
AddType video/x-flv .flv
#167 by Francesco Meani on 10/5/06 - 12:07 AM
http://blogs.ugidotnet.org/kfra/archive/2006/10/04...
#168 by Tony on 10/15/06 - 6:52 AM
#169 by little king on 10/19/06 - 3:28 PM
;)
oh and nice php too... hahaha
#170 by yunuen on 10/21/06 - 6:40 PM
i amon vacation and have no access to flash in english and need to have a player saved to .swf!
i still have the php etc but cant make the player! i need this back upon my site ASAP.
you can email me if you can help.
#171 by Jo on 10/24/06 - 10:00 AM
Is there an easy way to make the video autoplay? I've got it to work but firefox seems to ignore buffering and tries to play straight off. Am i missing something?
Also, what's the best way to play mutiple movies with this player? If i embed the menu in the player is there anything i should bear in mind? I've setup buttons that change the _vidURL but should i be resetting other vars?
I've also found that when a video is playing i can't visit other links on the site until the video has stopped. this doesn't happen on this page - could it be the bitrate of my videos?
Thanks!
#172 by Istvan on 11/1/06 - 5:35 PM
#173 by Burak KALAYCI on 11/1/06 - 5:51 PM
Best regards,
Burak
#174 by Istvan on 11/1/06 - 8:42 PM
Well, a real solution for security will never exist. SWF Encrypt is today the best solution, I think. It's not an easy what of obfuscating, just take a look. Streaming solutions are the less secure today. You can save any streams like this! FLV player with encoded files should be much better in this case. I am just searching for a solution like this.
Thx!
#175 by Istvan on 11/1/06 - 8:44 PM
:)
#176 by pitu on 11/5/06 - 5:54 PM
I can not make recorded flv by fms2 seekable.
demiguru reported earlier this problem, it seems he got it working, but did not put up his solution.
other flv. (flash video encoded, then metataged by flvmdi) are seekable, its just the fms2 that do not work with me..
tried micheal's solution (changing php script for large files)
did anyone have this problem before?
any suggestions?
#177 by pitu on 11/5/06 - 9:17 PM
I suppose that, the FLV format headers in the flvprovider script do not match this codecs and this may be the reason they're not seekable...
Now I need to find the correct FLV format headers...
I also found out that in this section of the flvprovider:
if($seekat != 0) {
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
you can replace the lines in {} with
print (fread($fh, 13));
that replicates the 13 first bytes from the .flv. Unfortunately this still does not work with fms2 recorded flv as I suppose there may be some more infos missing...
#178 by Divisionbell on 11/5/06 - 11:13 PM
any help would be appreciated, thanks
Tim
#179 by Vikram on 11/6/06 - 7:25 PM
I need some help implementing php streaming. So far, I have:
1. Downloaded the source files.
2. Changed the video file path in flvprovider.php
3. Downloaded flowplayer.
4. Injected metadata into the flv using Boraks' tool.
I've used flowplayer before but I'd like to use php streaming with flowplayer. Here's the code for a flowplayer instance:
<object type="application/x-shockwave-flash" data="FlowPlayerLP.swf" id="FlowPlayer" height="300"
width="300"><param name="allowScriptAccess" value="sameDomain"><param name="movie"
value="/FlowPlayerLP.swf"><param name="quality" value="high"><param name="scale"
value="noScale"><param name="wmode" value="transparent"><param name="autoplay" value="true"><param name="flashvars"
value="baseURL=http://www.xyz.com/videos&videoFile=/video.flv...;
</object>
How do I use flvprovider.php with flowplayer ? Do I set the location of the flv as flvprovider.php?file=videoFileName.
Need some help here...
Regards,
Vikram.
#180 by yunuen on 11/6/06 - 8:21 PM
i need some testers.
anyone intersted? it will act as a live stream almost where it appears like a TV show... please email me at dynamitemedia@hotmail.com and tell me if your intersted.
or i can post the code here as well
#181 by yunuen on 11/6/06 - 8:35 PM
also my server seems to be off the real time so you may or may not need that part.
i would appreciate anyone else testing this and telling me how it works.
you can also change how the video file is read but i will have the files named in that order. you can change it however you can
i think this could save bandwidth and especially if you want to schedule programs like i want to..
please send comments to me and test results
////////
////
copyright dynamitemedia@hotmail.com but can be edited or used however you choose with permsision 1st
i had another contributor but lost his email addy :( will look for it and add it
////
$path = '/home/videos';
$format ="flv";
// Server time
echo "<b>Server Date & Time:</b><br>";
echo date('m-d-y-H:i:s') ."\n";
echo "<br>";
//get the real localtime in mexico city
$differencetolocaltime=-22;
$new_U=date("U")+$differencetolocaltime*60.45;
$localtime= date('H:i:s',$new_U);
$protime = date('H:i',$new_U);
$VidPos = date('i:s',$new_U);
$vid_time = date('H',$new_U);
// round it and go back to last :30 on the schedule
$round_by = 60 * 30;
$rounded_time = ( round ( time() / $round_by) * $round_by);
$prog_id = date('m-d-y-H:i:s', $rounded_time-60*30);
echo "<br><b>Central Standard Time: </b><br>";
echo $localtime;
echo "<br>";
echo "<br><b>Program ID: </b><br>";
echo $prog_id;
echo "<br><br>";
echo "<b>Video Position:</b> <br>$VidPos";
echo "<br><br>";
echo "<b>Videos Path:</b> <br>$path";
$VidID = "$path/$prog_id.$format";
$VidPosition = $VidPos;
$vidID = $_GET["$VidID"];
$vidPosition = $_GET["$VidPosition"];
echo "<br><br>";
echo "<b>ID :</b> <br>$vidID";
echo "<br><br>";
echo "<b>Position:</b> <br>$vidPosition";
///
#182 by yunuen on 11/6/06 - 8:44 PM
sorry about the multiple posts!
//
<? php
//
found the other contributer:
security improved by by TRUI
www.trui.net
play video by server or anytime you choose by dynamitemedia@hotmail.com
//
$path = '/home/videos';
$format ="flv";
//get the real localtime in mexico city
$differencetolocaltime=-22;
$new_U=date("U")+$differencetolocaltime*60.45;
$localtime= date('H:i:s',$new_U);
$protime = date('H:i',$new_U);
/*--->>*/$VidPos = date('i:s',$new_U);
$vid_time = date('H',$new_U);
// round it and go back to last :30 on the schedule
$round_by = 60 * 30;
$rounded_time = ( round ( time() / $round_by) * $round_by);
$prog_id = date('m-d-y-H:i:s', $rounded_time-60*30);
$vidID = "$path/$prog_id.$format";
$seekat = $VidPos;
$filename = $vidID;
$ext=strrchr($filename, ".");
$file = $path . $filename;
if((file_exists($file)) && ($ext==".flv") && (strlen($filename)>2) && (!eregi(basename($_SERVER['PHP_SELF']), $filename)) && (ereg('^[^./][^/]*$', $filename)))
{
header("Content-Type: video/x-flv");
if($seekat != 0) {
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
$fh = fopen($file, "rb");
fseek($fh, $seekat);
while (!feof($fh)) {
print (fread($fh, filesize($file)));
}
fclose($fh);
}
else
{
print("ERORR: The file does not exist"); }
?>
#183 by orTubes on 11/7/06 - 6:34 PM
Como fa
#184 by SAbi on 11/8/06 - 5:51 AM
#185 by Simon on 11/15/06 - 5:35 PM
#186 by fanno on 11/16/06 - 3:41 AM
Can you Extract medadata off a flv file from PHP ? so you can display a file's get a file's framerate ect ?
thanks in advance
Fanno
#187 by Uther Pendragon on 11/20/06 - 4:33 AM
flvtool2 seems to need the stdin to close before starting its output, implying that it needs the full file before creating its tags. (it must know the size?)
must the player either have the metatags OR the full file to start playing? Can I not play a file as its being created?
#188 by Darren Spidell on 12/1/06 - 1:06 PM
#189 by Stefan on 12/1/06 - 1:32 PM
#190 by JS on 12/6/06 - 5:07 AM
I am looking for ways to prevent/minimize the possibility for people from caching my flv video and I happen to find this site. I like Terry's solution but i do not quite understand his soln.
Can anyone kindly explain:
"how to moved the name of the file into the php script and set the file name with an identifier from the swf file. So the URL won't contain the flv file name."
Thanks.
#191 by Sander on 12/10/06 - 2:22 AM
I'm experimenting with streaming flv via PHP. I build a simple player, but keep getting this one problem. While scrubbing the video I sometimes get a distorted image, like this:
http://img224.imageshack.us/img224/690/untitled1eg...
The video stops playing, but Flash keeps loading data in the background. I'm using the On2 VP6 codec (compressed with the default 1Mbps profile in Squeeze) and the flv has the metadata injected with Buraks MetaData Injector.
Anyone an idea what can cause this problem?
#192 by Peter G on 12/13/06 - 4:27 PM
#193 by Marc B on 12/15/06 - 12:47 AM
1. A button to enlarge the video player. Either as a layered div over the top of my other content in the site or a popup window.
2. Put a basic time counter together so users can see where they are in the current video.
I will pay TOP DOLLAR for anyone that can help. I'm on icq if you use it: 24142711
thanks,
marc
#194 by pr on 12/15/06 - 6:30 AM
We will try to improve the file. Pls provide us with the source code.
#195 by Marc B on 12/15/06 - 7:43 AM
marc
#196 by Torsten on 12/17/06 - 8:12 PM
i've tried this, but it doesn't work.
When i write the address
http://www.modelfinder24.de/flvprovider.php?file=t...
a download dialog will come and ask me, where to save "flvprovider.php. If i save it, the flvprovider.php have the size of the video, i think also the content, but it will not be shown!
best regards
Torsten
#197 by Stefan on 12/17/06 - 8:43 PM
#198 by Stefan on 12/17/06 - 8:44 PM
you need to hit the PHP file from the SWF (flash), not directly from your browser.
#199 by Vincent on 12/18/06 - 10:14 PM
#200 by Vincent on 12/18/06 - 10:15 PM
#201 by Vincent on 12/18/06 - 11:46 PM
please check www.ahna.nl/test/
#202 by Vincent on 12/19/06 - 12:20 AM
I made FLV video's and inserted META tags with Bulak's Meta Injection
The .swf player (my own and the original one with my .flv files) works fine in Macromedia Flash player and IE. In Firefox when i try to seek CPU load goes to 100%.
#203 by Tuna Y1lmaz on 12/22/06 - 1:57 PM
I am using this php streaming script. it streams well but while it is buffering if you click on a link, page doesnt change. it changes the page after it loads full flv file. i didnt user that scrubber.fla. is it because of it. or because of flvprovider.php
thanks
#204 by pankaj on 12/30/06 - 9:32 AM
1) after uploading Audio / Video file, it should convert into .flv format, with our logo in the flash.(Example: break.com or myspace.com)
2) Capture screen shoot of the flash video in .jpg or .gif
3) Store the file name in mysql database.
4) Stream the same in flash & on each click save the info (# of hits) for the flash view in mysql db.
5) If require help in setting up streaming server (optional)
pankaj
#205 by Lars on 1/2/07 - 9:27 PM
First of all, very nice scripts!
Only one thing got me stumped. I'm serving up the PHP script from a Debian/Apache server. Whatever i change my $path to it does not seem to scrubble, movie starts fine but when i move the playhead it just stops.
My fullpath looks like:
/home/httpd/vhosts/mydomain.com/flv_test/
Anyone has any experience getting this to work on a NON-windows machine? thanx...
Also when visting fileprovider.php directly in the browser i always get the file-not-found error. Does it only work when calling it from flash?
#206 by Lars on 1/3/07 - 4:10 PM
#207 by Jie on 1/3/07 - 5:43 PM
If we look at how this system is broken into:
The user gets hold of the php file and download it via flashget or other stream/file downloader.
What will happen next: the downloader will use GET to download the whole flv stream.
However: we can change the system so that the php handler requires different querystrings at different time intervals. (this feature can not be mimicked by stream/file downloader)
The problem: Are we able to merge the flv files in the swf player so that at the front end there will be one smooth video?
This solution only increases the difficulty for the user to grab the file; determined user can at last use sniffers to download pieces of flv videos and decompile the player to learn how to glue the videos back together.
#208 by Lars on 1/3/07 - 6:06 PM
#209 by raghu on 1/5/07 - 7:03 AM
I too worked on this FLV streaming and it works in linux and on most windows but not all windows OS .
I opened the flv file in binary mode. The problem is with the fread() function in flvprovider.php returning the part of FLV file from seek position.
the fread function is not returning the content in correct format.
when i opened the actual FLV and FLV from the PHP file in a text editor i saw some characters changed to some other format and hence the flv is not playing.
Please help me in working it.
#210 by Mustafa on 1/5/07 - 8:33 PM
can you describe a little more? I see a download dialog too. What does "hitting the PHP file from the SWF (flash)" mean? Where can I find a sample swf file?
#211 by damian todaro on 1/6/07 - 9:05 PM
#212 by Stefan on 1/6/07 - 9:49 PM
the swf can be copmpoiled from the fla contained here:
http://www.flashcomguru.com/downloads/phpstream.zi...
damian:
are you saying that you already have external XML which contains file info that you want to inject? Or are you simply looking to process FLV file in the usual way, but these files turn out to be very large?
#213 by Chris on 1/6/07 - 9:50 PM
The largest file we successfully injected is currently 700Mo.
#214 by Mustafa on 1/7/07 - 3:52 AM
thank you for your concern. can you show me a sample HTML file too?
#215 by damian todaro on 1/7/07 - 10:09 PM
i have a 1Gb FLV. when i try to "inject" it, FLVMDI runs out of memory. I have spoken to Burak about this and he is working on a fix. Any other workarounds?
Also, can someone point me to the actionscript code to load keyframe data from an external XML file, instead of the injected metadata.... i can hack my way through it but it'll take me an hour or more when i know i've seen it around here somewhere but i cant find it... thanks!!
D
#216 by RudiX on 1/9/07 - 9:28 AM
I tried different things but nothing fixed this problem. It seems that the Fifefox Flash Plugin ignores the bufferTime and plays directly after start and so the plugin and the browser freezes. Sometimes it works fine i think when the speed of the server is enough so that the player can play immediately.
The unclear thing is that when the video starts from the begining ist works nearly fine but when i seek the firefox breaks down. Could this be a Problem with the Header of the Stream? I tried to send the complete header and metatags from the flv and then send the file from the right position but this didnt work. I dont know if there is a finish sign at the end of the metatags or something like that.
Maybe someone have a nother idea to solve this problem ... keeep going
#217 by chobbert on 1/11/07 - 10:06 PM
fantastic stuff!
Nevertheless I have the same experience described above about Firefox: Once I try to seek, the movie jumps to the selected position but then it is only stucking. If the video is larger, the stucking goes on until Firefox freezes (see http://www.time-matters.com/test/imageDeutsch.htm). If the video is shorter it stucks but then comes back to normal (see http://www.time-matters.com/test/taube.htm).
Does anyone know why?
Robert
Has anyone
#218 by raghu on 1/12/07 - 4:59 AM
I have been experiencing the same problem mentioned above in mozilla and IE 7 .
it plays for 1 or 2 seconds and then stops.
is it the problem with mozilla or any buffering has to be adjusted in the PHP file?
does any one have any idea on it?
#219 by Fanno on 1/12/07 - 4:31 PM
I have previously asked how to manipulate flv in PHP ( metadata ect ). With another guy i founed he created a tool for this. i have been working on improving this and i have added new features such as playback, and thumbs and preview runtime. And also have bandwidth limiting. This tool still need lot's of testing. whitch i hope some of you may wish to help with =), at this time there are a few known issues whitch i am trying to work out. such as:
Duratsion of perview not matching
Filesize in flash becomes -1 ? properly metadata issue.
Issue with Backplaying with lock when starting two movies at the same time.
This is the current documentation i have on it: http://fanno.dk/index.php?option=com_content&t...
I have one Showcase site to show it in action. Whitch since i am working on it from time to time MAY be not working:
http://test.fanno.dk/flv_test.php
#220 by DarthVader on 1/13/07 - 1:28 PM
But i d like to use this function with .flv-Files from a Video-Prodiver like youtube etc.
If i use the download-url of the .flv i could see the video but as soon as i seek i stops.
Is there a possibility to seek videos from another server?
#221 by Vincent on 1/16/07 - 8:15 PM
#222 by Shaimaa on 1/17/07 - 12:08 PM
i want just to let my clinets in my website to upload videos in any formats an those videos will be viewed in the website in a flash format, the probelm in the step of converting from video formats to flash viedo player
#223 by Fanno on 1/17/07 - 3:09 PM
#224 by Frank on 1/17/07 - 10:41 PM
Now i try to do a player like the one available at the google video website. What i mean is you can enlarge the video full screen(not with the full screen method available in flash 9 because we want real fullscreen in a javascript popup windows) and continues the streaming of the video at the same point. Actually, i'm able to open the video full screen and restart at the same point. I do this with two swf files, the original scrubber and an adapted full screen version. I pass the parameters via a php url. The problem is: The scrubber doesn't move at the same point where he we're on the original video and when i scroll the scrubber. The video restart at the beginning.Here the script of my full screen fla file:
###
Note from Editor: I have removed your code, it was way too long and broke the page layout too
###
Can some help me please?
Thank you
BTW: my email is ftremblay666@hotmail.com
#225 by Holland Risley on 1/22/07 - 8:20 AM
Best regards,
Holland Risley
#226 by Craig on 1/28/07 - 2:33 AM
PHP info identifies my document root as:
/home/khmsite/public_html
I have the flvprovider.php, the scrubber.swf, and my .flv file in a folder named "media" in the main public_html folder.
I have set the scrubber to the following:
var _vidName = "DocName.flv";
var _vidURL = "http://www.kathiehillmusic.com/media/" + _vidName;
var _phpURL = "http://www.kathiehillmusic.com/media/flvprovider.p...;;
And I have flvprovider.php set as follows:
$path = '/home/khmsite/public_html/media/';
I keep getting the "ERORR: The file does not exist" message and I've tried removing the "/" before and after paths, tried changing the "public_html" to "www" but nothing seems to work. I'd really like to use this and am very excited that it's available... more so if I can get it working!
#227 by Craig on 1/28/07 - 2:39 AM
I see some references to a lot of other stuff like FLVMDI ... do those need to be installed/configured as well... or is it really as simple as uploading the three files in this zip with the correct paths set?
#228 by Raghu on 1/30/07 - 1:58 PM
header("Content-Length: " . filesize("your FLV file here"));
and it works.
Thanks!
#229 by RudiX on 1/30/07 - 2:49 PM
you are a genius! today a ordered a streaming server for a client but now i canceled the order. thanks for your work. i tried a lot but never to put the filesize into the header. respect.
keep going.
#230 by Raghu on 1/31/07 - 12:35 PM
But hard coding the file size in header function will work.
#231 by cheap_web_hosting on 2/2/07 - 1:10 AM
#232 by Alexi on 2/2/07 - 6:24 AM
#233 by Stefan on 2/2/07 - 9:12 AM
#234 by srikanth on 2/2/07 - 12:47 PM
#235 by crazyred on 2/6/07 - 9:39 PM
Does anyone know?
#236 by Peter on 2/7/07 - 11:36 PM
I'm traying the phpstream. It's really fine.
But a I can't to adapt the arrow of the scrubber.fla to my flv. I move the arrow but doesn't work.
I will be thankful if anyone tell me how I can to solve it. I'm using the same settings of golfers.flv.
What I have to change? Please
Thank you
Peter
#237 by srikanth on 2/8/07 - 5:02 AM
#238 by jason on 2/8/07 - 9:15 AM
#239 by Peter on 2/8/07 - 1:10 PM
I think I have to change something in the actionscript of the golfers.fla to adapt the arrow of the controlBar to a new video. But I don't know which is this change or other trouble.
I'm using the same settings of the golfers.fla but when I work with other video and I want to move the arrow and doesn't work. Only works in the beginnig and the end of the new video. Please tell me if I have to change something to adapt it.
Regards,
Peter
#240 by Shyam on 2/12/07 - 1:43 PM
#241 by will griffin on 2/12/07 - 10:09 PM
session_write_close(); before starting to stream data in the wrapper script otherwise the player will freeze your browser until the video is done downloading.
#242 by Thomas on 2/17/07 - 10:28 PM
www.justquickit.com/movie.phtml
Many people asked about the issue, but it appears nobody is willing to answer? I suppose it's the position variable that is not passed properly?
Any advice would be greatly appreciated. I'm a newbie at this.
Kind regards
#243 by Thomas on 2/17/07 - 10:32 PM
Here is the correct file
http://www.justquickit.com/video.phtml
#244 by Thomas on 2/18/07 - 2:32 PM
Great stuff Stefan!! Thanks for sharing.
http://www.justquickit.com
#245 by Jignesh on 2/19/07 - 7:30 AM
1.flvprovider.php
2.golfers.flv
3.scrubber.fla
So, Plz.. tell me
ARE those enough to play .fla file ?
tell me what to do after downloading phpstream.zip file,,,
is any change required i php.ini file to play .fla file...
Waiting for regards..
#246 by Ric Flomag on 2/20/07 - 9:10 PM
* be able to tell the video file to the flash player as a parameter
* translate the player to spanish and do some design tweeks
* remove the PHP memory limit, as explained in a previous comment
Here is an example of the result (1h40 / 200Mo video):
http://socios.smo.org.mx/modules.php?op=modload&am...
To download the files:
http://socios.smo.org.mx/videos/flashphpstream.tar...
the player is inserted in a page this way (note the "?video=sesion20061205", which the video file to play):
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=
"http://download.macromedia.com/pub/shockwave/cabs/...; width="498" height="444">
<param name="movie" value="http://socios.smo.org.mx/videos/phpstream/scrubber...; />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="" />
<embed src="http://socios.smo.org.mx/videos/phpstream/scrubber...; wmode="" quality="high" menu="false" pluginspage=
"http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="498" height="444" />
</object>
#247 by Sandbird on 2/21/07 - 3:02 PM
#248 by Stefan on 2/21/07 - 3:09 PM
#249 by fanno on 2/21/07 - 10:08 PM
#250 by Sandbird on 2/22/07 - 7:45 AM
#251 by Lance on 2/28/07 - 8:16 PM
Thanks again!
#252 by Stefan on 2/28/07 - 8:37 PM
PS: you may want to hide the buffering message before the user presses play. Nice job.
#253 by Lance on 2/28/07 - 9:46 PM
No special implementation, just the files in the package, with the tweaks already mentioned in the thread (the filesize fix posted by Michal Tatarynowicz and the firefox stuttering fix posted by Raghu), along with the slight mod (volume slider) to the player itself.
Good call on the pre-play buffer message. I hadn't even realized that.
#254 by Stefan on 3/1/07 - 10:36 AM
would you mind posting the 'fixed' PHP script somewhere for download?
thanks
#255 by Rob A on 3/5/07 - 8:14 PM
I have also implemented the Flowplayer anti-leeching feature by developing a php wrapper to perform authentication against the .flv request.
http://ffaat.pointclark.net/blog/archives/129-Flow...
It would probably be simple to combine the two to provide the anti-leeching and the mid-stream seeking function...I'll post more if I get it working.
-Rob A>
#256 by Nathan on 3/8/07 - 4:35 PM
#257 by Michael on 3/9/07 - 7:35 AM
#258 by shrawan adhikari on 3/9/07 - 12:58 PM
and i also wants to to play video using applet or flash player in php
so,plzzz help me
#259 by krs on 3/15/07 - 4:16 AM
I've tried putting in the:
print (fread($fh, 10000));
... code.
I've used FLVMDI with the k switch on my videos. I've also tried it with the golfers.flv. Same result
But again, everything's fine on my WinXP laptop, but on the Linux webserver, it start playing but after using the scrubber, its constant "Buffering Video".
What am I missing on this other server?
#260 by Christian on 3/15/07 - 11:18 PM
#261 by Stefan on 3/16/07 - 8:30 AM
#262 by Christian on 3/16/07 - 9:03 AM
When I use a php script to return the file in chunks it seems to keep the page in a "loading" state so that clicking links doesn't register until the FLV has loaded. Anyone else running in to this?
Ex: ns.play(getfile.php?vid=zzz)
it doesn't happen when you call your FLV directly. Ex: ns.play(vid.flv)
<?php
while(!eof($handle)) {
fread($location,8064);
}
?>
Sorry the code is at work, that's the php getfile (estimated) code returning the FLV file.
http://www.streetologyinc.com/network DOESNT FREEZE
Email me and i will send you a link to the site under development that does freeze using the php call. I don't think I can release the url here (its beta)
#263 by Vincent on 3/16/07 - 10:51 AM
#264 by Stefan on 3/16/07 - 11:07 AM
no it most likely will not.
#265 by Vincent on 3/16/07 - 3:05 PM
#266 by shrawan on 3/17/07 - 9:55 AM
#267 by Jeniffer on 3/18/07 - 5:20 PM
can someone spare a moment and write a short readme file for those of us who are newbees ?
Thanks a million
#268 by Heather on 3/18/07 - 6:31 PM
#269 by Vincent on 3/19/07 - 10:28 AM
#270 by Raghu on 3/20/07 - 5:25 AM
I do have the same problem. The hyperlinks doesn't work when FLV content is from the PHP file. Any way to get around this.
Thanks
#271 by Gizzy on 3/20/07 - 9:21 AM
#272 by Vincent on 3/20/07 - 8:28 PM
Yes u need Macromedia Flash
#273 by mike on 3/21/07 - 11:35 PM
I downloaded the zip file.
unzipped, put it all in the same directory.
Set $path to the directory.
and embedded the video on a html page.
It just won't work.
am I missing some thing?
#274 by mike on 3/22/07 - 12:03 AM
#275 by Mike M. on 3/23/07 - 1:16 AM
#276 by Stefan on 3/23/07 - 8:27 AM
#277 by shrawan on 3/24/07 - 7:44 AM
Olso can anybody have the youtube clone plz if forward to me.
#278 by rob on 3/31/07 - 7:33 AM
http://doublewingsymposium.com/scrubber.html
#279 by PRIX on 3/31/07 - 7:44 PM
I have a project where they don't use php on the server.
URGENT!!!!
#280 by Stefan on 3/31/07 - 8:21 PM
#281 by PRIX on 4/1/07 - 12:12 AM
Anyone who knows if it's possible to do ???
#282 by Shmai on 4/1/07 - 11:53 PM
Speak to me.
Regards,
#283 by Rick78 on 4/10/07 - 1:09 PM
I am interested in getting this to work on my server. I am not an expert in PHP, but have been running a couple of Geeklog sites for a couple of years, and can fumble around with it to get things to work.
My problem is, that I do not understand how to get the files to be recognized. I changed the script to point to my directory with the flv file in it, and the ownership is the web user. I get ERORR: The file does not exist
When I try to open the php page.
Do I have to specify the file name somewhere in the script?
Thanks for any help at all.
Regards,
Rick
#284 by scuty on 4/10/07 - 8:26 PM
#285 by scuty on 4/10/07 - 8:28 PM
#286 by Rick78 on 4/10/07 - 9:20 PM
Just thought I would give a little more info on my server. I have Suse 10 running with Apache 2, MySql, and PHP 5.
My Geeklog site is running fine on this.
I just now installed Xoops and xStreamer and this works with flv files.
However, I would really like to use the solution described here on this page. It sounds very cool.
Thanks again,
Rick
#287 by shelley on 4/16/07 - 4:29 AM
The "Buffering" issue is driving me nuts. I changed the code to:
print (fread($fh, 10000));
... code.
But issue still persists. It shows buffering if the video is scrubbed. Nobody is giving an exact reply for it. Really frustrated :). Please show me where I am going wrong...please....
Thanx in advance
#288 by shelley on 4/16/07 - 5:45 AM
The new phprovider file in the updated link corrects the buffering issue:
http://www.flashcomguru.com/downloads/phpstream.zi...
But the flv file is cached in the users system as in progressive downloads. But rich-media php flv files does not cache the video files in users system, like the real streaming :). This project has got just scrubbing feature.
#289 by Shelley on 4/16/07 - 5:51 AM
A firm in Germany has atlast introduced Digital Rights Management (DRM) for FLV files. Check it out here:
http://www.onlinelib.de/index_EN.html
VCS Live Broadcaster for Adobe" Flash" Player.
#290 by Agent-E on 4/16/07 - 1:37 PM
ns.seek(tofind);
ns.pause();
}else{
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
};
Adding this to the scrub function might help to use the "normal" seek method once a file is fully downloaded.
I haven't tested this which large FLV files yet.
#291 by JBoi on 4/16/07 - 11:32 PM
As its associated with the FLV file extension it kicks in tranparantly. to get the FLV file at a seek point simply add the parameter to the file *.flv?pos=1000 for example, now the webserver will return the file as the php one did.
I wanted to see if anyone might find this useful like me? if so and enough people want it i might consider building a release version.!?
ttfn, JBoi
#292 by Agent-E on 4/17/07 - 7:23 AM
Yes, I would be very interested in a ISAPI extension. Is there something you could share here?
#293 by Stefan on 4/17/07 - 8:35 AM
#294 by JBoi on 4/17/07 - 9:13 AM
The ISAPI Extension is installed per website, the only configuration required is the installation wihtin IIS but that is a trivial job.
You will need to make changes to the flash player though. you dont need as many variables, for example you only need the file name.Everything gets a little easier. :)
I'll see about putting somthing together for a release version. not sure if freeware, postcardware or licence yet. any thoughts?
How would you want to configure the extension? i can think about possibly implementing something.
ttfn, JBoi
#295 by Stefan on 4/17/07 - 9:20 AM
#296 by Rick78 on 4/17/07 - 11:18 AM
Can someone please tell us what we are missing to get the flv files in the directory to be found?
Here is part of my video.php file.
Thanks again,
Rick
//full path to dir with video.
$path = '/var/www/html/home2/video3/';
$seekat = $_GET["position"];
$filename = htmlspecialchars($_GET["file"]);
$ext=strrchr($filename, ".");
$file = $path . $filename;
#297 by JBoi on 4/17/07 - 12:25 PM
I have installed the ISAPI Extension on IIS6 server and also uploaded the Golfers.FLV file
http://www.jasonwhite.co.uk/files/golfers.flv
to get the file at a seek point simply add the parameter "pos".. eg.
http://www.jasonwhite.co.uk/files/golfers.flv?pos=10000" target="_blank">http://www.jasonwhite.co.uk/files/golfers.flv?pos=...
Have a play and test it out in your movie. you will need to slightly modify the movie file source to accomodate this.
This is just a sample to test proof of concept. I think it is quite a bit faster than the php solution, which I dont really like as it feels like a hack.. (im being a snob) :P
ttfn, JBoi
#298 by Agent-E on 4/17/07 - 7:06 PM
Ok swell! Seems to work just fine. I'm really curious about this ISAPI extension, since I'm not such a win-guru myself.
Could you possibly send me a hint or a pice of code for this? Many thanx..
lars [AT] agent-e.nl
#299 by JBoi on 4/17/07 - 8:32 PM
in your scrubber.fla player file you can replace the following lines -
var _vidName= "golfers.flv";
var _vidURL= "http://domain/" + _vidName;
var _phpURL= "http://domain/file.php";
with just one line -
var _vidURL= "http://www.jasonwhite.co.uk/files/golfers.flv"...;
Now replace the following lines -
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
with -
ns.play( _vidURL + "?pos=" + positions[i]);
trace("play " + _vidURL + "?pos=" + positions[i]);
That should just about do it :P
Hope that helps, ttfn, JBoi
#300 by Agent-E on 4/17/07 - 9:13 PM
#301 by JBoi on 4/17/07 - 9:59 PM
Thanks for your interest in the ISAPI, i'm not sure I will release the source code to it though. Although I will more than likely release the Extension itself.
What bits are you curious about, maybe I can answer some questions:)
ttfn, JBoi
#302 by tfair on 4/23/07 - 5:35 PM
#303 by netbouy on 4/25/07 - 12:30 PM
Thanks big time for posting up how to PHPstream. Like most people who end up posting comments, I am another one that cannot figure out to work the application using my own FLVs.
It works fine with the golfers.flv. Even without $path defined in php file. So i figure it would work with my other FLV files.
With golfers it lets me skip to any part.
With my own FLVs it (also) doesn't seek, the buffer clip continues flashing and nothing is played.
Please help?
Big thank you in advance.
#304 by Stefan on 4/25/07 - 12:44 PM
#305 by netbouy on 4/25/07 - 12:55 PM
yup i injected the meta data. I followed your video tutorial that you made on injecting with flvmdi.
what's really funny now is....the application work with 'golfers.flv'. now if i rename it to 'whatever.flv' it won't work. how? ich weiss nicht.
help please?
#306 by Stefan on 4/25/07 - 1:26 PM
#307 by netbouy on 4/25/07 - 2:38 PM
after some hard reviewing. everything turned out alright. I didnt have to define the $path. and everything seeking great. Thanks a lot.
ooookay. so second problem that I've noticed already came up is 'streaming' flvs of 40MB. Doesn't work. no flashing buffer clip. it does:
pause at last point and if you let go of scrubber continue pausing.
press scrubber again and continue playing video.
i changed the script to
print (fread($fh, 10000));
but its still not performing. the change does handle small vids. any advice?
I appreciate the help from before.
#308 by Stefan on 4/25/07 - 2:44 PM
#309 by Remy on 4/26/07 - 10:44 AM
First of all; this streaming solution is great! It all works fine for me when I use it on my own webserver.
Now I'm taking this to another level; I want to implement this flashplayer into my own website which is made in CakePHP. I can still watch the video, but the scrubber doesn't work anymore with Cake. It seems that something is wrong with the redirections of the flvprovider.php . (I had the same issue when I forgot to change the $path variable the first time I used this file)
Is there someone else who uses cake?
Or any suggestions to solve this problem?
Thanks!
#310 by tfair on 4/30/07 - 5:48 PM
#311 by Agent-E on 5/2/07 - 12:59 PM
I've looked around quite a bit, some developers say they have a solution, uptill now I have found none that actually work..
#312 by Juliano on 5/19/07 - 10:36 PM
#313 by book on 5/29/07 - 2:46 PM
Have you tried adding something like "r="+random(999) to your flv string (ex http://something.com/golfer.flv?r="+random(999))?
#314 by Eugene on 5/29/07 - 3:02 PM
Thanks
#315 by book on 5/29/07 - 3:07 PM
#316 by Juliano on 5/29/07 - 4:13 PM
http://www.aeon.jp/biz/
A FLV loads a swf??
When you click at the buttons loads another flv...
Does anybody know??
#317 by Lars on 6/1/07 - 9:46 AM
$path = '/var/www/test/';
/var/www/test# ls -anhl
total 5.9M
drwxr-xr-x 2 0 0 1.0K Jun 1 10:42 .
drwxr-xr-x 3 33 33 1.0K Jun 1 10:40 ..
-rw-r--r-- 1 0 0 994 Jun 1 10:43 flvprovider.php
-rw-r--r-- 1 0 0 2.3M Nov 2 2005 golfers.flv
-rw-r--r-- 1 0 0 2.6M Nov 4 2005 phpstream.zip
-rw-r--r-- 1 0 0 1.1M Nov 3 2005 scrubber.fla
test:/var/www/test# flvtool2 -U golfers.flv
test:/var/www/test#
#318 by shelley on 6/3/07 - 3:06 PM
It is possible to prevent caching of flv files and playlist. Please check my website and comment whether the flv or playlist has cached...
http://www.medicoexams.com/videotest/video.html
Regards
#319 by Nicolas Elizaga on 6/3/07 - 4:53 PM
#320 by Katia Kamiko on 6/7/07 - 4:23 PM
#321 by Qurban Ali on 6/8/07 - 8:23 AM
#322 by chall3ng3r on 6/10/07 - 10:10 PM
can i scrub the flv on server using php, whitout sending get request from client swf?
thanks,
// chall3ng3r //
#323 by Shelley on 6/12/07 - 5:13 AM
No probs. I will set it up for you..if you want, even without the files caching on users server. You may contact me at my e-mail id:
shelleytvm@yahoo.com
#324 by bXa on 6/15/07 - 1:45 PM
how can i with php set that it changes videos dynamicly?
file=nev.fvd
i don't understand this... it plays every vid i put in that var, but i don't know how to use player for multiple vids :)
#325 by tony on 6/20/07 - 1:46 AM
#326 by David Harrison on 6/20/07 - 6:43 AM
Is there a way to make flvmdi output offsets of the key frames in the unmodified source?
#327 by just_me on 6/21/07 - 3:42 PM
#328 by BORAT on 7/2/07 - 9:01 PM
I have injected the flvmidi and the player works great except for whe I scribe ahead in the video it buffers and then stats the video from the beginning whether I scribe ahead of backward. Can anyone assist me with this?
Thanks!
#329 by lazycat on 7/3/07 - 2:12 PM
Note, it's 2.2 an later, source needs to be changed if you want to port it to 2.0 or earlier. Not so flexible as a PHP script, but should provide much better performance, as PHP interpreter is not loaded for every seek request.
FYI,
lazycat
#330 by Xia Tian on 7/19/07 - 2:07 PM
Excellent work by the way.
/**
*
*/
package com.egm.ui.action;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
*/
public class StreamingVideoController
{
private static final Log log = LogFactory
.getLog(StreamingVideoController.class);
private static final int HEADERLENGTH = 9;
public static void handleVideoStreaming(HttpServletRequest request,
HttpServletResponse response) throws IOException
{
RandomAccessFile raf = null;
OutputStream outputStream = response.getOutputStream();
try
{
String positionStr = request.getParameter("position");
// Default 0 if not passed in
positionStr = positionStr == null ? "0" : positionStr.trim();
String fileName = request.getParameter("file").trim();
if (log.isDebugEnabled())
{
log.debug("positionStr/" + positionStr);
log.debug("fileName/" + fileName);
}
long position = Long.parseLong(positionStr);
response.setContentType("video/x-flv");
// For now use hardcoded path
raf = new RandomAccessFile(new File(
"/" + fileName), "r");
byte header[] = new byte[HEADERLENGTH];
raf.read(header);
if (position > 0)
{
outputStream.write(header);
}
raf.seek(position);
log.debug("Start to streaming the file");
byte[] data = new byte[32768];
int noOfBytes = raf.read(data);
while (noOfBytes != -1)
{
outputStream.write(data, 0, noOfBytes);
data = new byte[32768];
noOfBytes = raf.read(data);
outputStream.flush();
}
//
log.debug("File streaming done");
}
finally
{
try
{
outputStream.close();
}
catch (Exception e)
{
log.error("Failed to close the http response out stream", e);
}
if (raf != null)
{
raf.close();
}
}
}
}
#331 by Xia Tian on 7/19/07 - 2:27 PM
outputStream.write(Base64.decode("RkxWAQEAAAAJAAAACQ=="));
You need to have a Base64 class which will decode the string to byte. See this link for example.
This is fantastic. Thanks for the excellent work.
#332 by Xia Tian on 7/19/07 - 6:42 PM
#333 by Stefan on 7/19/07 - 10:25 PM
#334 by Free Spyware Software on 7/21/07 - 11:33 PM
#335 by Bonal on 7/23/07 - 6:43 PM
#336 by Cristiano on 7/25/07 - 9:52 PM
#337 by Stefan on 7/26/07 - 8:41 AM
#338 by JBoi on 7/26/07 - 9:40 AM
:D
#339 by Bob on 7/29/07 - 1:58 PM
#340 by Bob on 7/30/07 - 2:27 PM
www.flashcomguru.com/downloads/scrubber.zip
#341 by Christian / Jon on 7/30/07 - 6:31 PM
Just to reiterate the problem, your flash player loads an FLV using a gateway file (AS2 ex: play('getfile.php?vid=golfers')) the HTML page becomes unresponsive until the FLV loads entirely.
I tried changing content-type headers, I tried everything... and the only "solution" seemed to be this:
AS2 code: play('getfile.flv?video=golfers');
Use an htaccess file to make "getfile.flv" point to "getfile.php"
The call to getfile.flv?video=golfers will locate your golfers.flv file and output it like this: $location = 'uploads/golfers.flv'
header('Content-type: video/x-flv');
header('Content-Disposition: inline; filename="'.uniqid('vid').'.flv'.'"');
header('Content-Length: ' . filesize($location));
header("Location: ".$location);
Just print headers to trick flash player. If you found another way to do this, then please share.
#342 by Tersis on 8/2/07 - 3:46 PM
I'm using PHP code to "stream" a flv file, masking the absolute address...
It worked for me... on Firefox!
In IE6, the "header("Location: ".$location);" crashes. It doesn't show the video. Maybe IE misunderstands the correct path...
#343 by Stefan on 8/14/07 - 3:46 PM
http://www.flashcomguru.com/index.cfm/2007/8/14/ph...
#344 by Nelson Reis on 8/28/07 - 4:38 AM
#345 by Stefan on 9/3/07 - 10:21 AM
http://flashcomguru.com/downloads/phpstream_update...
#346 by Mocanu Ciprian on 9/7/07 - 8:50 AM
#347 by Igor on 9/14/07 - 7:29 AM
God knows how long i been looking for the page.
#348 by askingForPerl on 9/16/07 - 8:33 PM
#349 by Sandro Bilbeisi on 9/18/07 - 9:09 PM
http://www.kaourantin.net/2007/08/what-just-happen...
the scrubber and provider will now be updated for the new metadata structures (which are quite different from FLV) from the onMetaData seek points array
unfortunately, still no news about selective HTTP ranges and caching
#350 by melanie on 9/19/07 - 9:56 AM
"C:/phpstream/video/"
but i still show nothing on the scrub.html
Do i still need to change anything on the actionscript for the .fla file?But i know nothing on action script.
I appreciate if anyone can help.
#351 by Michael on 9/26/07 - 1:23 PM
I have a Servlet that returns the files. In your app I have to set a video-dir. Can I change the video dir to the Servlet-Url
#352 by Sal on 9/27/07 - 5:43 PM
could php streaming be used by the flex videoDisplay component? if so, does anyone have a sample?
#353 by Drupal on 9/28/07 - 12:35 AM
#354 by Hayden on 9/29/07 - 5:44 PM
#355 by Stefan on 9/30/07 - 7:22 PM
#356 by Pawel on 10/2/07 - 1:30 PM
#357 by Jarrod on 10/8/07 - 8:03 AM
http://www.syn-rg.com.au/Creative/yudy/synrg_motio...
I have a simple question for you, when i replace the video file, the bluffering wont work. (you will see it when u drag the slider),I made my video file setting as .VP6, any solution?
thanks
#358 by Naicu octavian on 10/8/07 - 3:12 PM
header("Content-Length: " . filesize("your FLV file here"));
#359 by howah on 10/9/07 - 8:22 AM
$path = 'C:\Program Files\EasyPHP1-8\www\uploads\golfers.flv\';
but the next line I still get a Parse error line 21
if((file_exists($file)) && ($ext==".flv") && (strlen($filename)>2) && (!eregi(basename($_SERVER['PHP_SELF']), $filename)) && (ereg('^[^./][^/]*$', $filename)))
it should be nothing wrong, can someone help me, or do I have to make html page?
thnx in advance
#360 by howah on 10/9/07 - 8:23 AM
$path = 'C:\Program Files\EasyPHP1-8\www\uploads\golfers.flv\';
but the next line I still get a Parse error line 21
if((file_exists($file)) && ($ext==".flv") && (strlen($filename)>2) && (!eregi(basename($_SERVER['PHP_SELF']), $filename)) && (ereg('^[^./][^/]*$', $filename)))
it should be nothing wrong, can someone help me, or do I have to make html page?
thnx in advance
#361 by sachin on 10/18/07 - 7:39 AM
I want to make small apllication of showing video.
can anyone give me detail instruction how to do this ? (or how to configure code.)
#362 by Syed Nazir Razik on 10/18/07 - 1:16 PM
#363 by Lance on 10/25/07 - 3:26 PM
#364 by Stefan on 10/25/07 - 3:32 PM
#365 by Dennis Plucinik on 11/8/07 - 4:54 PM
#366 by kk on 11/9/07 - 6:46 AM
in appserv when I run the script, it ask me download the video.
in ubuntu 7.10, it just display the binary weired character instead of playing.
#367 by Evan on 11/19/07 - 8:18 PM
#368 by Lance on 11/19/07 - 8:34 PM
http://courierwebcasts.com/vidplayer/scrubber.zip
I would appreciate an e-mail if you decide to use it, just to be able to pat myself on the back ;) (Go to http://www.courierwebcasts.com and click the contact us link at the bottom of any page) or post to this thread and let me know.
Included in the zip file is:
1. The source .fla
2. The font used for the playtime/duration (it's digital readout, available from http://www.1001freefonts.com)
Just a note of caution, that I tell everybody to whom I give the source.
I have a bad habit of not (thoroughly) commenting my code, so if you have any questions, feel free to drop me a line.
There may be a better way to accomplish some of the functionality...Im no real Flash genius. Let me know if you find anything that could be done better.
#369 by Dan on 12/4/07 - 4:18 PM
#370 by Lance on 12/4/07 - 4:46 PM
#371 by Dan on 12/4/07 - 4:51 PM
I wonder though if you could explain a little more about passing a GET variable through to the vidName variable in the FLA? The page that I have the swf loaded on is receiving a variable ?vidName=hollow.flv and I wondering how do I tie the vidName variable in the FLA file to this? Thank you again for any help you might be able to give.
#372 by Lance on 12/4/07 - 5:02 PM
Since you're using this approach, I'll assume you have PHP installed on your server.
<?php
//first, assign the get variable from page to $file
$file = $_GET('vidName');
?>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=7,0,0,0',
'width','365','height','310','align','middle','src'
,'/scrubber/scrubber?vidName=<?php echo($file)?>','quality','high','bgcolor','#ffffff'
,'wmode','transparent','allowscriptaccess','sameDomain'
,'pluginspage','http://www.macromedia.com/go/getflashplayer'
,'movie','/scrubber/scrubber?vidName=<?php echo($file)?>' ); //end AC code
</script><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/" target="_blank">http://fpdownload.macromedia.com/pub/shockwave/
cabs/flash/swflash.cab#version=7,0,0,0" width="365" height="310" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/scrubber/scrubber.swf?vidName=<?php echo($file)?>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="transparent" />
<embed src="/scrubber/scrubber.swf?vidName=<?php echo($file)?>" quality="high" bgcolor="#ffffff" width="365" height="310" wmode="transparent" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
#373 by Lance on 12/4/07 - 5:03 PM
#374 by Dan on 12/4/07 - 5:59 PM
the variable is being passed properly to the page but the swf continues to just buffer - I am wondering how is the variable being passed to the flash file without flashvars? In the comments within the FLA it says
//Declare vidName here, if not passing through a GET variable (all vidName are commented out)
and then the var _vidURL is
var _vidURL = "http://my.videourl.com/mediaflv/" + vidName;
but where does it obtain vidName from?
Thanks Lance - I appreciate your help.
#375 by Lance on 12/5/07 - 4:53 PM
The swf gets the variable from when you place the swf on the page. (Note the src, movie params, and the embed tag, the ?vidName = part). You could test to see if it's correctly retrieving the vidName variable by putting a dynamic text box on the stage, name it my_txt, and then add my_txt.text = "vidName" in the actionscript. That won't show the variable when you test the movie in flash, but it should show up when you run it in a browser, with ?vidName= at the end of the page URL.
You may want to try to hard-code the vidName variable to make sure that everything is working OK. By doing that, you can test the movie in flash to see that the error doesn't lie somewhere else.
Hope that helps.
#376 by tulip on 12/6/07 - 9:48 AM
"It is possible to prevent caching of flv files and playlist. Please check my website and comment whether the flv or playlist has cached...
http://www.medicoexams.com/videotest/video.html&qu...;
I tried video playing from link above and found that caching is appears, but when i close IE flv content is removed from IE cache.
Just wonder how to do that, think it's swf feature, am i right ?
#377 by Clayton on 12/8/07 - 5:20 AM
I think I need to do some looking behind the scenes to find out how the requests are being made (to the web server) from the browser.
#378 by Tommy on 12/10/07 - 3:47 PM
Did I can help in creating a list XML to choose videos?
Regard Tommy
#379 by Christofle on 12/11/07 - 1:18 AM
Just a note: if your flv is larger than the maximum php script size in php.ini NOTHING will happen: blank page, no entry in access_log for flvprovider.php, etc. The fix is to change:
print (fread($fh, filesize($file)));
to:
print(fread($fh, 1024*8)); <== set to less than the max script size in php.ini
flush();
Once you've done that, it should fly right along.
hth,
Christofle
#380 by Jonathan on 12/11/07 - 3:53 PM
I would like to know how to implement the xmoov with jw flv player, I realy like this player and it has a lot of futures but I am not a flash expert and need to a know how to do this.
Does any one have implemented this before? Does any one have an example code ?
Thank you for our huge contribution!!
Jonathan
#381 by Alex Wallace on 12/20/07 - 7:45 PM
I'm using a workaround but read my data from the url itself... Is there a way to actually pass http params to the server script?
#382 by meshkowich on 12/22/07 - 3:41 PM
#383 by software download on 1/3/08 - 11:13 PM
#384 by elbepower on 1/9/08 - 7:50 PM
bin ein ziemlicher neuling/ahnungsloser in sachen php.
we genau binde ich das video in meine index.php ein?! hat jemand da ne explizite vorlage ? und wie rufe ich das video online auf ?
ein tutorial auf deutsch f
#385 by LJ on 1/10/08 - 8:36 AM
Everything you need is right here on this page!!
#386 by Nicolas on 1/10/08 - 12:58 PM
Someone could help me ?
Thanks.
#387 by Alex Wallace on 1/10/08 - 7:23 PM
#388 by elbepower on 1/10/08 - 10:58 PM
scrubber.fla und der videodatei an sich ben
#389 by Genaro Rocha on 1/11/08 - 2:29 AM
#390 by naglma on 1/17/08 - 12:44 AM
I'm running into THE problem with the page links not working while the the flv is loading, which is frustrating, since the page links work fine on this site with the same player. I found that the links DO work in the PC Safari, but not with Firefox or IE.
I read most of the post looking for the solution for this and haven't found any other articles on the internet describing that problem. Seems like it works fine for most and fails for the others. I've almost come to the conclusion that its a server issue.
... some time passes ...
I found that links to the same domain fail, while links to other domains succeed. This must mean that the server is refusing to process a second request for the session until the current request for the flv file is finished. Note that any request to the same domain (my domain) are refused if the same session is associated. If I open up another browser and go to the domain while the first browser is downloading, then there isn't any problem.
I really like the script. Thank you.
#391 by naglma on 1/17/08 - 1:04 AM
The last post describes the page link problem while the video is downloading.
continued:
The server creates a session lock when a session is created. My purpose for the flv provider is to validate some session information, and then deliver the flv if that information is valid (logged in). After the session in validated, then the video is output via the provider. If the session is not written and closed (via session_write_close();) then the lock remains. If the page link tries to restart a session with the same ID, then that session must wait until the feed provider closes it.
Anyway...
If you open a session before you output the flv, then make sure you close it before outputting the video.
session_write_close();
mutex
semaphore
lock
block
link hangs
broken links
broken hyperlinks
#392 by Jane on 1/17/08 - 7:25 AM
#393 by Andrew Brook on 1/17/08 - 12:46 PM
#394 by ETIENNE on 1/17/08 - 1:38 PM
#395 by Marc on 1/20/08 - 12:49 PM
#396 by logicmania on 1/23/08 - 3:46 PM
I have developed a player using XMOOV.php.
Actually i didn't change the php.The player is able to seek to any position in the cached file and it can start caching anywhere from the file.I have uploaded it in my blog.
http://logicmania-lab.blogspot.com/2008/01/flash-f......
visit this link to download the files
please let me know your suggestions and comments.
#397 by Maikel Sibbald on 1/29/08 - 6:22 AM
#398 by Oyun indir on 2/8/08 - 8:04 PM
Thanks again!
#399 by atifah on 2/11/08 - 8:13 AM
i need to as that i wanted to convert videos into flash for avi, and other video formats ...
how doi use this code...i have plaed it in my www folder then i also reated another html doc inwhich i created a file input text field and named it'file' as on next page it is file ... then i executed it and browsed a file that was video with wmv extension ..but nothing happened so i need to ask how should i embed this code in my file please help me out. thanx
#400 by kent on 2/19/08 - 5:54 PM
Added milisecond position seek, and cache future.
http://www.guarana.cc/kent/streamSource.php?v=0.4
#401 by Stefan on 2/19/08 - 7:33 PM
#402 by ArtKohn on 2/20/08 - 1:25 AM
--
Two quick questions: First, does the current Flash Video Encoder insert the metadata that xmoov-php needs to operate or do I still need to use the FLVMDI to inject the required data?
--
Second, I am concerned about the ability of xmoov to scale up. The web site says The most important factor to know is the number of simultaneous PHP connections your web-server allows. Internet video publishers wanting to broadcast live streams or serve thousands of simultaneous connections must rely on streaming server systems such as Adobe's Flash Media Server.
--
Is this still the case? My hosting company says that their grid system can support any number of simultaneous PHP connections. Does this seem likely? If the site is a big success, and if we a thousand simultaneous connections, is the xmoov-php approach going to become a problem?
Thanks,
Art
#403 by kent013 on 2/24/08 - 4:47 AM
http://d.hatena.ne.jp/kent013/20080224/1203827752
#404 by Rob on 2/26/08 - 5:05 PM
#405 by Sergei on 3/1/08 - 9:49 PM
#406 by Geoff on 3/7/08 - 6:55 PM
I have experienced a various delay while scrubbing past or before buffered time. This delay is from when the video plays and when Netstream.Buffer.Full is dispatched. Sometimes they are right on and other times the video plays .5 - 2 sec before Netsream.Buffer.Full is dispatched. You can even notice it using the player above. You will see the file play while the buffer text is still showing. Is there a more precise way to determine when a file actually starts playing.
Thanks
#407 by shekar on 3/12/08 - 1:20 PM
Can any body help me to know that
how will u find a video is streaming or not using PERL please......
#408 by Marc on 3/14/08 - 3:43 PM
I've been looking at different dns settings and htaccess rewriterules but nothing seems to cut the case.
Any suggestion on how I could make this setup work?
#409 by Vinay on 3/15/08 - 4:02 AM
I am not able to get this working. I am using EasyPHP as my php server and edited the scrubber.fla to point to http://127.0.0.1/folder/movie.flv The move starts to play and when i seek to a different location, the URL gets generated ( lay http://127.0.0.1/phpstream/flvprovider.php?file=go...;
However, Nothing happens in the video. It just pauses. Does anyone know wat i am doing wrong? Is it ok to use EasyPHP as the PHP server?
Thanks,
-Vinay
#410 by Vinay on 3/15/08 - 4:33 PM
Any help would be greatly appreciated.
Thanks,
-Vinay
#411 by billh on 3/16/08 - 5:04 AM
There are bugs when you set the autostart to false.
The seek bar just looks very weird when the autostart is false.
#412 by ArtKohn on 3/17/08 - 4:29 AM
Is there a workaround for this? Aside from having many, many servers is there a way to use Xmoov when you want to serve many simultaneous connections?
#413 by Kevon on 3/20/08 - 3:32 PM
#414 by vimal on 3/27/08 - 6:13 AM
"golfers.flv" it plays, but when the scrub is dragged to a different portion in the timeline, the video doesnt start from that point. Rather it continues to play from the start.
Is there any particular way of conversion for a streaming video
please give a solution.
thanks
#415 by Vova on 4/18/08 - 1:38 PM
#416 by Nejd on 4/22/08 - 4:22 PM
I have tried this pseudo streaming method and it works very good.
Thank you for all how has contrubuted to implement or update this script.
steps that I performed to make it working:
1. download phpstream_update.zip
2. open the scrubber_flash8.fla (or scrubber.fla) and modify the action script:
//----- BEGIN ------
var ns:NetStream = new NetStream (nc);
var domain:String = "http://your_domain.com/folder_where_xmoov_php"...;;
var bandwidth = "mid"; //low, mid or high
var _vidName:String = _level0.movname;//"golfers.flv";
var _vidURL:String = domain + "/" + _vidName;
var _phpURL:String = domain + "/xmoov.php" + "?file=" + _vidName + "&position=" + 0
// ---- END ----
Note that _vidName become "_level0.movname" that's the name of the .flv video.
3. Publisch the fla (create the swf player)
4. Embedd the player into a html file:
// --- BEGIN ------
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cab...; width="400" height="300" id="player" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="player.swf" />
<param name="FlashVars" value="movname=test.flv" />
<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
<embed src="player.swf" FlashVars="movname=test.flv" quality="high" bgcolor="#ffffff" width="400" height="300" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
// ---- END -------
- you must change test.flv to the name of your flv-video (2 times).
- player.swf is the saved name after the publisch of the fla file (2 times).
5. last changes to make in the xmoov.php:
// points to server root
define('XMOOV_PATH_ROOT','/path_to_xmoov.php/');
// points to the folder containing the video files.
define('XMOOV_PATH_FILES','relative_path_to_flv_video/');
sorry for my englisch and good luck.
#417 by Andy on 4/22/08 - 10:17 PM
Is there a way to make the player switch to using the local copy once the video file has completed the download?
This would eliminate many server roundtrips if users jump around alot in the video, or hit rewind a several times.
#418 by JOKERz on 4/23/08 - 4:17 PM
For the how to
#419 by Murtaza on 4/25/08 - 12:15 AM
#420 by Rich Kurtz on 4/28/08 - 8:41 PM
I have Flash Player 9.0.124 installed on my desktop system, also running XP SP2.
I took the code from the download at
http://www.flashcomguru.co.uk/index.cfm/2005/11/2/...
Modified it to point to the directory I keep my movies in on the Apache server and put a PHP/HTML wrapper around it as follows: streamflv.html
<?php ob_start(); ?>
<html>
<head>
<title>Kurtz Family Web Site - Test</title>
</head>
<?
/*/
security improved by by TRUI
www.trui.net
Originally posted at www.flashcomguru.com
//*/
//full path to dir with video.
$path = 'D:/apache/htdocs/movies/';
$seekat = $_GET["position"];
//$filename = htmlspecialchars($_GET["file"]);
$filename = 'golfers.flv';
$ext=strrchr($filename, ".");
$file = $path . $filename;
if((file_exists($file)) && ($ext==".flv") && (strlen($filename)>2) && (!eregi(basename($_SERVER['PHP_SELF']), $filename)) && (ereg('^[^./][^/]*$', $filename)))
{
header("Content-Type: video/x-flv");
if($seekat != 0) {
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
$fh = fopen($file, "rb");
fseek($fh, $seekat);
while (!feof($fh)) {
print (fread($fh, filesize($file)));
}
fclose($fh);
}
else
{
print("ERORR: The file does not exist"); }
?>
</body>
</html>
When I launch streamflv.html, I am asked if I want to open this with the default application, which for me is SeaMonkey. Then the borwser (SeaMonkey) displays the raw data rather than Flash player being invoked. I'm sure I'm missing some very basic concept here, like having to define an object for the movie, but all indications I got from reading posts here did not seem to indicate that was necessary.
Does anyone have an example of what the HTML should look like?
#421 by Sandro Bilbeisi on 4/28/08 - 9:14 PM
don't even think of adding an html wrapper!
the flvprovider file must not even output a single spurious character!
the flvprovider must start with '<?' and end with '?>' and must not employ output buffering at any time.
If you want an html page to present the video, you must create one which embeds the flash scrubber swf (which in turn will access binary data net-piped from flvprovider).
The flvprovider php should not be modified if you dont't know what it actually does (it's a binary provider, not a text/html provider !!)
#422 by Rich Kurtz on 4/28/08 - 11:05 PM
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
<param name="movie" value="myContent.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="myContent.flv" width="780" height="420">
<!--<![endif]-->
<p>Alternative content</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
and perhaps an onClick event that invokes flvprovider.php. True, false or not even in the park?
#423 by Rich Kurtz on 4/29/08 - 3:51 AM
I have it streaming to an external FLV viewer but I can't make it work inside the browser.
#424 by Sandro Bilbeisi on 5/2/08 - 2:29 PM
could you please post a URL to examine ?
#425 by Cyllya on 5/5/08 - 7:40 PM
#426 by dizi izle on 5/18/08 - 7:40 PM
Posted At : November 2, 2005 3:06 PM | Posted By : Stefan Richter | Related Categories: Applications
Following a really interesting thread on the chattyfig Flashcomm list I have now been able to put together a simple video player which is capable of requesting and playing parts of a flv video file that have not previously been downloaded.
This is a neat feature because it is usually only possible to play and seek to a part of a video that has already been downloaded unless you deploy a streaming media server.
Here's the working example. You need Player 8 for this but that's only because I encoded the video using VP6. The rest is compatible with Player 7.
I have uploaded my progress and included all sources.
It should be noted that due to the support of Buraks it was much easier to implement this idea. A new version of flvmdi injects an object containg two arrays into the flv's metadata. It contains the exact starting position in bytes and timecode of each keyframe. Using this information we can request any part of the flv file starting at a specified keyframe. Check this post for more info on flvmdi - the injection is NEEDED if you want the PHP seeking to work.
Thanks to everyone on the chattyfig list who contributed to this and also to Brian Bailey for blogging about his efforts. Thanks also to Lee Brimelow whose scrubber I have used and modified for this app.
*** UPDATE ***
I have made some small changes now:
- the 'buffering' no longer appears once the video has ended. This was done by simply introducing a new variable 'ending' and checking for a NetStream.Buffer.Flush message.
- loading bar shows the download progress again, although this is not that important as you can seek beyond that point anyway :-). But it will be good to further extend the app so that it will not request the file via PHP once it has loaded completely. We could seek normally once download is complete.
- source files have been updated
- another update (09/2007): updated sources by xmoov.com are now available at http://flashcomguru.com/downloads/phpstream_update...
UPDATE: Steve Savage has now ported this to Coldfusion: http://www.realitystorm.com/experiments/flash/stre...amingFLV/index.cfm" target="_blank">http://www.realitystorm.com/experiments/flash/stre......
Creative Commons License
This work is licensed under a Creative Commons Attribution 2.0 England & Wales License.
[Comments] Comments ( 426 ) | [Email This] Email This | [del.ico.us] del.icio.us | 289361 Views
Related Articles
* How to Stream H.264 Flash Video *Today* (December 18, 2007)
* Flash Video Streaming via PHP - Optimized by xmoov.com (August 14, 2007)
* Let it stream - with PHP (March 2, 2007)
Comments
[Add Comment]
Great stuff! I would add some logic so that if the video is already available it will load from the current stream and not start another to minimize server access. That being said this could definitely be very useful while waiting on Red5!
# Posted By Patrick Mineault | 11/2/05 4:03 PM
ah yes good point.
I am very excited about Red5. What I like about this approach is its easy implementation. A webserver and PHP - it doesn't get much easier than that.
# Posted By stoem | 11/2/05 4:12 PM
Cool thanks for putting this together. This could save some folks some serious $ on streaming fees... ;)
Also I noticed that the video doesn't really end well...gets to the end and flashes Buffing Video. Perhaps some simple check to autoRewind or something.
Thanks again!
# Posted By sean moran | 11/2/05 4:45 PM
Awesome! Now all I need is flvmdi for OS X and I'd be all set. Thanks so much for putting this together. This could be *huge* considering how many people there are out there with PHP on their boxes.
# Posted By Todd Dominey | 11/2/05 9:41 PM
Once again I applaud... good job man!
# Posted By Jake Hilton | 11/2/05 9:59 PM
Will you marry me? *kiddin* You are a GodSend! Thank you so much. Love your site. This will help ease my anxiety while waiting for Red5.
# Posted By C. Jason Wilson | 11/3/05 4:14 AM
Hi stefan,
I had checked your php file. You are reading whole flv file at a time, i think this will become then progressive download. You need to read file from the seek point. I will suggest you to improve your coding in php to read from any given location by clicking on progress bar while playing flv.
# Posted By Ritesh Jariwala | 11/3/05 4:52 AM
Ahh, just checked it you got seek point position too fine.
# Posted By Ritesh Jariwala | 11/3/05 4:56 AM
guys you are making me blush. I don't feel like I deserve credit - I don't know any PHP code, I just modified what was posted.
Glad to hear it's useful to you though. Make sure to email me if you improve it. I think Patrick Mineault's suggestion is a good one, once the file has been downloaded completely we should use the cached version and not request the file again.
# Posted By stoem | 11/3/05 9:20 AM
Trying on Safari I see that every time you scroll the playing position, the browser interprets the new call to php as an error.
Also, I think is not possible to replay the video from cache if you skip some part of the video, as the stream changes everytime you change the play position you get only the remaining part and not the full video, is this right?
anyway, good stuff, keep it going ;)
# Posted By freddy | 11/3/05 5:33 PM
Hi,
I tried to use this method with a huge video (68Mo, 40mn) and the player is freezing when i try to seek.
Do you think it comes from PHP script or actionscript ?
Anyway, very good job, i really like it and would like to enhance the player .
# Posted By Kimmy | 11/3/05 9:59 PM
Hi,
I think for a huge video, the search in the actionscript could get a big performance improvement by using binary search.
Best regards,
Burak
www.asvguy.com
# Posted By Burak KALAYCI | 11/4/05 12:13 AM
Hi kimmy,
Post the link of big flv somewhere, i like to test.
# Posted By Ritesh Jariwala | 11/4/05 4:12 AM
Hi everybody,
I think the problem do not come from actionscript as it freezes when i try to seek to the begining of the movie.
The actionscript routine should retrieve the number of the keyframe very quickly in this case so probably it comes from PHP.
I got another question, what should happen if a user try to play a file bigger than the space defined for Temporary Internet Files. Would it crash ?
And one more question : i can't understand why the movie will be downloaded even if you seek to the end of the movie at the begining.
# Posted By Kimmy | 11/4/05 11:37 AM
Sorry i got another question :
Why classic players are not able to read a FLV with keyframe location metadata injected in it ?
Regards
# Posted By Kimmy | 11/4/05 11:42 AM
Kimmy question 1: I don't think your temporary internet files play any role here. If the file is too big to be cached then it probably won't be cached.
I would also assume that the 'slowness' may come from PHP but I do not know.
Question 2: What do you mean by 'classic players'? The keyframe info can be read by any player which 'listens' for the 2 new arrays. However only flvs injected with flvmdi27b will hold this info.
# Posted By stoem | 11/4/05 11:46 AM
Here is the link for huge FLV file :
http://www.rich-media-design.com/test/scrubber.htm......
Concerning classic players, i understand that keyframe info can be read by player asking for this metadata. But what i mean is that with 'classic players' (not yours) i can read a FLV file without keyframe info metadata but not FLV file containing these metadata.
Strange as other players do not process such metadata so it should not create an issue.
Regards
# Posted By Kimmy | 11/4/05 1:45 PM
Hi,
i've tried ... everything works fine,
but I actually dont know how to use Buraks FLVMDI. I dont which metadata should I add to my FLVs.
With golfers.flv everything goes great. With my FLVs it doesnt SEEK.
Please tell me where is the problem
Thanks
Tom
# Posted By Tom Krcha | 11/4/05 4:39 PM
Tom,
I'll post an article shortly that shows you how it's done.
# Posted By stoem | 11/4/05 4:53 PM
thanks!
Kind regards
tom.krcha.com
# Posted By Tom Krcha | 11/4/05 4:55 PM
new blog post added, see homepage
# Posted By stoem | 11/4/05 5:30 PM
There's a problem in the PHP portion of the script, the lines:
while (!feof($fh))
{
print (fread($fh, filesize($file)));
}
..are causing the problem. When you fread($handle, $buffer_size), the interpreter allocates $buffer_size bytes for reading. This causes a problem with large files or, to be more specific, files larger than the memory available to the PHP script. Changing the above to this:
while (!feof($fh))
{
print (fread($fh, 10000));
}
Fixes the problem. You can use a much larger buffer (up to little less than your script memomry limit), but please do some performance testing first.
# Posted By Michal Tatarynowicz | 11/17/05 9:11 AM
thanks Michael,
your comments and fix is much appreciated. However I never claimed that this script is anywhere near production ready, it's merely a proof of concept. In fact I don't even know PHP very well so keep that in mind. Anything posted on my site is meant to be for demo purposes only.
Again, thank you very much for your comments.
# Posted By stoem | 11/19/05 1:10 PM
i try. but not working in file 15mb. flash not send post.
# Posted By mario | 11/21/05 1:00 PM
Hi,
Thanks to Michal's new PHP script, we were able to play a huge video using PHP streaming method
(about 90Mo / 40 Min).
Performance seem to be ok when several users try to get the video.
We are looking for a PHP expert that could enhance the script in order to increase performance.
Here is the sample (Flash Player 8 is needed as we used On2 VP6 codec) :
http://www.rich-media-project.com/test4/cool.html
# Posted By Kimmy | 11/22/05 9:40 AM
I am updating the downloadable files to reflect the changes proposed by Michal. Thanks!
# Posted By stoem | 11/22/05 11:36 AM
Hi threre!
I'm not an expert in PHP, so. I came here to ask about the path. I'd like to make this video works through the internet. How should I set this path: 'C:/.../clips/'
I tryied 'http://www.myurl.com/videos/' and I put my flv into the folder videos, but is not working.
I'll appreciate your help,
Thanks
Fabio
# Posted By Fabio | 11/30/05 4:25 AM
Fabio,
that path is a local webserver filepath, it cannot be substituted by a URL. It will only work if you have access to a webserver running PHP.
# Posted By stoem | 11/30/05 9:13 AM
ThanKs Stoem
It's working now!
Do you know where can I find a FLA sample with a component lists with xml to apply to this?
Best,
F
# Posted By Fabio | 11/30/05 8:23 PM
Stoem,
What should be wrong with my playear, when I drag the button on the progress bar the video doesn't go to the frame and the buffering message start blinking without stopping.
Thanks for your help,
Fabio
# Posted By Fabio | 11/30/05 10:22 PM
Am trying to build this seek-> call php functionality into the FLVPlayback component. Have hit a hurdle when trying to overload seek. Anyone have any ideas how to go about this?
# Posted By Rob Sandie | 12/2/05 7:06 PM
This is exactly what I need... But I need it for .NET. Has anyone converted the script to ASP.NET or Classic ASP?
# Posted By David | 12/8/05 8:22 PM
not that I know of.. I wish someone did though!
# Posted By stoem | 12/8/05 8:57 PM
When I try to open scrubber.fla in flash MX 2004
it says unexpectet file format. Is the zip file corruptet or ?
# Posted By Klaus | 12/16/05 6:38 PM
you may need Flash8 to open it
# Posted By stoem | 12/17/05 9:54 AM
Really good article !
I'm on a big scholar project with it but i try to find a way to use it with flvplayback (or netstream but i don't know how to inject cue point to the flv correctly, and dynamically) ... because of netstream doesn't support cuepoint adding ! ThX
Sorry for my english ...
# Posted By Alexandre | 12/17/05 7:54 PM
Hello everyone,
This is a real good one. I am trying to use the Media Server only for realtime streams for a project of mine so this could help. What could be some problems using this in a project with a lot of users? Has anyone tried? Thanks a lot.
# Posted By Can | 1/3/06 12:09 AM
Sorry, one more thing. Does this work with FLVTool2? a similar tool for adding metadata for flvs? could it?
# Posted By Can | 1/3/06 12:37 AM
We haven't tested this with a lot of users and big files so I am unable to comment.
I do not know FLVTool2 but I would imagine that it will not offer the functionality of flvmdi (which is needed to make this PHP solution work).
# Posted By stoem | 1/3/06 8:38 AM
"I do not know FLVTool2 but I would imagine that it will not offer the functionality of flvmdi (which is needed to make this PHP solution work)."
For everyone's information: FLVTool2 is the first tool that implement this feature. FLVMDI followed a day after since I've explained Nicolas (from FLVMDI) how this really cool feature works. He's as soon implement it in his version for others benefit of.
just my two cents on history.
Cheers!
# Posted By Fredz./ | 1/7/06 5:47 PM
Hi everybody,
Have you seen Rich Media Project amazing PHP player at :
http://www.rich-media-project.com/test4/cool3.html......
I have written a mail to this french company and they told me that PHP streaming components will be available soon.
Have someone heard about other products ?
David
# Posted By David | 1/7/06 6:15 PM
Technically they are either using the same technique as described in this blog entry. At best, they are also controlling the bandwidth rate at which the FLV is returned by the PHP page with the idea to not make the user waste the server's bandwidth.
Other than this, I think the link you posted looks like a great example of the usage of this PHP seeking technique that has been elaborated and enhanced by multiple peoples.
# Posted By Fredz./ | 1/7/06 6:25 PM
Hi Fredz,
"For everyone's information: FLVTool2 is the first tool that implement this feature."
I don't really care which tool implemented it first. For the record: Stefan Richter (Flashcomguru), asked about this to us on October 25, 2005. We releassed a beta version of FLVMDI with this feature on November 2, 2005.
I think "the idea" was important here; if it had occured to us, we would have implemented this years ago.
So thanks again Frederic and Stefan.
Best regards,
Burak
# Posted By Burak KALAYCI | 1/7/06 6:52 PM
Hey Burak,
Sorry I did a mistake, your right Burak.
"FLVTool2 is the first tool that implement this feature. FLVMDI followed a day after since I've explained Nicolas (from FLVMDI) how this really cool feature works."
Should be changed to:
FLVMDI is the first tool that implement this feature. FLVTool2 followed a day after since I've explained Nicolas (from FLVTool2) how this really cool feature works.
:)
Cheers
# Posted By Fredz./ | 1/7/06 7:29 PM
* Norman Timmler (of FLVTool2). Not Nicolas, gee I must be tired.
# Posted By Fredz./ | 1/7/06 8:18 PM
I'm wondering if this method can be used with the FLVPlayback component in flash 8. Could someone make an example fla file if it's possible? If it's not possible could you let me know why?
Thanks
# Posted By Seth | 1/9/06 7:34 PM
possible technically yes but too much work. It's much easier to roll your own player which supports the additional functionalities that are needed for the PHP way.
# Posted By stoem | 1/9/06 8:50 PM
Hi ! Just a question ? What was your VP6 parameters ?
VP6 allow to put keyframes every x frames/s but object keyframe doesn't work ... so using flvmdi !
For me after using flvmdi, I have too much keyframes (double or more) but i have de keyframe object, cool ... but don't really works on the player ...
I just want your settings when you encode video in VP6 ... which is the best codec for flv (i can't return to sorenson) ...
THX and sorry for my english !
# Posted By Alexandre | 1/17/06 11:13 PM
Alexandre,
As far as we are aware there's no bug with FLVMDI.
If you think any problem is related to FLVMDI, or, have a suggestion how we can improve it, please let me know (burakk at buraks.com).
Thanks,
Best regards,
Burak
# Posted By Burak KALAYCI | 1/18/06 2:06 PM
Burak --> I never say that ! FLVMDI is a very good and useful tool !
So, I think about something : it should be so good to delete all keyframes from a flv movie and to put keyframes with personnal interval (10 frames / s or 1 kframe / s ... for example) with FLVMDI ! We already can ? say me how ! :D
I just wanted to know how encode with on2 vp6 for flv streaming with php ... thanks.
Alexandre
# Posted By Alexandre | 1/18/06 4:33 PM
It took me a while to get this to work. I saw the 2 variables that needed changing in the fla file. I didn't realize there was a variable in the php file that you had to change. Then I didn't realize you have to use the flvmdi.exe on your flv file. -- so maybe a readme file that comes with the downloaded zip file stating what all needs to be changed would be nice for people.
But otherwise I seem to have it working. Thanks a bunch!
# Posted By Terry | 1/20/06 5:30 PM
Oh yeah,... I'd like to know if its possible to stop the full download of the video and just use these tools/scripts pretty much a streaming server. (There is a gray bar that indicates the cached download status of the full file).
In other words, I want to use this to stream my video, but when I take the video off the server, I don't want people to still be able to see the video from their cache (In other words copyright protecting it). Is this possible?
# Posted By Terry | 1/20/06 5:36 PM
If anyone wants it, I rewrote the while loop in the php file to rectrict output. Its not true streaming, but does limit the bytes per amount of time. It may not also be the greatest code. I'm not a great programmer.
I needed this, as I have a 30MB file to stream. And each time the user changes position (the way the php file originally works), the rest of the file from the scrub point gets re-downloaded. So if a user is in the first few seconds of watching and waits until the whole video downloads (all 30MB), and then the user scrubs back to the say the third second from the beginning, almost the whole 30MB will be downloaded again at the users FULL connection speed. I don't want to waste that much bandwidth.
The code below is limited to 30k/2sec or 15k/sec. Using 30k/sec is more of an average than 15k/sec as the limit is over 2 seconds instead of one, giving the download more of a chance to allow bursts to get the player the amount of file it needs to continue playing while the bandwidth limiting sleep is happening.
Hope this posts readable!
//set below to be your bandwidth
$bytes_per_timeframe = 30000;
$time_frame = 2;
while (!feof($fh)) {
// get start time
list($usec, $sec) = explode(" ", microtime());
$time_start = ((float)$usec + (float)$sec);
print (fread($fh, $bytes_per_timeframe));
// get end time
list($usec, $sec) = explode(" ", microtime());
$time_stop = ((float)$usec + (float)$sec);
// Sleep if output is slower than bytes per timeframe
$time_difference = $time_stop - $time_start;
if ($time_difference < (float)$time_frame) {
usleep((float)$time_frame*1000000 - (float)$time_difference*1000000);
}
}
# Posted By terry | 1/25/06 7:53 PM
my above comment does not know the true streaming rate of the video being loaded. It would be good if someone could write a function for the php file that gets the metadata info from the video file. (I'm not a good enough programmer to do that).
Also, my bandwidth limit above of 15k/sec is pretty low. Obviously you can change it to 100k/s for videos that need more bandwidth.
# Posted By terry | 1/25/06 7:57 PM
thanks for posting this. A better approach may be to move this logic to the client. Once the entire flv is cached the player switches to 'normal' mode instead of the PHP request. I'll try and add that sometime.
Thanks again.
# Posted By stoem | 1/25/06 8:10 PM
actually... my goal is not to allow the user to cache the file. I want to stream the file and not allow the user to keep watching it after I remove it from the server (for copyright protection purposes).
# Posted By terry | 1/26/06 1:18 AM
Kudos! As I search in google, I can only see this being done in PHP. Would you have any idea of doing it using C modules in the apache server? I seem to be having problems with the player recognizing from the partial .flv file inspite of adding the header: 4c46 0156 0001 0000 0009 00003 in hex followed by the actual data from the flv file starting from the requested offset.
Would be glad of any pointers and suggestions&
Thanks
# Posted By Sha | 1/27/06 1:24 AM
Having this embeded as a Apache module would really rock!
# Posted By fredz | 1/27/06 2:34 AM
Wouldn't it be possible to "stream" large files (e.d. 40mb+) with this trick?
Without loading the complete file into the player !?
Like that the php file sends chunks of the file to the player, and the player stats playing directly without having the complete 40mb loaded.
anyone ideas on this?
I tried some things with the code 'terry' posted above at 1/25/06 7:53.
But the video doesn't start directly, it starts when the complete 40mb file is loaded.
# Posted By Jeroen | 1/27/06 2:58 PM
Jeroen,
that is exactly what this script is supposed to do: making it possible to seek to a point in time that hasn't yet been downloaded. As you can see from the demo on the page this works well.
# Posted By stoem | 1/27/06 3:02 PM
Strange.
When I test it with a 40mb .flv file I have here, it doesn't start playing at all.
It does nothing.
# Posted By Jeroen | 1/27/06 3:14 PM
Hi everybody,
Concerning switching between local and PHP mode i found a working solution (still beta testing) but it is not really interesting with giant movies.
The main point is to be able to kill the php file in Temporary Internet Files folder.
Anyone has an idea on how we can make this :
From Flash ?
In the PHP script ?
# Posted By kimmy | 1/27/06 3:21 PM
Why are you so concerned about caching? Do you want to emulate some kind of DRM?
Still will always be flawed. We may be able to discourage local caching but at the end of the day the file you are playing is available online and for that reason it can be downloaded.
Have you experimented with the headers, trying to get the browser to expire the file right away?
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
Will that make any difference?
# Posted By stoem | 1/27/06 4:08 PM
Yeah. I tried headers, meta tags, all kinds of stuff. Sometimes the browser just won't reload the page.
I realize that its not going to be 100 percent. I just need to weed out the vast majority from being able to easily watch the file again, especially if their browser is too lazy to check for a new version.
However, I moved the name of the file into the php script and set the file name with an identifier from the swf file. So the URL won't contain the flv file name. In other words the url will be www.mysite.com/stream/flvprovider?name=clip1&p.... In the php file, clip1 equates to the flv file I want to play.
I also replaced the line in restartIt()
from...
ns.play( _vidURL );
to...
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + 0;
the _vidURL is then no longer used, so I also removed the variable. (jeroen -- do this and I think your problem will be solved because now the file always comes form the php and is constantly regulated)
Since the php file streams the flv file from the backend, the actual flv file name is never seen by the viewer or their machine. If the person is smart enough to download the flv file by just entering the correct url parameters on the php file (www.mysite.com/stream/flvprovider?name=clip1&p...), then they will be able to get the file as a download. However, they will have to save the file as an flv file and then create an swf file to play the flv file (or find an flv player). This all takes some intelligence, which weeds out a vast majority (80%) of the internet viewers.
# Posted By terry | 1/28/06 4:11 PM
also... as the player currently stands, if you scroll all the way to the end, you still get the "buffering". I solved this by getting rid if the "ending" variable, and put the following function in the videoStatus() function:
if (ns.time >= ns.duration - 3){
bufferClip._visible = false;
}
# Posted By terry | 1/28/06 4:15 PM
by the way... i'm concerned about cacheing so much because I want to sell "tickets" to viewings of my video. I don't have a lot of money and I don't want to pay for streaming servers or services at this point. So this script, as I have modified it to work, is a free pseudo-streaming server!
(Thanks to flashcomguru for posting his original code, or I would not be able to do this. I am hugely appreciative as it got me started.)
# Posted By terry | 1/28/06 4:21 PM
thanks Terry.
Would you mind sending me your updated code? stefan AT flashcomguru.com
I'd like to check it out and give it a test run. I think other people will also find it very useful. A cheap (if not totally reliable) way to achieve some DRM with flv files. Great stuff.
# Posted By stoem | 1/28/06 4:48 PM
I've also removed the _vidURL from the player. And modified some small things.
And i've moved the .flv file location outside the http docroot, so they're not accessible directly.
Also i've used terry's code earlyer with $bytes_per_timeframe = 256000;
The working demo i've setup now:
An flashvideo behind an pay per minute phone number.
If the viewer(caller) hangs up the phone, the flvprovider stop's sending blocks of the flv video, and the player stops playing after the current buffer ( 256000b) is empty.
It looks like it's working correctly now, and the viewer can't even watch the part he've already seen after hanging up the phone.
I'm going to clean up the code a bit tomorrow, it's kinda messy now ;)
# Posted By Jeroen | 1/28/06 8:42 PM
Jeroen,
please post your files so we can keep track of the modifications and additions that everyone adds to this.
Thanks!
# Posted By stoem | 1/29/06 11:50 AM
stefan -- i sent you my code.
also, i realized my post above with the line:
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + 0;
should have been (I copied the trace instead of the line that actually does the work - but the idea is the same)
ns.play( _phpURL + "?file=" + _vidName + "&position=" + 0);
# Posted By terry | 1/30/06 12:35 AM
I have one flv recorded with fms and i want to play after that with php streaming solution but .... when I drag the button on the progress bar the video doesn't go to the frame and the buffering message start blinking without stopping. I use flvmdi to inject metadata on flv and i am able to read this data so metadata is corect ... Please tell me, what is wrong with my code ?
# Posted By demiurgu | 1/30/06 12:43 PM
make sure you use the latest version of flvmdi and use the /k switch
# Posted By stoem | 1/30/06 1:49 PM
i am using the latest version of flvmdi(2.70 flvmdi.exe size=241.664) and i am using the /k switch :( ...
# Posted By demiurgu | 1/30/06 2:15 PM
Hey Jeroen,
You seem to be on the same page with me...
I just realized that we can make the player even better by including whether or not the buffer is full in the variables that are sent to the php file.
In other words, we can check the current buffer time:
_bufferFull = 1;
if(ns.bufferLength<ns.bufferTime){
_bufferFull = 0; // False
}
then add it to the call to the php file:
my_ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i] + "&bufferFull=" + _bufferFull);
The php file then has the the ability (with a check of the incoming _bufferFull variable)to remove or increase the bandidth limit until the buffer is full!! Thus, increasing the amount of feedback and making the performance for the user better.
# Posted By terry | 1/30/06 4:59 PM
demiurgu -- did you set/change the $path variable correctly in your flvprivider.php file?
# Posted By terry | 1/30/06 5:03 PM
Hi,
this is the dreamsolution for my videosite!
But (I think) I'm in the same path-trouble as demiurgu:
"when I drag the button on the progress bar the video doesn't go to the frame and the buffering message start blinking without stopping. I use flvmdi to inject metadata on flv and i am able to read this data so metadata is corect"
What are the right $path?
Please, give me a hint. ;) thx!
# Posted By rex | 1/30/06 7:35 PM
Can someone please show a file path example for a linux box. I am having the same buffer issue as demiguru.
# Posted By YG | 1/30/06 7:35 PM
rex & demiguru -- the $path variable in your php file needs to be the path to the flv file.
For Linux, if you have access to the command line, navigate to the directory where your flv file is stored and type "pwd" (present working directory).
That comand will show your current path, which is the path to your flv file because you are in the flv folder. Set the $path variable to that output. (should be something similar in form to: /home/users/www/flv/ -- make sure you include the training slash if its not there)
# Posted By terry | 1/31/06 4:13 AM
yes i did ... i set $path in flvprovider. some time is working with golfers.flv sometimes is not working. With my flv never worked. The path is same for both. I am using IIS on win2003 server. Is there some problem with this ?
# Posted By demiurgu | 1/31/06 8:03 AM
@demiurgu:
I had some problems when I first tried the script with my own .flv file.
The reason why it didn't play the file was because apache/php didn't had the rights to access the file.
( I forgot to chmod the file )
@terry:
Indeed we're on the right page. I didn't had time the last 3 days to work on the code. So I've no progress on new things.
I won't have any time next week to work on it.( wintersports )
So I'll pick it up again after 12 Feb.
# Posted By Jeroen | 1/31/06 9:59 AM
thank you terry! I found the rigth path to my webspace on the site of my webhoster...
The next problem was the memorylimit of my php-host (16MB),
because my FLVs are 290 to 450 MB! (each)
The example golfers.flv run and seek correct - but my FLVs run only once and don't seek a later position.
The hint from Michal Tatarynowicz are the solution:
>>> print (fread($fh, filesize($file)));
to
>>> print (fread($fh, 10000));
@demiurgu
some time its run, somtimes not? Eventually it is the filesize (or a late seekposition) of your flv. Test the hint from Michal.
Thanks!
# Posted By rex | 1/31/06 12:20 PM
I have big files too (around 300 MB) and the solution posted above works ... I really thought about PHP memory file size limitation (often 16 MB) but without finding a solution (i'm idiot) ! Cool ...
But there is one thing : why choose 10000 instead of filesize ? it's in bits, if memory limit is 16MB, why not choose 16000000 (or a bit less) ? ;)
# Posted By Alexandre | 1/31/06 2:16 PM
10000 its not a 'golden rule' nor 'the correct answer'. But it works on my (and Michal's) system. ;)
You can theoretically use 16384. But the script also runs it self in the memory. A better value: 15360? (sorry for my very bad english!)
Btw. - its a integer (byte) and 1 MB == 1024 Byte...
# Posted By rex | 1/31/06 3:32 PM
Thank you for the file name stuff...
I am trying to implement the xml loader, the thumbnail previewer and the progressive functionality all in one.
(See the thumbnail preview and xml stuff on this site)
Here's what happens:
All five videos play when selected in the list (simple with the tutorial). I placed the srubit function inside the event listener.
Here is what happens:
1) All videos load and play the first time
2) Can scrub the first video
3) Cannot scrub any other video.
4) Scrubber resides on the same location as the first video WHY???
Do I need to reset some values. Is my code completely ridiculuos.
(I hope to port the xml from Php and be able to have it all dynamic...)
Here is a code snippet.
Sorry about the formatting...
//Tell Function to do stuff when a user selects an item
listListener.change = function( evtobj ){
// close any current stream
ns.close();
video.clear();
//create a new stream
ns = new NetStream(nc);
//"attach" (pipe) stream to this video object
video.attachVideo(ns);
//Build FLV file name
var flvfile = evtobj.target.selectedItem.data + ".flv";
var _phpURL ="http://www.name.com/Example12/flvprovider.php"...;;
var ending = false;
var amountLoaded:Number;
var duration:Number = 0;
var loaderwidth = loader.loadbar._width;
loader.loadbar._width = 0;
//ATTEMPT TO RESET X VALUE TO RESET SCRUBBER
loader.scrub._x = 0;
// play selected flv
ns.play(flvfile);
//PULL METADATE FROM INJECTED ARRAY FROM FLVMDI
ns["onMetaData"] = function(obj) {
duration = obj.duration;
// suck out the times and filepositions array, this was added by flvmdi
times = obj.keyframes.times;
positions = obj.keyframes.filepositions;
}
//END OF METADATA FUNCTION
//SCRUBBING FEATURE CALLED WHEN USER MOVES SCRUBBER
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * loaderwidth;
loader.scrub._x = ns.time / duration * loaderwidth;
}
loader.scrub.onPress = function() {
clearInterval (statusID );
ns.pause();
this.startDrag(false,0,this._y,loaderwidth,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
scrubit();
this.stopDrag();
}
function scrubit() {
var tofind = Math.floor((loader.scrub._x/loaderwidth)*duration);
if (tofind <= 0 ) {
restartIt();
return;
}
for (var i:Number=0; i < times.length; i++){
var j = i + 1;
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
trace("match at " + times[i] + " and " + positions[i]);
bufferClip._visible = true;
ns.play( _phpURL + "?file=" + flvfile + "&position=" + positions[i]);
trace("play " + _phpURL + "?file=" + flvfile + "&position=" + positions[i]);
break;
}
}
}
//END OF SCRUBBING FEATURE
}
# Posted By YG | 2/1/06 10:18 PM
YG -
It looks like when you change files, you play the file from the start, so I would expect the headers to get through.
Does everything work if you remove the scubbing? In other words can you change files and have each of them them start and play all the way through from the beginning of the video after changing videos?
One thing I might try (again I'm not a great programmer):
Destroy (or empty) the duration, times, and positions variables before putting the meta data of the new file in them (I'm not sure how the assignment works works, but maybe the new file information just overwrites as much of the arrays as there is information, leaveing any extra length on the array unchanged?)
# Posted By terry | 2/2/06 2:22 PM
Thanks for all your help. I debugged it... I realized I had left a setInterval method out of the scope of the function and it kept calling itself. Bad news for the other videos in the xml list. There are still some more bugs that need to be fine tuned but at least it functions...
# Posted By YG | 2/3/06 10:36 PM
YG - when you get your code working can you send it to me at: streamingflvcom AT dedicatedmanagers.com
(replace the AT with an @ and remove the spaces)
# Posted By Terry | 2/4/06 6:58 AM
The "buffering" thing I talk about above is silly. It wouldn't work. I realized when I tried to code it, that the swf file only sends information to the streamprovider.php once, so it doesn't have that type of feedback to tell the php file its continual current buffering status. The swf would just send the fact that the buffer is empty when it tries to reload each stream.
I would think for it to work, it would have to be implemented by a second call from within the swf file to another php file (the way you might load an xml file, or maby through another hidden NetStream?) that somehow communicates with the streamprovider.php (maybe it sets a flag in a file that the streamprovider.php opens and checks every few seconds? or maybe php files can somehow share variables and the swf just periodically calls another php file that injects the variable into the streamprovider.php? ) -- don't now if that makes sense, but if possible, coding it would be a little beyond me.
# Posted By terry | 2/8/06 4:32 PM
I have a new problem :(( i recorded an flv stream with fms. I replayed it and get some metaData information wich contained duration value. I appended some voice at stream with fms too, but the duration property was not changed. Is there some issue on fms? Is somebody who know that?..
Sorry for my spell.
# Posted By demiurgu | 2/10/06 2:07 PM
Can this be altered to work with subdirectories, or would it just be a simple case of passing in a url var that had the directory name, or a reference, in?
# Posted By Ian Winter | 2/13/06 1:47 PM
yeah, this can very easily work with subdirectories. You could hardcode them in PHP or pass them in via a variable.
# Posted By stoem | 2/13/06 2:55 PM
Hi,
it looks like keyframes.times and keyframes.filepositions are a large amount of numbers for each frame in the video. Macromedia's video encoder doesn't put this information in the Video, so your scrubber do only work with flvmdi.
On the Website of flvmdi they say, that they do this with a commercial 'flv-library', and they want to keep it secret.
Do you think there is a possibility to build the php to calculate the byte position from a given time position and do like flvmdi does, without having the metadata injected?
# Posted By jascha | 2/23/06 10:45 AM
I keep getting a "file do not exist" even thou I have set $path to the right dir. I have tried on my local windows machine running apache and I have tried on my linux server. None work. Any advice would be greatly appreciated :-)
# Posted By Kris | 3/5/06 11:15 AM
Hi,
Very great stuff, it works on the demo but not in my environment.
When moving to another position, I always got StreamNotFound. I got this message without having done any modification on the source code (except, of course, the URL).
Thanks in advance to provide any advise.
Cheers.
Xris
# Posted By Xris | 3/5/06 11:12 PM
it's very likely that the path to your clips folder needs setting up correctly. The sample files won't just run in any environment without modifications.
# Posted By stoem | 3/6/06 8:07 AM
Hi,
Actually, the problem was coming from the (fread($fh, filesize($file)); line.
Replacing the filesize by a constant fixed the problem.
Now, let's try to have it running with FLVPlayBack.
Did someone already succeed ?
Cheers.
Xris
# Posted By Xris | 3/7/06 2:42 PM
After many tests ... I think there is no way to stream FLV by PHP with FLVPlayback Component.
FLVPlayback needs a XML file (from Flash Communication Server) or a *.flv for the contentPath parameter. Any other extensions (php here) doesn't work.
Anyway, to get back metadata from FLV using FLVPlayback, I create a netStream connection and get them (ns.play() + onMetaData + ns.close()). There is no onMetaData method for FLVPlayback. You must use a listener like that :
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
trace("canSeekToEnd is " + my_FLVPlybk.metadata.canSeekToEnd);
trace("Number of cue points is " + my_FLVPlybk.metadata.cuePoints.length);
trace("Frame rate is " + my_FLVPlybk.metadata.framerate);
trace("Height is " + my_FLVPlybk.metadata.height);
trace("Width is " + my_FLVPlybk.metadata.width);
trace("Duration is " + my_FLVPlybk.metadata.duration + " seconds");
};
my_FLVPlybk.addEventListener("metadataReceived", listenerObject);
But I couldn't access to keyframes object by this method.
I think there is no way to stream FLV with FLVPlayback and this method. Sorry ! :(
# Posted By Alexandre | 3/14/06 6:56 PM
Hi alexandre,
I think in order to make this work with FLVPlayback we would need to modify a few of its classes. I am sure the metadata can also be added but right now the event may simply dispatch a hardcoded series of properties.
I will look into modifying another, simpler player to provide this functionality. FLVPlayback is good but has some baggage that we don't need for this PHP streaming scenario.
stoem
# Posted By stoem | 3/14/06 7:37 PM
FYI
here's a MX 2004 version of the scrubber.fla:
www.flashcomguru.com/downloads/scrubber.zip
# Posted By stoem | 3/15/06 10:52 AM
PHP Streaming with FLVPlayback:
http://philflash.inway.fr/phpstream
This is a beta version.
All sources are available.
Philippe
# Posted By PhillFlash | 3/17/06 4:59 PM
thank you, this is great. I know this is beta but want to point out that the scrubbing didn't work for me. Also the video would constantly restart after a few seconds.
# Posted By stoem | 3/17/06 5:07 PM
Hi,
This is a beta.
All is ok with Internet Explorer but with Mozilla Firefox
there are some bugs.
With Firefox, we will get "NetStream.Play.Stop" events
if there is a seek.
I'm working on a solution but the problem is difficult...
Philippe
# Posted By PhillFlash | 3/17/06 11:58 PM
Hey guys, im new to this video to flv/flash, whats the best solution if i want to play short video clips on a normal php server? Do i need a software to convert the video to flv, and then another sofware that can play the flash file on a web page? Im confused........Please help
# Posted By Jason Naga | 3/19/06 7:42 AM
This web site might be usefull as well if you want to generate FLV online :
www.post-television.com
The generated FLV contains the metadata to use PHP streaming.
Podawan
# Posted By Podawan | 3/21/06 1:48 PM
Well, I spent last weekend putting together the ColdFusion Version of the Script, and also a site to host it on at:
http://www.realitystorm.com/experiments/flash/stre......
The code probably needs some work, and the site's definitely does, but the code does work.
# Posted By Steve Savage | 4/1/06 4:50 PM
SWEET!
I thought it would never happen. Great stuff, I'll give it a try as soon as I the chance as most of my apps run on CF too.
PS: my real name is Stefan Richter ;-)
# Posted By stoem | 4/1/06 5:00 PM
Hi all,
Great program. Looks like it will be quite handy.
Just a thought. In the following line in the as code
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
then ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
might want to put a check just before that and have something like this
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
if(times[j]==tofind) // check upper boundary
i=j;
bufferClip._visible = true;
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
}
Also, if anyone can point me to some code that reads/seeks binary files in asp i would be happy to change the code to work in asp.
With the php code:
print (fread($fh, filesize($file)));
Might be a good idea to check where abouts in the file you. Say if the flv is 10mb and u seek to the mid part of the flv then fread from mid to the length of the file won't it read 5mb of garbage ? Been awhile since i've used these functions so i'm probably wrong :)
Just curious you will never have the complete flv in the temp int folder ? Unless the user watches the whole video without seeking ?
Terry would it be possible to get a copy of the code you are working on ? Looks interesting. Email is benassi at tpg.com.au
# Posted By Ben | 4/2/06 9:51 AM
I write a new method to find the right position to stream the video when you call the function scrub_it.
In our project, we work with huge file (2 hours and 1 keyframe by second !) and the actual code seems to be optimized ton find the right position on the positions tab.
Instead of linear search on the tab, I thought to cut the tab in 2 parts while the searched value (tofind) is on one part. So, to be clear, if we have 3000 keyframes, we don't test 3000 times the tab as actual. In this code we have only 11/12 loops (3000/2^12) instead of 3000.
The code :
function scrubit() {
//Value can be a float ...!
var tofind = (loader.scrub._x/loaderwidth)*duration;
if (tofind <= 0 ) {
restartIt();
return;
}
var moitie = times.length; //get number of keyframes to test
var tab_test:Array = times; //Copy of the times tab
var positions_test:Array = positions; //Copy of the positions tab
var j = null;
var valeur = 0; //Index of the searched value in the tab
if (moitie > 0) {
//Showing buffer clip
bufferClip._visible = true;
/*************************
Here, we cut tabs on 2 parts. If value is superior of the value in the middle of the tab,
we delete (slice) the left part of the tab. If value is inferior, we delete the right of the tab.
We do many times and when the tab has only 2 values, we verify
*************************/
while (tab_test.length != 1) {
/************************
This if can be deleted if you want the inferior value (in the exemple, it will be 11 and not 12)
of the tab near the value to find.
Exemple : if tofind = 11.6 and the time tab has two value 11 and 12, it's the value 12 which
will be selected. We take this position and find the searched positions on the tab positions
************************/
if (tab_test.length == 2) {
var ecart = (tab_test[1] - tab_test[0])/2;
var verif = tab_test[1] - tofind;
if (verif < ecart) valeur = 1;
if (verif >= ecart) valeur = 0;
break;
}
else {
j = Math.round(moitie/2);
if (tofind > tab_test[j]) {
tab_test = tab_test.slice(j, tab_test.length);
positions_test = positions_test.slice(j, positions_test.length);
}
else {
tab_test = tab_test.slice(0, j);
positions_test = positions_test.slice(0, j);
}
moitie = tab_test.length;
}
}
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + positions_test[valeur]);
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions_test[valeur]);
}
}
Perhaps there is error(s) beacause I write it for the function scrub_it() quickly (I tested it correctly with my own tab not times and positions added to a flv).
Here is the original code :
var tab:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,116,120,
121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var positions:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,
116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var toFind = 234.6;
trace("Taille du tableau
# Posted By Alexandre | 4/3/06 7:30 PM
Sorry for the flood ... some caracters are not taken by the comment post ... i write again ....
Perhaps there is error(s) beacause I write it for the function scrub_it() quickly (I tested it correctly with my own tab not times and positions added to a flv).
Here is the original code :
var tab:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114,115,
116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var positions:Array = new Array(3,5,8,10,15,17,19,31,33,34,36,48,52,67,78.1,90,101,111,112,113,114
,115,116,120,121,130,131,132,145,189,190,193,215,234,235,245,253,256,456,478,500,511,512,513);
var toFind = 234.6;
var moitie = tab.length;
var tab_test:Array = tab;
var positions_test:Array = positions;
var j = null;
var valeur = 0;
while (tab_test.length != 1) {
if (tab_test.length == 2) {
var ecart = (tab_test[1] - tab_test[0])/2;
var verif = tab_test[1] - toFind;
if (verif < ecart) valeur = 1;
if (verif >= ecart) valeur = 0;
break;
}
else {
j = Math.round(moitie/2);
if (toFind > tab_test[j]) {
tab_test = tab_test.slice(j, tab_test.length);
positions_test = positions_test.slice(j, positions_test.length);
}
else {
tab_test = tab_test.slice(0, j);
positions_test = positions_test.slice(0, j);
}
moitie = tab_test.length;
}
}
trace("Position" + positions_test[valeur]);
And SORRY FOR MY ENGLISH ...
Alexandre
# Posted By Alexandre | 4/3/06 7:34 PM
This is a very cool approach! I think we should implement this into the player. And we still need a better player too :-)
# Posted By stoem | 4/3/06 8:20 PM
I've been looking at the scrub function also, and wondered if there was a way to improve performance, instead of cutting the array in half, I created a initial "guess" of where the key frame I'm looking for may be in the time array:
function scrubit() {
var b_match = false
var f_percentage = loader.scrub._x/loaderwidth;
var i_selected = Math.floor(f_percentage*duration);
/* Guess that the key frame I'm looking for is about the same percentage through
the array of times/keyframes as the position that was selected in the "scrub" slider.
*/
var i_guess = Math.floor(f_percentage*times.length);
if (i_selected <= 0 || i_guess <=0) {
restartIt();
return;
}
do {
if(times[i_guess-1] <= i_selected && times[i_guess+1] >= i_selected) {
trace("match at " + times[i_guess] + " and " + positions[i_guess]);
bufferClip._visible = true;
ns.play( _streamerURL + "?vidID=" + _vidID + "&vidFile=" + _vidFile + "&vidPosition=" + positions[i_guess]);
trace("play " + _streamerURL + "?vidID=" + _vidID + "&vidFile=" + _vidFile + "&vidPosition=" + positions[i_guess]);
break;
}
else if (times[i_guess] >= i_selected) {
i_guess = i_guess - 1; }
else { i_guess = i_guess + 1; }
}
while (i_guess >= 0 && i_guess < times.length)
}
The next step will be to apply Newton's Method for further improvement.
# Posted By Steve Savage | 4/4/06 10:14 PM
Stoem -> Thanks :)
Steve Savage -> Another approach that I thought before. The code works near perfect only if the "video encoding" adds keyframes as much as secondes ! But I doesn't thought about pourcentage ! Very good idea.
For example (a video of 100 secondes, more easy)
loaderwidth = 100;
loader.scrub._x = 10;
var f_percentage = 0.1;
var i_selected = 10;
//There is as much as keyframes than secondes (times.length = 100)
var i_guess = 10;
-->The code make one loop only ! So quick :)
//There is 2 keyframes by secondes (times.length = 200)
var i_guess2 = 20;
-->The code make 10 loops to find the good index.
//There is 1 keyframe by 4 secondes (times.length = 25)
var i_guess3 = 2;
-->The code make only one loop I think ! Cool !
With my code and same video :
1-4 loops
2-5 loops (better)
3-3 loops
Another example with a huge video (4000 secondes)
loaderwidth = 100;
loader.scrub._x = 10;
var f_percentage = 0.1;
var i_selected = 400;
//There is as much as keyframes than secondes (times.length = 4000)
var i_guess = 400;
-->1 loop
//There is 2 keyframes by secondes (times.length = 8000)
var i_guess2 = 800;
-->The code make 400 LOOPS to find the good index (ouch ! but better as actually)
//There is 1 keyframe by 4 secondes (times.length = 1000)
var i_guess3 = 100;
-->1 loop
With my code and same video :
1-12 loops
2-13 loops (better way only here)
3-10 loops
I think I haven't take the best examples here but ... I can say that your code works perfect with small files and/or with keyframes number <= secondes.
If we need precision and a lot of keyframes, my way can be quicker. But finally the two codes are really fast.
A BONUS : with my code, I work with float value (Math.floor not used) and find the nearest keyframe and not the "under keyframe" (ex : times[12] for 11.7 value instead of times[11] as actual).
So, I take note about your "pourcentage method" and I'm interested in Newton's method (but can't find a way to implement it correctly ...)
PS :
with this line : "while (i_guess >= 0 && i_guess < times.length)"
I think it should be no scrub in the last keyframe ... "times[i_guess+1]" is undefined if "i_guess = (times.length - 1)" ... so, "while (i_guess >= 0 && i_guess < (times.length - 1))" is the good way ...
!!! : I notice with this postscriptum that the actual method doesn't scrub correctly if we take a value of timeline > of the last keyframe (ex : last keyframe at 100 secondes and we search 100,34 secondes) because of comparaison "if( (times[i] <= tofind) && (times[j] >= tofind ) )" ...!
It's not a problem with my "slice method".
Alexandre
# Posted By Alexandre | 4/5/06 12:06 AM
Sorry, 100.34 works because of Math.round ! But 100.75 doesn't work ;)
Alexandre
# Posted By Alexandre | 4/5/06 12:10 AM
Hi,
We have extended this player to an advanced level.
Please check below URL.
http://www.dearmyfriends.com/v13/popup.php?idx=390......
Points covered:
i) dvd kind of chapters ( list of intersting poitnsto jump directly to that video part).
ii) can be viewed in different sizes. ie 1x,2x etc
iii) Previous and Next Video buttons( Yes..the two korean buttons provide this)
iv)Exact loadbar showing what bytes loaded to browser.
v) Enhanced php to send bytes to browser
http://www.dearmyfriends.com/v13/popup.php?idx=390......
Thanks
Sudhi
# Posted By Sudhi | 4/5/06 8:09 AM
If you want to check a little large video , You can check this.
http://fmx.exellen.com/v13/popup.php?idx=311&m......
# Posted By Sudhi | 4/5/06 8:49 AM
thanks everyone for the work on this.
Sudhi: your page does not contain embed tags for the swf, therefore the page only work in IR and not in Firefox.
Also can you make the source files available?
thanks
# Posted By stoem | 4/5/06 10:13 AM
A little "Bug" here: When I try to scrub on a Mac OS X with Firefox the Video freezes and I cant reconnect to the Server until my session is timeout.
# Posted By nathan | 4/5/06 2:09 PM
Dear stoem ,
It is still under improvement, SO I cant open sources at this stage. If you have any thing to say , you can mail me.
http://fmx.exellen.com/v13/popup.php?idx=398
check above video, which is streaming at 2 MBPS.
I have added Embed tag, so it will work in other browsers too..
--Sudhi
# Posted By Sudhi | 4/7/06 4:51 AM
How do I implement the php file, do I need to use an include() statement?
# Posted By Brian | 4/10/06 5:21 PM
Guys I need some help. I have a 277 meg flv file that I have succesfully got to stream using the lighttd web server but I can't replace my apache2 linux server with that. I am running a linux box with apache2. I have the hacked scrubber.swf file that uses ?file to get the video parameter. I have the phpstream.zip found on this page. I have the video.flv file the flvprovider.php and the scrubber.swf all in a direcory on my webserver. I have a index.html with this object
<object type="application/x-shockwave-flash" data="scrubber.swf?file=video.flv" width="420" height="315" wmode="transparent" VIEWASTEXT>
<param name="movie" value="scrubber.swf?file=video.flv" />
<param name="wmode" value="transparent" />
</object>
Now from what I have gathered I need it to look like this
<object type="application/x-shockwave-flash" data="scrubber.swf?file=flvprovider.phpfile=" width="420" height="315" wmode="transparent" VIEWASTEXT>
<param name="movie" value="scrubber.swf?file=flvprovider.php?file=video.flv" />
<param name="wmode" value="transparent" />
</object>
and I have tried both and neither work? I get buffer that never buffers. Any idea?
Thanks for your help.
Roger
# Posted By Roger | 4/10/06 7:11 PM
My basic question is how to use one SWF Flash player that I create in Flash 8 to play a variety of FLV files which site in a variety of folders based on PHP variables that are passed to the HTML page in which the Flash player is embedded.
Here are the details:
I'm embedding the flash player on a website that uses PHP and MySQL to pull information about a house/property from a database.
There is a PHP variable called $ID which corresponds to the folder that the FLV file sits in on the web server. So there will be a main folder called "properties" with many subfolders inside ("1", "2", "3"....) Inside each subfolder will be a "name.FLV" file which I want the one player to play. The actual SWF Flash Player will sit in the root folder of the webserver.
When I showed videos in the WMV format I used URL's that looked like this to pass the variables.
http://www.domain.com/m.php?video=ID
Then the code for the embedded player would look something like this:
<embed src="properties/< echo $ID; ?>/name.wmv" ></embed>
My question is how do I use the variables that are in the URL to determine which FLV file my flash_player.SWF file plays?
Any help would be greatly appreciated.
Thanks.
Elliot
# Posted By Elliot | 4/11/06 7:22 PM
I really like this solution - thanks a lot for collecting all this info and offering the sources for download!!
One problem that has already been mentioned but not solved yet: when the user watches a part of the video and then moves the slider to a previous point in the timeline the video gets downloaded again. I think that this could sum up quickly and waste a *lot* of bandwidth and that's the only reason why I'm hesitating to use this approach.
Do you think it would be possible to solve this problem? I haven't had an idea yet...
# Posted By Anna | 4/12/06 5:46 PM
Yeah I think we have discussed this once before. The only way around this that I see is to monitor if the entire flv has been cached/downloaded already in which case you could request it in 'the old way' without going through PHP.
In a way this issue is apparent in all streaming server solutions: if a user seeks and plays the same part of a video 3 times then he will consume the bandwidth 3 times. The PHP approach is 'worse' in a way because you may be downloading more footage than you are actually consuming - when you seek to another point that entire process starts again and for every 10 seconds watched you may be downloading 30 seconds worth of footage - in this way a real streaming server is much more efficient. So yes, potentially the PHP method will waste bandwidth.
# Posted By stoem | 4/13/06 11:43 AM
Well it looks like there might be a solution :
http://www.rich-media-project.com/products/test2
It is still under development but once again Rich Media Project guyes are pushing PHP technology to the next level...
# Posted By Tom | 4/20/06 12:52 PM
Hi everybody and thanks for the great work.
This product would be perfect if only we can protect flv files from being downloaded.
The flv is deleted from the temporary Internet files but if i use a sniffer i can get the link to the php page with the variables required to download the flv (as a php file that just need to be renamed with an flv extension).
1) The swf can be encrypted, but i would still be able to sniff the link and download the file because the variables are sent to the PHP script using a GET method.
I don't think it would be possible to send variables using a POST method but someone has probably an idea concerning this point ?
2) The PHP script can ask for the HTTP referrer but once again it is easy to fake this data.
3) I thought about a cookie but the user would be able to watch the original webpage and download the movie at the same time.
4) Google Video, Youtube, Metacafe, Music movies can be downloaded easily so there is probably no solution to secure movie in flash.
Security is always a problem :(
# Posted By phil | 4/23/06 8:39 PM
if you put a file online then it will be downloadable, not much you can do about that. A progressive flv is always cached, even when run via a script. Some people have played with http headers that expire the content right away but a dedicated user can still grab the file. If you want some more 'security' (if such a thing exists) then you need a real streaming solution (FMS if you want to use Flash).
# Posted By stoem | 4/23/06 8:51 PM
hi.. i just did all the work to get this going for 12 different pages.. i tested it out on the first one.. np it worked.. but i forgot to test INTERNET EXPLORER!
i get no video in IE.. please help.. firefox works fine.
url: http://onetribedesign.com/bridal/chris.htm
# Posted By dewey | 4/27/06 6:21 AM
also,i forgot..
the video on THIS page does NOT work in INTERNET EXPLORER either... only firefox!
# Posted By dewey | 4/27/06 6:22 AM
video works fine for me in IE 6.2 and Firefox, however it stops working in both browsers once I seek
# Posted By stoem | 4/27/06 8:15 AM
me again...
thx for checking, but it's still not working for me. i have IE 6.0.2900.......... i also checked it in IE 6.0.2800........ neither will show video.. only audio...
another person told me they could see it in 6.0...
the coldfusion one works in my IE... but i can't use that :-(
any ideas on why I can't see it but you can? i checked IE settings and all is ok there.. :-)
# Posted By dewey | 4/27/06 5:21 PM
You got which version flash Player installed?
Does the clip on this page work for you?
# Posted By stoem | 4/27/06 5:25 PM
flash 8.0
the clip on this page will work for me in firefox.. just not ie
same with my clips
# Posted By dewey | 4/27/06 5:28 PM
Fantastic!
I am however having a problem implementing...I think my error is in defining the $path variable in the flvprovider.php file.
I have $path = 'http://www.mywebsite.net/subfoldername/';
Is this correct?
If I target flvprovider.php directly in the browser I get the following error:
0ERORR: The file does not exist
Any help greatly appreciated!!
# Posted By jim bachalo | 5/17/06 12:34 AM
hi Jim,
the path needs to be a path on disk, for example c:\myapp\myvideos - not a URL.
Stefan
# Posted By stoem | 5/17/06 9:30 AM
Stefan
Thanks...almost there.
I get the following using a script to determine my system path:
Path to server root: /dh/
Path to this file: /home/.test/clientname/sitename.net/mydirectory
So would the correct $path variable be?:
/dh/home/.test/clientname/sitename.net/mydirectory/
Thanks again!
# Posted By jim bachalo | 5/17/06 3:25 PM
sorry, I'm no good with *nix systems. Anyone else?
# Posted By stoem | 5/17/06 3:28 PM
I've been messing around with this script for a little while now. Using your example works fine. But when I try it on my own, I can move the scrubber to the middle of the loadbar and the video pauses and when I move it back to the beginning, it starts playing from the beginning. Now, when I move the scrubber, the trace is showing the file plus the position to play. I may have missed something about the PHP file in all of this. Has anything been updated since the posting
#427 by dizi izle on 5/18/08 - 7:44 PM
#428 by ldang on 5/22/08 - 4:12 AM
if($pos > 0) {
print("FLV");
print(pack('C',1));
print(pack('C',1));
print(pack('N',9));
print(pack('N',9));
}
#429 by Dmitry on 5/27/08 - 3:18 PM
Thanks,
Dmitry
#430 by Jboi on 5/28/08 - 12:27 PM
I hope this link helps you guys out, it shows an example of it in action. Personaly i prefer this way as it seems to be more efficient than the script method.
have a look.
http://www.mediamodus.com/isapi-progressive-stream...
#431 by Jboi on 5/28/08 - 12:31 PM
#432 by val on 5/30/08 - 9:14 PM
maybe it's crazy or completely insane my question but i am going with it.
my plan was to build a small website like you tube with my own player
i follow example on www.gotoandplay.com and i customize the player to respond to my own well some fency skins nothing+ nothing-
i upload and convert avi files using ffmpeg and php (workfine)
i stock my video in my databse etc...
what i want is to send the name of the video to my flash.swf in oder to play it
how do i do that what is the best way sendandload var or directly pass the variable to embed.
and secondly what is the thing about xmoov.php and all bandwith thing what does it
do cuz in the tutorial i don't really see those thing www.gotoandplay.com
or maybe i am completely out of bounds and i should give up my project cuz i am still searching for a solution and still can found nothing
i just have some lil knoledge in both flash and php but i need ot understand better here's my email mr_malice23@hotmail.com please contact me to help
#433 by val on 5/30/08 - 9:14 PM
maybe it's crazy or completely insane my question but i am going with it.
my plan was to build a small website like you tube with my own player
i follow example on www.gotoandplay.com and i customize the player to respond to my own well some fency skins nothing+ nothing-
i upload and convert avi files using ffmpeg and php (workfine)
i stock my video in my databse etc...
what i want is to send the name of the video to my flash.swf in oder to play it
how do i do that what is the best way sendandload var or directly pass the variable to embed.
and secondly what is the thing about xmoov.php and all bandwith thing what does it
do cuz in the tutorial i don't really see those thing www.gotoandplay.com
or maybe i am completely out of bounds and i should give up my project cuz i am still searching for a solution and still can found nothing
i just have some lil knoledge in both flash and php but i need ot understand better here's my email mr_malice23@hotmail.com please contact me to help
#434 by splatt on 6/1/08 - 2:07 PM
I want to use the solution from Lance, http://www.courierwebcasts.com.
Here is what I tried already:
I set up a .flv with the path and the name of the video in Actionscript 2.
I used flvprovider with the root and the path to scrubber.swf (and the video)
I injected code with flvmdi in the flv.
I embedded scrubber swf in my html page.
Result: The player is showing up at the webpage - but I get the message that the flv within the path was not found - but the flv with exact the right nae is in the right directory...
Every help is appreciated!
Thank you, splatt
#435 by Aeon Aries on 6/5/08 - 6:10 AM
Can you help me with my problem?
I want to autoplay a flv file and then play
the second one after playing the first.
How will i able to do it. Its my fourth day and i cant figure it out. please help. thanks
#436 by Alfie on 6/7/08 - 9:25 AM
#437 by Stefan Richter on 6/7/08 - 10:13 AM
#438 by splatt on 6/8/08 - 3:42 PM
splatt
#439 by Jboi on 6/13/08 - 12:43 AM
you might want to look at www.mediamodus.com if your thinking of doing a youttube type thing, there is a progressive filter and a video converter on the way. you can test the video converter at http://video.mediamodus.com
check it out. :)
#440 by zsoli on 6/14/08 - 2:03 AM
Could you help me? I actually need a stepbystep tutorial how to use this solution.
I know nothing about flash, do I have to learn it to use this code?
Thanx in advance!
#441 by Jboi on 6/14/08 - 9:03 AM
#442 by Jboi on 6/16/08 - 4:17 PM
#443 by SanjayG on 6/18/08 - 12:49 PM
I have implemented it on my server. Everything I have done as per instruction but still its not working. When I execute file it shows blank page when I right click on player place it shows "Movie not loaded". Please let me what are thing I need to set to make it wokring. Its very urgent for me
Thanks in advance!
Regards,
SanjayG
#444 by Jboi on 6/18/08 - 12:53 PM
#445 by SanjayG on 6/19/08 - 9:45 AM
On http://www.jeroenwijering.com/ I found one setup wizard according to that I have setup this on server.
Below is the details:
var so = new SWFObject('upload/player.swf','mpl','470','250','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addVariable('file','bunny.flv');
so.addVariable('streamscript','embed/xmoov.php');
so.addVariable('tracecall','printTrace');
so.write('preview');
this is my player code. I have player.swf and .flv file in same folder. xmoov.php in embed folder. In xmoov.php I have also set proper pathfor video. After this all If I click on play video I get below result
layer ready(id:mpl,version:4.0 r12,client:FLASH WIN 9,0,45,0)
CONTROLLER: RESIZE (height:230,fullscreen:false,width:470)
MODEL: TIME (duration:0,position:0)
MODEL: STATE (oldstate:undefined,newstate:IDLE)
CONTROLLER: PLAYLIST (playlist:[object Object])
VIEW: PLAY
MODEL: META (info:NetConnection.Connect.Success)
MODEL: STATE (oldstate:IDLE,newstate:BUFFERING)
CONTROLLER: ITEM (index:0)
MODEL: LOADED (total:4294967295,loaded:0,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: LOADED (total:4294967295,loaded:0,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: LOADED (total:4294967295,loaded:0,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: LOADED (total:4294967295,loaded:0,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: LOADED (total:4294967295,loaded:0,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: LOADED (total:4169,loaded:4169,offset:0)
MODEL: BUFFER (percentage:0)
MODEL: BUFFER (percentage:0)
MODEL: BUFFER (percentage:0)
MODEL: BUFFER (percentage:0)
MODEL: BUFFER (percentage:0)
.....
And it goes in loop.
But in above javascript player code If I comment streamscript parameter then its working fine but I guess that is normal streaming.
Please advice. I am stuck on this not getting any way to make it working.
Thanks,
SanjayG
#446 by Jboi on 6/19/08 - 10:17 AM
i cant help you on this one as im not a PHP guy, i use the ISAPI streaming option in IIS.
But now that you have posted in more detail im certain somone here could help :)
#447 by maht on 6/26/08 - 9:21 PM
I just noticed your post is 2005 so maybe you did too since then :)
#448 by Stefan Richter on 6/26/08 - 10:42 PM
I see you're in Nottingham - I live just outside Leicester.
Could you drop me an email please: stefan AT flashcomguru DOT com
thanks
#449 by olly on 7/12/08 - 9:35 PM
is where the file is on my server and the localhost box has a dir like this:
C:\Program Files\EasyPHP 2.0b1\www\phpstream_update\video\golfers.flv
can anyone help here?
regads
#450 by olly on 7/12/08 - 9:41 PM
is where the file is on my server and the localhost box has a dir like this:
C:\Program Files\EasyPHP 2.0b1\www\phpstream_update\video\golfers.flv
can anyone help here?
regads
#451 by JBoi on 7/12/08 - 9:45 PM
#452 by olly on 7/12/08 - 9:59 PM
Windows 2003 Server
Windows XP
IIS 6
i run php, apache.. i think this method will work very nicely when i get it working - thanks for the link ez
#453 by Guillermo on 8/21/08 - 1:32 AM
#454 by dustro on 8/22/08 - 7:50 AM
#455 by Ronnie on 8/30/08 - 12:23 AM
Does anyone have a solution for this problem?
#456 by Ronnie on 8/30/08 - 1:00 AM
If you open a session before you output the flv, then make sure you close it before outputting the video.
session_write_close();
#457 by Al-Faisal El-Dajani on 9/1/08 - 9:05 AM
#458 by wallpaper on 9/1/08 - 6:15 PM
header ("Content-transfer-encoding: binary");
header ("Content-Type: video/flv");
header("Content-Disposition: attachment; filename=video.flv");
@readfile($url);
#459 by Gregor on 9/12/08 - 11:49 AM
Thanks for your answer.
#460 by anonymous on 9/15/08 - 5:08 PM
My shared hosting server doesn't allow users to execute their binary files so I cannot use this tools, I need PHP or Perl scripts :(
So can anybody help me?
#461 by anonymous on 9/15/08 - 5:09 PM
My shared hosting server doesn't allow users to execute their binary files so I cannot use this tools, I need PHP or Perl scripts :(
So can anybody help me?
#462 by Leo on 11/7/08 - 3:32 AM
Its really great idea. But i have a prob. with the implementation. I uploaded all your source to my server, but when i point the browser to the file flvprovider.php it says an ERORR: The file does not exist.
I have uploaded my video to this path below :
http://www.smusiclive.com/phpvideo
In your script what is the path should i give to make this work for me.
Awaiting your guidance.
Thanks & Regards
Leo Amal
#463 by reshma on 11/12/08 - 9:29 PM
Every thing works fine for me, i just need to disable the right click menu option from the player. Kindly go through the coding and suggest me the script to disable the right click menu option on the flv player, also mention where to write that script.
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sample Video</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var attributes = {};
var params = {};
// for fullscreen
params.allowfullscreen = "true";
params.wmode = "transparent";
params.showmenu = "false";
var flashvars = {};
// the video file or the playlist file
flashvars.file = "pcrf_promo.flv&logo=http://www.magnalive.org/logo.gif";
// the PHP script
flashvars.streamscript = "flvprovider.php";
flashvars.bufferlength = "3.8";
// width and height of the player (h is height of the video + 20 for controlbar)
// required for IE7
flashvars.width = "640";
flashvars.height = "320";
// width and height of the video
flashvars.displaywidth = "640";
flashvars.displayheight = "320";
flashvars.autostart = "true";
flashvars.showdigits = "true";
// for fullscreen
flashvars.showfsbutton = "false";
// 9 for Flash Player 9 (for ON2 Codec and FullScreen)
swfobject.embedSWF("phpsflvplayer.swf", "flashcontent", "640", "320", "9.0.0", "playerProductInstall.swf", flashvars, params, attributes);
</script>
</head>
<body bgcolor="#C4CCC7" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><div align="center"> <div id="flashcontent">
<div align="center">
<table width="52%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font size="2" face="Arial, Helvetica, sans-serif">To
view this video you need JavaScript enabled and the latest Adobe Flash
Player installed. <br />
<a href="http://www.adobe.com/go/getflashplayer/">D... the free
Flash Player now</a>.</font></div></td>
</tr>
</table>
</div>
</body>
</html>
Thanks in advance
#464 by flashObj on 11/17/08 - 5:47 AM
i just tried this player but my player didn't stream but it starts well when i put move the scrubber it is not starting from the place i am using wamp server i don't know whether i have to configure apache httpd.
could u pls help me...
#465 by Tony on 11/28/08 - 2:54 AM
@flashObj, you need to inject the keyframes first for it to work, read closely :)
#466 by flashObj on 11/28/08 - 7:01 AM
#467 by Jason on 11/28/08 - 9:13 AM
http://www.mediamodus.com/isapi-progressive-stream...
and
http://www.mediamodus.com/flv-meta-editor
ENjoy ;)
#468 by blindman on 1/16/09 - 12:05 PM
#469 by Jason on 1/16/09 - 12:32 PM
what site?
The message suggests to me that the flv file is 404'd.. check your paths
#470 by Rita on 1/16/09 - 2:34 PM
Add upload file field to web form, including php programming.
Add field to output form that has a link or button to play the uploaded video.
I didn't see a pause or stop function on your sample. Can that be easily included?
Your help is greatly appreciate. Thanks.
#471 by one on 2/7/09 - 5:16 PM
I still have problem with the path.
Can someone show me example??
plss
thx
#472 by karossii on 2/26/09 - 8:12 AM
I have a Flash website, the whole site done in flash (index.swf). There is a movie on the stage (vidPlayer_MC) into which I load an external .swf (player1.swf, player2.swf, player3.swf, etc.) which is basically this PHP streaming player.
I have buttons on the main timeline (of index.swf) which switch the current player which is loaded. Each button loads in a separate version of this player, each of which has hard-coded a single .flv video file it plays. I would rather have the buttons control the flv file and just use one external .wf player, or even better code the player itself as part of my main flash site instead of using an external .swf, but I don't know how.
For now, the first video to load runs great. I have injected the data and it scrubs fine, etc. The movie clip vidPlayer_MC loads in player1.swf automatically and starts playing. If you click a button to change videos, such as loading player2.swf into vidPlayer_MC, it seems to work fine until you try to scrub back and forth.
The little grabby bar on the timeline doesn't want to follow the mouse, but bounces around... mostly trying to stay put where it was on the timeline. If you can let go of the mouse button when the bar is not in the same spot, which requires trial and error and luck, it does scrub to that location - but you have no control over where/when that is in the video.
If you switch back to the original (player1.swf), it will now do the same error.
So... does anyone know what causes that, and how to fix it? Or better yet, how I could integrate this player into a much larger flash website without loading in an external swf file?
Thanks!
#473 by karossii on 3/2/09 - 9:25 PM
One issue is with Lance's modification to include the time elapsed / duration counters - he is no longer with the website linked to in his posts so I am not sure how to get in touch with him... maybe someone else here can help. The timer works fine until you scrub through the video, then it freezes at the time it was on (before you grabbed the scrubber), and never resumes counting. No idea why. Any help?
The other issue is in playing multiple videos through one player. I can use a button with the following script to change videos, but the audio from the first (or all previous if you changed multiple times) continues on... how do I stop one video before starting the new one?
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
on (release) {
_root.vidMC.theVideo.attachVideo(ns);
playButton._visible = false;
ns.setBufferTime(2);
ns.play("http://www.mysite.com/show4.flv");
}
#474 by santosh on 3/6/09 - 6:49 AM
I have a problem. I just started a web site. Now i want to give a space where any one ca add video.
I think they must be allowed to either upload or input a link which then either streams from another site (e.g. youtube)
or plays from our server.
Can you please Help me out. I am using PHP, Symfony framework and Apache.
Santosh P.
Bangalore, India
#475 by flashObj on 3/6/09 - 7:02 AM
Can you explain me whats your problem to my mail id udhaya0000@gmail.com.
#476 by flashObj on 3/6/09 - 7:06 AM
i think i can help you in this problem you can mail me your problem to my mail id udhaya0000@gmail.com
#477 by karossii on 3/6/09 - 7:24 AM
#478 by Santosh on 3/6/09 - 8:15 AM
i sended to ur email id. plz find out..
#479 by venukumar on 3/12/09 - 2:04 PM
[b]I have change the xmoov script like this:[/b]
// points to server root
define('XMOOV_PATH_ROOT', 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'); //this is the path where my htdocs(apache server resides)
// points to the folder containing the video files.
define('XMOOV_PATH_FILES', '/phpstream/video/');//and this the video folder resided in the apache htdocs folder path
and
// INCOMING GET VARIABLES CONFIGURATION
define('XMOOV_GET_POSITION', 'start');// changed the position to start
[b]And below is the index(html) file I used to run the script.[/b]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div id="flashcontent">
<strong>You need to upgrade your Flash Player</strong>
This is replaced by the Flash content.
Place your alternate content here and users without the Flash plugin or with
Javascript turned off will see this. Content here allows you to leave out <code>noscript</code>
tags. Include a link to <a href="swfobject.html?detectflash=false">bypass the detection</a> if you wish.
</div>
<script type='text/javascript'>
var s1 = new SWFObject('player-viral.swf',"ply","500","400","9.0.124","#FFFFFF");
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam("flashvars","file=bunny.flv&streamer=xmoov.php&autostart=true&start=3&id=1");
s1.write('flashcontent');
</body>
</html>
I placed the related video to be played in the video folder .
[b]This is my folder structure I used:[/b]
/videos/ //videos folder
xmoov.php //xmoov file
/flash/ //player41.swf
/script/ //swobject.js.
I followed all the steps of KLink, But its not playing the video its showing loading
And the server get request from the xmoov.[b]
And when the following link is placed on the browser[/b]
http://localhost/phpstream/xmoov.php?file=bunny.fl...
It gives an options to open and download the bunny.flv video file.
But its not playing.
Can anyone help me, I really tried for so many days,but the result is same.
Hope someone may have the same problem, before they get succeeded this streaming problem.
Ur suggestions are accepted, If I did any minor mistakes too.
I'm new to the php scripting so If I did any minor mistakes,please kindly help for this Streaming problem.
Thanks Inadvance.
#480 by Jakob on 4/14/09 - 2:09 AM
#481 by Stefan Richter on 4/14/09 - 9:09 AM
#482 by Brian Lorraine on 4/22/09 - 8:53 PM
$file = 'golfers.flv'l
If I put the URL of the script into my browser, it downloads just fine and plays in my adobe media player (I had to add another header line for content-disposition)... although when i try to play it in JW player.. It just says that it is not a valid XML file. sucks.
#483 by Brian Lorraine on 4/22/09 - 11:00 PM
#1) My file was f4v and wouldnt play even if took out the code to check for the flv extension. I guess JW player can play f4v, but when using php streaming, it only lets you use flv.. had to re-encode... (those injectors dont work with f4v either)
#2) The scripting was a little different. See below.
For those of you trying to use JW player.. here you go:
http://www.inwayvideo.com/phpflvplayer/index_en.ht...
#484 by Usama Ayaz on 4/23/09 - 2:40 PM
#485 by Brian Lorraine on 4/24/09 - 6:48 PM
For those of you who are trying to hide the file name, people can still use FIREBUG plug to figure out the filename. However there IS a way to keep people from downloading it: .htaccess
Simple deny everyone in your .htaccess file from getting to the movie (except for 127.0.0.1). Because its the php script, and not the client, actually reading the file, the request is coming from 127.0.0.1 If someone figures out your filename they won't be able to get it.
Unless... they get it through the cache.. which pretty much makes everything here moot. Bummer.
I guess I'll have to go with a true streaming package
#486 by Jason on 4/24/09 - 8:13 PM
Could you add junk to the video file that you take into account for in your player. this of course wont prevent a determined person from "unjunking" the file but would stop casual "theft".
J
#487 by diseño web on 4/28/09 - 3:56 AM
#488 by colx on 5/24/09 - 12:33 PM
http://www.aboutspywareremoval.com
#489 by Raed Petro on 5/27/09 - 10:01 PM
My issue is that I need to join more than one FLV file in the PHP stream. So I tried the following:
/////////////////////////////////////////
if($seekat1 != 0) {
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
$fh1 = fopen("file1.flv", "rb") or exit("Could not open file1.flv");
fseek($fh1, $seekat1);
while (!feof($fh1)) {
print (fread($fh1, 16384));
}
fclose($fh1);
$fh2 = fopen("file2.flv", "rb") or exit("Could not open file2.flv");
fseek($fh2, $seekat2);
while (!feof($fh2)) {
print (fread($fh2, 16384));
}
fclose($fh2);
/////////////////////////////////////////
But didn't work. It streamed the part of the first file "file1.flv" successfully then stopped without continuing streaming the part of the second file "file2.flv". Am I missing pack() that should be written between the 2 streams?
Appreciate your help.
Thanks,
Raed Petro.
#490 by Jason on 5/28/09 - 10:33 AM
Hi Raed,
Its been a while since i wokred with the flv file format so this off the top of my head.
the FLV signature is the first 9 bytes of the file.
So in theory, all flv files after the first one need to have the first 9 bytes removed before streaming.
#491 by Raed Petro on 5/28/09 - 11:17 AM
Thanks for your reply.
In my code I skipped the first 9 bytes from the second file. Actually I am trying to seek file2.flv from the middle via $seekat2.
Anyway I am still trying .. didn't giveup yet.
Thanks,
Raed Petro.
#492 by Jason on 5/28/09 - 11:21 AM
hi, yes i noticed that after I had posted :/ ( i'm not a PHP developer )
my next question is what meta data exists in the first flv file?
I suggest addding more time markers than really exist or somthing simular. At the moment the player will get the metadata and "know" how long the video is and stop. regardless that it is now longer.
Your thoughts?
#493 by Raed Petro on 5/28/09 - 12:08 PM
Then doing the same with file 2 .. seeking it from the middle via $seekat2 (i.e. skipping its header/metadata) .. but the player doesn't like this part :-)
I think the problem is something linking "joining" the 2 parts .. may be at the end of the part first or at the beginning of the second part .. or may be something else :-)
#494 by Jason on 5/28/09 - 12:16 PM
I reckon that if there is meta data the player will stop when it thinks its the end of file.
Let me know if metadata still exists, what your attempting certainly seems dooable :)
I suspect your trying to deliever video adverts ?
#495 by Raed Petro on 5/28/09 - 11:19 PM
I thought metadata in the header only. Sorry I am not very good in this issue, I know more about PHP .. not FLV and flash stuff.
Finally I got it working :-)
The problem was that every joined FLV must begin with a keyframe and ends with a keyframe. When I did this it worked fine.
Thanks Jason.
#496 by Stefan Richter on 5/29/09 - 9:01 AM
can you post your final code please to get this to work?
#497 by barot on 6/12/09 - 12:46 PM
nice code!!
but can u give me the whole file like html file to php file !!
i mean whole code to run a video!!
its urgent!!
thnx in advance!!
pls
help me!!
thnx!! thnx!! thnx!! thnx!! thnx!!
#498 by barot on 6/12/09 - 12:49 PM
nice code!!
but can u give me the whole file like html file to php file !!
i mean whole code to run a video!!
its urgent!!
thnx in advance!!
pls
help me!!
thnx!! thnx!! thnx!! thnx!! thnx!!
#499 by Jochum on 6/20/09 - 8:50 PM
I tried blocking flv's for "preventing illigal views", but it gave me a lot of problems. So I started red5 hosting...
Put my name in the email and i might be able to help ;0)
#500 by Brian Lorraine on 7/8/09 - 5:09 PM
about adding junk to the beginning of the file.
You'd have to be able to modify the player. I've been using JW player which I can't just crack open in Flash. I might switch to scrubber through and try it out.
I have a feeling the only part that gets cached, though, is the actual video. I wonder... when I get some time I might try it.
#501 by videolar on 8/3/09 - 4:21 PM
#502 by Jason on 8/3/09 - 4:34 PM
The part that gets cached is the entire http response so in theory the video + junk will reside local not just the video.
I would be very interested in what you manage to do here.
Another option, deliver the video content over SSL, AFAIK this content will not get cached localy for security reasons :)
HTH
#503 by josh on 8/18/09 - 3:58 PM
now what?
how do i "tell" the page where the video actually goes (where it is placed within the web page)?
#504 by VideoNik on 10/30/09 - 12:12 AM
That's a server script. You should not pu it on a page but put it on a server, customize it and then point to it from a player.
#505 by Nasheet on 11/4/09 - 10:14 PM
nice code. I am unable to test it. i just set all the filenames or others variable hardcoded like
<?
/*/
security improved by by TRUI
www.trui.net
Originally posted at www.flashcomguru.com
//*/
//full path to dir with video.
$path = 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpstream\golfers.flv';
//$seekat = $_GET["position"];
$seekat = 0;
//$filename = htmlspecialchars($_GET["file"]);
$filename = htmlspecialchars("golfers.flv");
$ext=strrchr($filename, ".");
//$file = $path . $filename;
$file = $path;
if((file_exists($file)) && ($ext==".flv") && (strlen($filename)>2) && (!eregi(basename($_SERVER['PHP_SELF']), $filename)) && (ereg('^[^./][^/]*$', $filename)))
{
header("Content-Type: video/x-flv");
if($seekat != 0) {
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
$fh = fopen($file, "rb");
fseek($fh, $seekat);
while (!feof($fh)) {
print (fread($fh, filesize($file)));
}
fclose($fh);
}
else
{
print("ERORR: The file does not exist"); }
?>
Can u please help me on this. In am new in php
#506 by Renato Chea on 11/23/09 - 4:53 AM
now I have a question,
How I can implement here a preload for this progressive download.
I wish to read the output buffer of php and start to play some content of the movie, before the movie is full downloaded.
Please help me !!!!
:D
#507 by Gary on 1/29/10 - 8:55 AM
Ta
Gary
#508 by Stefan Richter on 1/29/10 - 9:30 AM
sorry about that. It should be fixed now.
#509 by Flv Player on 5/20/10 - 11:03 AM
#510 by Ajay on 6/1/10 - 12:11 PM
Flash trace message is throwing "NetStream.Play.StreamNotFound" and getting buffering video followed nothing is playing after I seek to any position.
Have a look at the below trace message.
match at 36.002 and 3671843
play http://localhost/flvprovider.php?file=Extremists.f...
NetStream.Play.StreamNotFound
Please note I am using localhost to run my php file, It seems the php file is working properly if I run php in browser.
I have added the data using flvmdi.
Can you please help me in fixing this issue.
Thanks in advance.
#511 by Ramon Fritsch on 9/4/10 - 6:36 PM
I did some f4v streaming/trim like the flv pseudo stream in pure PHP.
check it out on http://github.com/ramonfritsch/php-f4v-streming
Fell free to help me grow this project and help even more users to use f4v pseudo stream without configure complicated extensions or extra lighttpd servers.
cheers
#512 by Dragan on 3/1/11 - 10:40 PM
For example: my site is example.com and I embed with flowplayer, video file from someotherexample.net ?
Is this posible with this script ?
#513 by Stefan Richter on 3/2/11 - 9:02 AM
sorry but that's not possible.
#514 by Dragan on 3/2/11 - 3:06 PM
Do you know any other method to use it with flowplayer pseudeo streaming.
Example - My situation:
INDEX.html - my file on my VPS server with flowplayer code (in INDEX.html is embed code, srt file+ "flv remote file"....)
In ARTICLE - I put IFRAME in new ARTICLE to load my INDEX.html from specified folder on my VPS server (INDEX.html is file with flowplayer embed pseudo streaming script, ARTICLE is place where is IFRAME script to load INDEX.html )
pseudo streaming - load my INDEX.html and automaticly find, download and stream remote FLV files with my own FLOW player on my web site
Is this option possible to do, and if is can you tell me how to setup pseudo streming for my situation.
Greeting.
#515 by new on 4/25/11 - 4:37 PM
thanks in advance
#516 by Richard Franklin on 7/12/11 - 9:30 PM
Cheers
Rich
#517 by Flv Player on 7/20/11 - 8:36 AM
#518 by Michael Kaufman on 7/29/11 - 11:35 PM
This stuff was really helpful and I got my pseudo streaming to work great - also got it working with 'mod_flvx' on Apache.
Question though, surely by now there is an encoder that injects the arrays rather than using flvmdi, no? AME 5.5 doesn't seem to do it out of the box. Can you recommend any tools that inject the needed metadata arrays and encode simultaneously? Does Squeeze?
Thanks! MK
#519 by dramaqueen on 8/23/11 - 3:28 AM
Do you happen to have this in AS3 version?
#520 by ankur on 9/21/11 - 10:41 AM
<html>
<head>
<!-- include flashembed -->
<script src="http://static.flowplayer.org/tools/download/1.2.5/...;
</head>
<body>
<!-- setup container for the player -->
<a id="player" style="width:500px;height:320px;display:block"></a>
<!-- third argument is flowplayer configuration. you cannot use events -->
<script language="JavaScript">
flashembed("player", "http://releases.flowplayer.org/swf/flowplayer-3.2....;, {config: {
clip:'C:\wamp\www\project\user\flowplayer-700.flv',
plugins: {
controlbar:null
}
}});
</script>
#521 by zapkolik on 10/24/11 - 6:19 PM
#522 by Daniel Jones on 11/9/11 - 10:22 AM
#523 by Daniel Jones on 11/9/11 - 10:24 AM
#524 by Georges sleiman on 12/29/11 - 1:58 AM
I would like to make a website to help my clients watch movies Broadcasted from a server I make, so we don't need to wait the "LOADING" word as we have slow Internet speed. This website will be offline, only for my clients. I'm starting from scratch, any can help my step by step to reach it? Thanks in advance