V
V
Vertexis2017-11-08 22:57:49
PHP
Vertexis, 2017-11-08 22:57:49

Create a 5 second preview for a video file. How?

On YouTube or many other video hosting sites, I often saw such a feature that when you hover the mouse over the preview of the video, a 5-second fragment from the video itself is played (somewhere around the middle).
The question is how and by what means is this done?
ZY - I see the easiest way to assemble a GIF file using avconv on the server. Next, on the hover event, play this GIF instead of the static preview.
But an inner voice says that this is not the right way. where to look, where to dig? Thanks for the replies in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
iRedds, 2017-11-08
@Vertexis

The same youtube returns webp animation (consider gif)
The question is whether rendering is in real time / cache or prepared in advance.

Y
Yuri, 2017-11-09
@LazyDev

Prepare a preview with ffmpeg, in the same webp, then save it to disk and change the static preview to a preview in webp about hover.

V
Vertexis, 2017-11-09
@Vertexis

Switched from gif format to webp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question