0

I wanted to know what is the best practice for generating thumbnail from a video.

After exploring I have come across two ways:

1) Using ffmpeg php on the server side

2) Using canvas like this https://gist.github.com/adamjimenez/5917897 on the frontend.

Which of the above two options is better? Also are there any other third party solutions(paid or free)?

azero0
  • 2,220
  • 3
  • 20
  • 31

1 Answers1

1

I don't think there is a 'right' answer - it will depend on your needs.

Server side

  • Generating the thumbnail server side has the advantage that it reduces client side processing overhead and, depending on how your page is structured, may speed up the page load and user experience.
  • Generating server side allows you to have a 'human' check stage, or even an automated check more easily, if this is important - in other words make sure the selected frame the thumbnail is from is a good one. This is actually quite important if it is for some sort of paid video service.
  • Server side also allows you have consistent thumbnail across devices - i.e. Android, iOS and Browser.

Client side

  • Generating on the client side simplifies your server side workflow.
  • Although, the load is probably not that high you are also reducing the amount of server resources you need and effectively using the users own device to do some of the work.
Mick
  • 24,231
  • 1
  • 54
  • 120