Scenario – I have a site that I would like to host videos on. The site uses very affordable shared hosting from namecheap.com. One of the drawbacks of shared hosting is the inability to run software packages on the server like ffmpeg. With ffmpeg installed I could have used software like clipbucket to quickly create the site and convert any video uploads from many different formats automatically similar to Facebook or YouTube. That being said I chose to use Word Press and the very nice Cool Video Gallery plugin. Unfortunately the Cool Video Gallery plugin relies on ffmpeg to create thumbnails for the video clips. Here is my solution.
- I convert all of my videos using the settings in my previous post found Here. This is to ensure compatibility and reduce the file sizes. You can play with the settings to get even smaller files to suit your own taste.
- Next Download the windows version of ffmpeg and extract ffmpeg.exe to a directory of your choice. In this example I placed it on the desktop in a folder called “website videos”
- Next place the videos that you would like thumbnails for in the same folder.
Download this file to the same folder Make Thumbs.bat
or Create a new text document in this folder and name it something logical like “make thumbs”. In this text file type the following line (changing .mov to whatever extension your videos have) and save
for %%i in (*.mov) do ffmpeg -i “%%i” -f mjpeg -t 0.001 -y “%%~ni.png”
- Change the file extension from .txt to .bat.
- Run “Make Thumbs.bat” and you should see .png files for each of your videos appear.
- If you can run ffmpeg from the command line but not a batch file it is because you need double “%%”. Many forums are explaining how to do this from a command line as opposed to a batch file so the syntax will have single “%”
- You can just as easily replace the ni.png with ni.jpg if you prefer Jpeg images
- There are lots of ways that this can be done but this method works great for me.