Page tree
Skip to end of metadata
Go to start of metadata

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.

  1. 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.

  2. You can create a file named ffmpg.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.

Windows

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/ffmpg.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.

Mac

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.

  1. Open Finder
  2. Go to Downloads and open the ffmpeg DMG that you just downloaded
  3. Keep it open and select Applications in a new Finder window.
  4. Now right-click or two-finger click on Twonky.app and select Show Package Contents in the popup menu
  5. Go to /Applications/Twonky.app/Contents/MacOS/cgi-bin
  6. 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.

Linux

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 ffmpg.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:

SymbolDescriptionExample
$infileinput video fileD:\inputvideo.mpg
$outfileoutput jpg fileE:\outputvideo.mkv
$targetgeometryresolution of the video file1920x1080
$videothumbtimeoffset from the beginning (in seconds) of the frame used to generate the thumbnail5

 

The reference file ffmpeg-video-thumb.desc was originally optimized for FFmpeg 0.8.5

 

 

  • No labels