- Created by user-cfbf7, last modified on Jun 26, 2018
The following article describes how to enable video thumbnail generation for Twonky Server on Windows, Mac and Linux.
To let Twonky Server generate thumbnails for videos, FFmpeg needs to be installed separately on the system where Twonky Server is running. We recommend the usage of statically linked binaries as they already embed all the codec libraries.
In a second step Twonky Server has to be made aware of the installed FFmpeg. There are two ways to use FFmpeg within Twonky Server.
You can copy the FFmpeg executable file into the folder cgi-bin inside the folder where Twonky Server is installed. This is the easiest way and recommended for persons that are not that techy.
You can create a file named ffmpeg.location in the folder cgi-bin inside the folder where Twonky Server is installed. This file contains the path to the folder where FFmpeg is installed. The executable name is not included in the path. The advantage here is that FFmpeg can be updated without copying the file again.
Thumbnail generation will start when you browse your video content. On older devices this can cause some load on the system and can take some time.
The detailed steps to setup thumbnail creation will be described in the following for each Operating system seperatly.
For Windows we recommend to use the static linked release package from https://ffmpeg.zeranoe.com/builds/ It is recommended to select the latest release build. You also need to select your architecture and 'static' linking. FFmpeg is distributed in a zip package.
As mentioned above the easiest way is to put the ffmpeg.exe into the folder cgi-bin. To do that move the extracted ffmpeg.exe from the downloaded package into this folder. The cgi-bin folder can be found in the folder where Twonky Server was installed. On Windows this is usually C:\Program Files (x86)\Twonky\TwonkyServer.
Another way to enable thumbnail creation on Windows is to extract the content of the zip package to a folder on your PC and then create a file named cgi-bin/ffmpeg.location containing one line with the path of bin folder in the directory where Twonky Server was installed.
Twonky Server needs to be restarted once FFmpeg is set up. This can be done from the task bar icon of Twonky Server.
For MacOS we recommend to download the latest stable release from https://evermeet.cx/ffmpeg/ We further recommend to use the DMG package. Here are the successive steps to setup FFmpeg within Twonky on a Mac.
- Open Finder
- Go to Downloads and open the ffmpeg DMG that you just downloaded
- Keep it open and select Applications in a new Finder window.
- Now right-click or two-finger click on Twonky.app and select Show Package Contents in the popup menu
- Go to /Applications/Twonky.app/Contents/MacOS/cgi-bin
- Now drag ffmpeg from the open window into the Finder window. You will be asked for your credentials by your Mac to complete the installation.
To make Twonky Server aware of the changes restart Twonky Server. Select Exit from the Twonky Server icon and then start it again from the Applications folder.
On Linux we recommend to use the latest stable version for your architecture from this site: https://johnvansickle.com/ffmpeg/
Again you have the two options to either copy the ffmpeg executable from the package to the cgi-bin folder or create a file named ffmpeg.location in the folder cgi-bin that contains the location where you extracted the package. The path must not contain the executable name.
The cgi-bin directory is in the directory where Twonky Server was installed. Twonky Server is usually installed at /usr/local/bin/twonkyserver on a Linux system. If you can't remember where you installed Twonky Server you can check where Twonky's resource folder is located with the following URL http://ip-of-twonky:9000/rpc/get_option?resourcedir The resource dir is always located in the folder where Twonky Server was installed.
For the changes to take affect you have to restart Twonky Server. You can use the following command for that http://ip-of-twonky:9000/rpc/restart
Optional: Modify the command line parameters for FFmpeg
The command line parameters are written on the "exec:" line in the following file cgi-bin/ffmpeg-video-thumb.desc. The cgi-bin folder can be found in the folder where you installed Twonky Server.
Please refer to your FFmpeg manual for more information about the different options available with the version of FFmpeg you have installed.
The following variables are interpreted by Twonky Server:
|$infile||input video file||D:\inputvideo.mpg|
|$outfile||output jpg file||E:\outputvideo.mkv|
|$targetgeometry||resolution of the video file||1920x1080|
|$videothumbtime||offset from the beginning (in seconds) of the frame used to generate the thumbnail||5|
The reference file ffmpeg-video-thumb.desc was originally optimized for FFmpeg 0.8.5
- No labels