I'm trying to find out if it's possible to create a preview image or thumbnail from an MP4 byte stream, or a file if necessary.

I want to do this server-side, so that I can simply send the image rather than the entire video to the client. But I'm having a hard time finding anything at all, whether it's on the server or the client.

The closest code I've found is this post, which puts the MP4 in a <video> tag, then draws an image to a <canvas>, but this seems to be not entirely suited for what I'm trying to do. Loading the entire video for the sole purpose of showing a preview (the user will not be playing the video, just seeing the thumbnail) will increase the loading time substantially.

I don't think I can use FFmpeg or other 3rd party tools (which is what most SO answers recommend), because the code I'm creating is for a commercial product.

Q: Is it perfectly alright to incorporate the whole FFmpeg core into my own commercial product?

A: You might have a problem here. There have been cases where companies have used FFmpeg in their products. These companies found out that once you start trying to make money from patented technologies, the owners of the patents will come after their licensing fees. Notably, MPEG LA is vigilant and diligent about collecting for MPEG-related technologies.

Related posts

Recent Viewed