Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animated gif as video thumbnail #21

Open
0xERR0R opened this issue Apr 9, 2021 · 3 comments
Open

Animated gif as video thumbnail #21

0xERR0R opened this issue Apr 9, 2021 · 3 comments

Comments

@0xERR0R
Copy link

0xERR0R commented Apr 9, 2021

Thumbsup generates a jpeg thumbnail for a video file. It would be cool, if it could be possible to generate a gif with some frames from original video and play them in an endless loop

@rprieto
Copy link
Member

rprieto commented Apr 13, 2021

Hi, that’s a great idea!

I’m thinking of generating an extra thumbnail, so that themes can choose what to display. They could even display the animation on-hover only, like YouTube does, to avoid having a busy looking page.

Looking at what YouTube does, I have a few questions:

  • They seem to randomly select a few seconds from the video, and then create a low-res preview of that. Another option would be to randomly choose 10 frames, and play them at very slow speed (like a slideshow). Both seem possible quite easily with ffmpeg.
  • They use WebP format for the video. For now I’m thinking of using GIF as you suggest, first because it’s widely supported, and because it seems easier to swap-out between JPG/GIF when the person hovers.

What do you think?

@0xERR0R
Copy link
Author

0xERR0R commented Apr 13, 2021

To keep it simple, I would just take the video length and divide it with (let's say 10) and generate gif with 10 frames (each frame each 1/10 of video's length). For example: 2 min video = 120 sec, each 12th second an image as gifs frame. Animation only on hover is cool, but will it also work on mobile devices?

Regarding the WebP format, to honest, I'm not aware what are the differences, but according to https://caniuse.com/webp it should completely replace GIF and has wide browser support, so maybe it is a better option.

@rprieto
Copy link
Member

rprieto commented Apr 13, 2021

That's a good point for mobile devices. Looking at YouTube again, they don't show any previews on their mobile website. There might be a "touch" event we can detect, I'm not sure. This is something the themes will be able to customise.

I will look into this feature, thanks again for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants