开发者

PHP time logging

On my site there I'm using a video player (flowplayer), and my clips are in .flv format. My question is if there is any way I can create php file which will read/stream data from .flv? Like feed.php?vid=123

(Yes i know this can be done by opening file locally and outputing it but here is the catch)

Every minute the user is streaming, I want to put that information into mysql. How can I do this? Maybe using a loop and reading file in chunks? ( while() ... ? 开发者_如何学Go)

Yes, I know I could do this using javascript, but people could steal my .flv directly by using own player and eat my bandwidth.


If you're serving up bytes, the bytes can be copied and stored. You can NOT prevent theft of data on a website, because a website which does not serve up data is a logical impossibility.

You can record how many chunks have been sent out, but there's no direct correlation between "X bytes = Y seconds", because video compression ratios are content-dependent. You'd need to parse the .flv data somehow and figure out how many frames have been sent, from which you can then figure out how many seconds/minutes have been displayed.

Once you've got that figured out, then recording "play times" will be the least of your problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜