NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

dsnpevl's avatar
dsnpevl
Virtuoso
Nov 11, 2014

Koken won't create thumbnails for videos

On my ReadyNAS 516, I installed and use Koken to run my website http://fotografeer.nl.
It mostly works fine, but when I would upload video files I never got any thumbnails created in the library overview. Just a black rectangle with a rotating wait icon in it.



Initially I was wondering if my video codecs were wrong, but the same video's created nice thumbnails on Windows and Facebook. Koken actually uses ffmpeg to create video thumbnails. Only after installing a much newer version of ffmpeg on ReadyNAS 516, I was able to get the thumbnails to work. Let me give you a step-by-step approach for my solution.

1) Try to upload a small video into an album in your Koken library. Your video is uploaded, but no thumbnail is created. (See image above)

2) Check the Koken setting via the menu: Settings -> System. This lists the System information page with (among others) the ffmpeg version, e.g.:

FFmpeg           Installed (Version 1.2.2)

If you see the 1.2.2 version (or 1.2.6 in my case, after some upgrade attempts), it means you have a relatively old version of ffmpeg.
If it lists "Uninstalled", then your Koken installation cannot find the ffmpeg command on your system at all.

3) So ffmpeg seems to be installed. Use a SSH terminal to connect to your ReadyNAS as root.

4) Check the location of the current ffmpeg.

which ffmpeg

/usr/bin/ffmpeg

5) Verify the version of ffmpeg

ffmpeg -version

ffmpeg version 1.2.6
built on May 16 2014 16:12:16 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc=cc --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-stripping --enable-small --disable-amd3dnow --disable-bsfs --disable-devices --disable-protocols --enable-protocol=file --enable-avresample --disable-parsers --enable-parser=aac --enable-parser=ac3 --enable-parser=dvbsub --enable-parser=dvdsub --enable-parser=flac --enable-parser=h261 --enable-parser=h263 --enable-parser=h264 --enable-parser=mjpeg --enable-parser=mlp --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=vc1 --enable-parser=vorbis --enable-parser=vp3 --enable-parser=vp8 --disable-demuxers --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=asf --enable-demuxer=avi --enable-demuxer=dts --enable-demuxer=dv --enable-demuxer=eac3 --enable-demuxer=flac --enable-demuxer=flv --enable-demuxer=h261 --enable-demuxer=h263 --enable-demuxer=h264 --enable-demuxer=matroska --enable-demuxer=mjpeg --enable-demuxer=mov --enable-demuxer=m4v --enable-demuxer=mp3 --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegtsraw --enable-demuxer=mpegvideo --enable-demuxer=ogg --enable-demuxer=vc1 --enable-demuxer=wav --disable-decoders --enable-decoder=aac --enable-decoder=alac --enable-decoder=eac3 --enable-decoder=flac --enable-decoder=flv --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mpeg2video --enable-decoder=mpeg4 --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --disable-muxers --enable-muxer=mp3 --disable-encoders --enable-libmp3lame --enable-encoder=libmp3lame --disable-filters --enable-filter=aresample
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102

6) When you try to create a thumbnail from the command line you will get an error message

ffmpeg -i gitaar.mp4 -vframes 1 gitaar.jpg

.... (other messages)
[NULL @ 0x642640] Unable to find a suitable output format for 'gitaar.jpg'

7) A more current version of ffmpeg is e.g. 2.4.3, so an update of ffmpeg is required. But I didn't want to change anything to the default OS, so I opted to install the newer version in the root directory. Thanks to IIogan (see http://ffmpeg.gusari.org/viewtopic.php?f=11&t=1786), I found a site with static builds for ffmpeg (see http://johnvansickle.com/ffmpeg/). Here I downloaded ffmpeg-2.4.3-64bit-static.tar.xz and placed it in /root on RN516.

8 ) Untar the archive and store the new version in /root/bin

cd ~
tar xf ffmpeg-2.4.3-64bit-static.tar.xz
mv ffmpeg-2.4.3-64bit-static/ bin/
ls bin/

ffmpeg ffmpeg-10bit ffprobe manpages presets qt-faststart readme.txt

9) Check if you can create thumbnails. For that I put a video called gitaar.mp4 in /root.

cd ~
./bin/ffmpeg -i gitaar.mp4 -vframes 1 gitaar.jpg

This new 2.4.3 version of ffmpeg will create a thumbnail called gitaar.jpg.



10) Now we have proven that we have a working ffmpeg, we just need to make sure that Koken is using that version. I found out that /root/bin is not an ideal place to put it, since Koken has no privileges there to execute the command. So I moved it to /home/admin/bin and changed the owner to admin:admin. So now you can start it with /home/admin/bin/ffmpeg and it can also be started from Koken.

mv /root/bin/ /home/admin/bin/
cd /home/admin/
chown -R admin:admin bin/

cd ~
/home/admin/bin/ffmpeg -i gitaar.mp4 -vframes 1 gitaar.png



11) You need to update a page called user_setup.php from Koken to point it to your new ffmpeg (see http://help.koken.me/customer/portal/questions/888282-koken-not-detect-ffmpeg).

find / -name "user_setup.php"

/data/.apps/koken/web/storage/configuration/user_setup.php

vi /data/.apps/koken/web/storage/configuration/user_setup.php

Change the line containing the FFMPEG_PATH to point to /home/admin/bin/ffmpeg.

// Path to ffmpeg on your server
// define('FFMPEG_PATH', 'ffmpeg');
define('FFMPEG_PATH', '/home/admin/bin/ffmpeg');

Save the file.

12) Clear the Koken System Cache: Settings -> System -> Clear system chaches. Now reload the System page. The new version should show up in the list:

FFmpeg           Installed (Version 2.4.3)

13) Koken is now using the ffmpeg 2.4.3 to create video thumbnails. Any new video you upload to an album in the Koken library should show up as a thumbnail, including the length of the video.



14) This completes the step-by-step guide.

15) Background material:
http://ffmpeg.gusari.org/viewtopic.php?f=11&t=1786
http://johnvansickle.com/ffmpeg/
https://www.readynas.com/forum/viewtopic.php?f=7&t=78411
http://help.koken.me/customer/portal/questions/888282-koken-not-detect-ffmpeg
http://help.koken.me/customer/portal/questions/8568711-what-s-wrong-with-my-video-
http://help.koken.me/customer/portal/questions/4444593-ffmpeg-recognized-by-koken-but-thumbnails-not-created-when-uploading-videos

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More