javascript-php do video website server very card what to do??

Source: Internet
Author: User
Tags website server

Environment:
php5.3.9
Apache 22
mysql5.6.x
Windows

Several problems encountered when using the video website (Local environment test):

A. 几十个视频。通过 canvas 截取视频第一帧做封面。

    Video Source list var vsrclist = [Src1, Src2, src3 ....]; Queue mode intercepts the first frame of the video (if it is not taken in a queue, basically all will intercept the failure ....        )///Even if the first frame of the video is taken in a queue, there is a high chance that the video first frame intercept will fail//Open the console network, a large number of requests show pending ... var dequeue = function () {        var CurItem = Vsrclist.shift ();                        if (CurItem) {//This side is added to the node on the page:        Dequeue ();        }    };           Dequeue ();        Get video first frame function getvshowpic (src, FN, opt) {var v = document.createelement (' video ');        var cav = document.createelement (' canvas ');        var ctx = Cav.getcontext (' 2d ');        V.currenttime = 1; V.addeventlistener (' Canplay ', function () {if (opt = = = = undefined) {opt = {W            : V.videowidth, H:v.videoheight};            } ctx.drawimage (this, 0, 0, opt[' W '), opt[' H ']);            var src = cav.todataurl (' image/jpeg ', 1);        FN (SRC);        }, False); V. src = src; }

B. 由于第一个问题中已经出现十分卡顿的现象。视频播放的时候就更加夸张的突出了。主视频一直显示加载中,相关视频列表封面全部截取失败

问题1:是否php就不适合做视频网站??
问题2:像优酷,爱奇艺之类的视频网站运行如此顺畅的原因是什么?
问题3:类似于优酷,他们的视频封面是手动上传的还是自动截取视频第一帧做的封面??,因为若是单纯的播放一个视频的话,倒是不会出现卡顿的现象,我只要把自动截取视频第一帧的代码给拿掉,就不会出现任何卡顿...

By the way share the following URL ha:www.lysqdx.com

Reply content:

Environment:
php5.3.9
Apache 22
mysql5.6.x
Windows

Several problems encountered when using the video website (Local environment test):

A. 几十个视频。通过 canvas 截取视频第一帧做封面。

    Video Source list var vsrclist = [Src1, Src2, src3 ....]; Queue mode intercepts the first frame of the video (if it is not taken in a queue, basically all will intercept the failure ....        )///Even if the first frame of the video is taken in a queue, there is a high chance that the video first frame intercept will fail//Open the console network, a large number of requests show pending ... var dequeue = function () {        var CurItem = Vsrclist.shift ();                        if (CurItem) {//This side is added to the node on the page:        Dequeue ();        }    };           Dequeue ();        Get video first frame function getvshowpic (src, FN, opt) {var v = document.createelement (' video ');        var cav = document.createelement (' canvas ');        var ctx = Cav.getcontext (' 2d ');        V.currenttime = 1; V.addeventlistener (' Canplay ', function () {if (opt = = = = undefined) {opt = {W            : V.videowidth, H:v.videoheight};            } ctx.drawimage (this, 0, 0, opt[' W '), opt[' H ']);            var src = cav.todataurl (' image/jpeg ', 1);        FN (SRC);        }, False); V. src = src; }

B. 由于第一个问题中已经出现十分卡顿的现象。视频播放的时候就更加夸张的突出了。主视频一直显示加载中,相关视频列表封面全部截取失败

问题1:是否php就不适合做视频网站??
问题2:像优酷,爱奇艺之类的视频网站运行如此顺畅的原因是什么?
问题3:类似于优酷,他们的视频封面是手动上传的还是自动截取视频第一帧做的封面??,因为若是单纯的播放一个视频的话,倒是不会出现卡顿的现象,我只要把自动截取视频第一帧的代码给拿掉,就不会出现任何卡顿...

By the way share the following URL ha:www.lysqdx.com

    1. The focus of the video site is the CDN cache and bandwidth of the video, and what language does it matter

    2. Others use a CDN Ah, looked at you should be nothing more than a exercise, how and others than

    3. Read your description, speculate that your so-called cover is read from the video every time, that is not the card is strange, a mature video site system after the video upload will be offline video processing, including not limited to the following work (indefinite):

      • Standardized video formats (sometimes non-standard formats do not enable video caching on the browser side)

      • Compression into multiple quality video formats (e.g. low-medium-high, or 240p, 360p, 480p, 720p, 1080p, etc.)

      • Capture some frames as a preview (you can intercept n and then manually intervene)

      • Add watermark (optional)

      • Upload to CDN

Video sites have a large bandwidth requirement. is not a server configuration. Live broadcast to server requirements high!

You're doing this.
is running in local JS.
No, it's weird.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.