Stream Flv With PHP

There is good thread going in chattyfig mailing list regarding how to do streaming of flv using php. I had came to know that new version Buraks flvmdi flv metadata injector can be easly get the times and poistions of each frames of flv in a array. I am able to create an example video player which can request the flv file and seek, stream & play it from any given location using server side scripting php.

Its very important to insert metadata into flv using flvmdi. If your webserver is windows based then flvmdi is going to be very usefull. You can easly execute following command to insert metadata into flv.

Following PHP Code can be execute any command on shell:

ExecShellCommand("flvmdi27b.exe inputflvfile outputflvfile /k", true);

function ExecShellCommand($command, $hide=true) {
if (!($p=popen(“($command)2>&1″,”r”))) return 126;
while (!feof($p)) {
$l=fgets($p,1000);
if (!$hide) print $l;
}
return pclose($p);
}

I had used Flash Video Player 2.2 done by Jeroen Wijering.

Download an example of all sources.
Download Buraks Flvmdi7b.
Download Flv Player 2.2

The only drawback is that Buraks Flvmdi is only available for windows.

I think if anyone write down for linux then it will be going to be huge. I hope someone can do something about it. :)

You can also check out same efforts by Stefan Richter on his weblog & Brad Murray on his weblog.

I think this will be really good to cut load on fcs for flv streaming and also able to save bandwidth of fcs.

Sending a BitmapObject via Flashcom with use of getPixel & SetPixel Method

I had looking around on www.flashcomguru.com for some other thing. I had found that stoem posted that sending bitmap object via flashcom don’t working. I also tested out by sending as sharedobject using send method on client side. It is always traced as undefined.

There is an alternative method for it to send the bitmap object to all connected client using the getPixel and setPixel method by using new Bitmap API in Flash 8. This method is relatively slow in case of big image beceause it has to pass the large pixel array with the color information to all client. Client will process the pixel array with color information to generate bitmap on client side.

Here is the direct link of example: Screen Test
(Note: This example will take a snapshot from the webcam if you have connected and send it to all clients connected to server.)

Here is the fla link of example: Download Fla

I am also looking for any other solution or to speed up the processing of color information array. This Bitmap object will be very usefull to take a snap of any movie clip that run in flash screen and able to deliver to all client via flash communication server.