views:

1965

answers:

5

Hi,

I'm building a streaming video site. The idea is that the customers should pay for a membership, login to the system, and be able to view the videos. I'm going with FlowPlayer for showing the actual videos.

The problem now is, the videos need to be stored somewhere publically and the url to the .flv files needs to be passed to flowplayer for it to be able to show them. This creates a problem because anyone can do a view source, download the video, and distribute it all across the internet.

I know some people serve images using php by doing an image header() and then they can do something like:

<img src="image.php?userId=1828&img=test.gif" />

The php script validates the user ID and serves up the .gif and the actual url of the gif is never revealed.

Is there anyway to do this with .flv or any other video format also? E.g, the file and user ID passed onto the PHP script, it validates them, and returns the video?

+3  A: 

The short answer is that no, you're never going to be able to prevent people from downloading your videos if they want to. There are various ways to make it trickier for them to do it, but there's no foolproof method. You're hitting what is basically the entire problem with DRM - you can't show someone your content without giving it to them unencrypted at some point, and if they can view it, they can rip it.

Chad Birch
My idea is that the url used to download it will be unusable the next time they try it. I.e each url could be used only once. How would they download it in this case?
Click Upvote
Only once - playing the file in your player, while simultaneously capturing the packets you're sending them, and saving the data to disk.
Piskvor
A: 

Since your flv player is a flash application, it will always be possible to download and decompile it. When decompiled the actual url to the flv will be visible. So it won't really make any difference if you are using direct url's to the flv movies or something like you described in your question

<img src="image.php?userId=1828&img=test.gif" />
Roel Snetselaar
+3  A: 

You can set up a directory containing the FLV files on your webserver that can only be accessed by PHP, then in your PHP script you can authenticate the user as usual and simply send a header to the browser telling it to expect an FLV, then echo the raw FLV data:

<?php
// here is where
// you want your
// user authentication

if ($isAuthenticated)
{
  header("Content-type: video/flv");
  echo file_get_contents($pathToFLV);
}
?>

As Chad Birch discussed, this will only prevent people from linking directly to the video - you can't prevent piracy this way.

TenebrousX
Of course this won't prevent people from snagging the video once the flow player renders it. But I guess it will obfuscate it in the way the parent seemed to want to.
Tuxmentat
I plan to use a ticketing system, so each time they click the video on my site, it will generate a one-time-use ticket ID and pass this on to the flv serving script.
Click Upvote
each ticket ID could only be used once. As soon as its received and authenticated by the flv serving script, it deletes it so it cant be used anymore. How would they pirate it with this system?
Click Upvote
They just make the request for the ticket instead of your player doing it, you really won't be able to stop it.
Chad Birch
@Click Upvote[10:49]:After the user is authenticated, **you send the data to them**. Even if it is your player making the request, the user could grab the response from the packetstream.To use the cryptographic analogy, Alice and Eve are the same person here,i.e. you can't have your cake and eat it.
Piskvor
A: 

Please google the word Pseudostreaming you will get the answer There are some servers like lighttpd which has inherent support for flv streaming....

I hope you will get the answer.........

A: 

@TenebrousX

What if you have a video that is larger than your memory allows (the memory limit set in php.ini)?

Do files count towards your memory limit or are they seperate? Or is there some sort of buffering going on?

Thanks

ActionOwl