The code:

<?php $local_id = $_GET['id'];

mysql_connect("localhost", "root", "") or die("Could not connect: " . mysql_error());
mysql_select_db("database");
$sql = mysql_query("SELECT * FROM `videos` WHERE `id` = ".$local_id." ");
while($row = mysql_fetch_array($sql)){$file = $row["file_url"];}

header("Expires: Mon, 20 Dec 1980 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Pragma: no-cache");
header("Content-Type: video/flv");

readfile($file); ?>

The file is really a .flv one however it takes ~ 1 min. to load the recording

So what can i actually do to load it faster?

Is code correct?

Don't use output loading for moving large files. php needs to keep entire file in memory and wait until it's totally read before passing on to the customer. Just getting rid of the ob_* lines should work.

First factor i'd have to say is putting a catalog around the Id area to lower research time... and employ memcache to cache DB results Without having constraints around the atmosphere I'd put a caching reverse proxy like nginx which caches the HTTP response making use of your caching headers and can be for each client. Alternatively you will find hardware products which do this for you personally... usually quite costly though