In last post, I did mentioned that I am working on my first plugin which was a surprise. So, here I am with my plugin called “Video Compressor”.

“Video Compressor” plugin idea came to my mind when I had a lot of trouble while playing videos from my portfolio website. It is not as powerful as commercial available plugin but I had a fun-time playing with the plugin.
So, let’s explore control flow:

I think it is quite clear from above control flow. Once you upload video, php starts ffmpeg and compresses original uploaded temporary video. After compression, it deletes original uploaded video and inserts compressed video as new attachment media.
But, there are some drawbacks of this plugin. You must have a dedicated hosting with SSH support in order to have ffmpeg work. Another problem with the plugin is “exec” is not allowed on some host for security reason.
Final Words
Possibilities are endless. I have a thought to integrate this plugin into built-in WordPress media uploader. It makes life much easier to upload multiple videos at a time while they can compressed in background with various compression options.
If you found this plugin interested and eager to explore it’s source code, just ping me back on hi@anuragvasanwala.in.
Cheers,
Anurag

Leave a comment