Home  >  Q&A  >  body text

html5 - video标签的poster封面图怎么从视频中截取?

一般视频的封面是怎么动态截取的?
有php的方案吗?或者js的方案

PHPzPHPz2741 days ago1551

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 13:12:51

    It is usually handled manually, which means you need to prepare a related video picture at the same time as the video.
    Some browsers support automatically selecting the cover image from the video for display. The prerequisite is that the video must be loaded, so the recommended method is to handle it manually.

    Of course, if you really want to capture pictures from the video, then you have to parse the video (this is related to the format, some videos may not be parsed), which is not worth the gain, and requires a back-end to process it. As for the front end, js provides some screenshot processing methods, which are not suitable for this.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:12:51

    I intercepted dynamically, and it is recommended to use ffmpeg.
    Just read the documentation for usage.

    reply
    0
  • Cancelreply