Really Cool New Feature in My WordPress Video Plugin

Choose From Video

I’ve always been annoyed that my WordPress “Video Embed & Thumbnail Generator” plugin required FFMPEG to make thumbnails. Most people are on shared hosting and aren’t allowed to install software like that on their servers. And even if they are allowed, configuring and installing it is a pretty substantial hassle.

I started my most recent coding burst with the inspiration that I could show the video in a little player in the browser and use it to find the exact timecode a user wants to generate a thumbnail. I planned to send that number to FFMPEG in order to get the image, but when I saw the video in the browser it looked exactly like a thumbnail. I wondered why I couldn’t just grab the image that the browser had gone through all the trouble of decoding already. It turned out I could do exactly that, and it was surprisingly simple.

So as of version 4.2, you don’t need any special software on your server if you want to turn a frame of video into an image. There are some limitations though. Your server needs to have either ImageMagick or GD. Most servers have one of these enabled, so that shouldn’t be a problem. Your browser also has to provide native support for your video format. Plugins will not work. That means this doesn’t support FLVs, WMVs, AVIs, or MKVs. Browsers have built-in support for H.264 MP4s, WEBM, or OGV. There is a helpful chart on Wikipedia that details the array of browser support for these formats. The short version is if you use H.264 MP4 videos in Chrome then you should be fine.

I also moved my development onto Github, which I am loving. It’s much easier to keep track of everything, and it allows for savvy users to offer their own code to merge into the plugin. If you’re having any trouble with the new release, please post it in the issues section.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply