Create thumbnail of video in Firebase with Google Cloud function | C2C Community

Create thumbnail of video in Firebase with Google Cloud function

  • 14 December 2022
  • 7 replies

Userlevel 3

I’m trying to create a cloud function to create a thumbnail image from a video uploaded to Firebase storage and save the thumbnail image as a .PNG with the same name as the video and in the same folder in Firebase.

I’ve tried several different solutions without any luck.

Is there anyone that could lend a hand pointing me in the right direction on how to achieve this?


Thanks in advance. 





Best answer by malamin 16 December 2022, 02:20

View original

7 replies

Userlevel 7
Badge +29

@kanthrian, @Tomova, @matiascoca, @royca, @damisparks you are all Cloud Functions specialists. Perhaps you could assist @Kevin OConnell here? 



Userlevel 7
Badge +29

and @Kevin OConnell, although I have already read Kapsule’s introduction, it would be really nice if you could introduce yourself and write more about you personally. Please head over to the C2C Lounge and introduce yourself using this template. It would be great for all of us and our community members to get to know you a bit better 😎

Also, always keep an eye on our upcoming events. With the new years, you will get to see more and more of them of course. 

Any questions you may have, you can always reach me or any of my fellow community managers @ilias or @valdecir.carvalho 😎

Again, welcome to C2C! :)

Userlevel 2

@Kevin OConnell 

It could be pretty frustrating that you tried different solutions without any luck. 

What did you mean by trying different solutions without any luck? 

  • What is the challenge with the solutions? 
  • What is not working? Did you get the desired result? 

The question mentioned above will help us help you.

Userlevel 3

Thank you all for the response. I’m stunned (in a positive way) at the support you’ve shown already. Thank you. 

@damisparks Apologies for the lack of detail to my post. Here is a detailed look into what I’m trying to accomplish and the steps I took towards the desired outcome. 

I’m open to any and all solutions to achieve the desired outcome.

I appreciate your time and support. Thank you. 🙏

Userlevel 3

Apologies, I didn’t mean to mark the post as solved. 

How do I unmark this as solved? @Dimitris Petrakis 

Userlevel 7
Badge +35

Hello @Kevin OConnell 

Thank you for asking the question.  But you didn’t mention here which type of error message you're receiving.

However, The sound is good you have experience with Google cloud functions and firebase.  I think you should check the following common scenario that might help you to find a solution for your case. Please review the following steps for your exiting experiment.

  • Please ensure that the Firebase and Google Cloud accounts are set up with appropriate permissions.
  • Don’t forget to enable the cloud function API and billing for your project.
  • You should make sure your cloud storage file read and write permissions are well defined.
  • Check that the video file upload source destination and target save storage location are correctly mentioned in your code.
  • Then, verify that the video file name is unique and that it contains a function that will be used for your png file.
  • Sometimes you will find video encoding errors based on your source media such as android camera video or iPhone video encoding may give you an extra headache to upload in cloud storage. Please look at the iPhone and Android video information.
  • Examine your code carefully for any transformation functions, such as image height and weight.
  • Check your video thumbnail for the Language library that was declared at the top of the function and is it successfully imported?
  • More examples of common media transformation functions including transcoding images, moderating content, extracting EXIF metadata. The full list of examples is available on GitHub.

Also, Check the video  tuorial and links below  it might be help you to implemention the code as example.

Userlevel 7
Badge +29

Apologies, I didn’t mean to mark the post as solved. 

How do I unmark this as solved? @Dimitris Petrakis 


No worries @Kevin OConnell , I unmarked my reply as “best answer”, but I marked @malamin’s detailed reply as “best answer” 😅 

Please let me know if his thoughts have been useful.