python - 音视频访问控制
怪我咯
怪我咯 2017-04-18 09:05:04
0
1
403

做一个视频网站,对于音视频免费试看几分钟,然后进行收费该怎么做?
目前我的想法是:
1、使用hls,对视频文件进行切片,然后通过索引来计算当前播放的进度,如果过了免费试看则将视频流掐断。
2、读取视频文件的信息,计算可以免费试看N分钟的偏移,比如说可以试看前5分钟,前5分钟的数据在这个视频文件的偏移是0 - 500kb,那么当用户访问偏移500kb之后的数据时,将视频流掐断。

对于1,有个缺点就是,使用ffmepg切片时,每个片的时间都有一定的波动,比如,我指定每个片为10s,有些片会出现2s、3s。这样进行访问控制时,会出现一定的波动。
我个人认为似乎第二点比较靠谱点。想听听大家的建议,以及大家有没更好的解决方案。谢谢!

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
Peter_Zhu

I don’t know much about video processing. I have done live broadcast services before.

I feel like there is a problem with your method, welcome to discuss.

You seem to think that the amount of data and the playback time are equivalent, but the encoded video file, video frame and video frame are related, so ffmepg will not slice according to the requirements (guess

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!