2.8.3 Thumbnail generation fails during conversion



We just did a fresh upgrade from 2.8.1 to 2.8.3. It went smoothly, but now a bug occurs during the thumbnail generation process.

No thumbnails are generated. Here is the thumbnail generation error from the file conversion details log, which is repeated 15 times since 3 thumbnails are created in 5 resolutions :

Command : /usr/bin/ffmpeg -ss -i /home/clipbucket/public_html/files/conversion_queue/15042899536a149.mp4 -an -r 1 -y -f image2 -vframes 1 /home/clipbucket/public_html/files/thumbs/2017/09/01/150428995

OutPut : ffmpeg version 2.6.8 Copyright © 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags=’-O2 -g -pipe -Wall -Wp,-D_F
ORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic’ --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-liba
ss --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal
–enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx2
65 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir
=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Invalid duration specification for ss: -i

Response : Oops ! Not Found… See log

We found out that there are two space characters between the -ss and the -i inside the command line :
/usr/bin/ffmpeg -ss -i /home/clipbucket/public_html/files/conversion_queue/15042899536a149.mp4 -an -r 1 -y -f image2 -vframes 1 /home/clipbucket/public_html/files/thumbs/2017/09/01/150428995

We looked inside /home/clipbucket/public_html/includes/classes/conversion/ffmpeg.class.php to check what is supposed to be between these 2 space characters :
Line 2065 = $command = $this->ffMpegPath." -ss {$time} -i $input_file -an -r 1 $dimension -y -f image2 -vframes 1 $file_path ";

It seems like the $time value cannot be found, so the thumbnail can’t be generated.

We added the following lines to ffmpeg.class.php:
Line 1066 = $durations_format = “00:00:05” ;
Line 2063 = $time = “00:00:05” ;

So $time now has a set value and always takes the thumbnails at 00:00:05 position. We have a quick hack, but I wonder why the thumbnails generation is not working since the 2.8.3 updates. What are my options here?

Thank you and have a nice day


set default time zone in php.ini like date.timezone =Asia/Karachi


I was excited when I found this thread as I have had the same problem for almost two years. Only one thumb is generated and it always comes from the very first frame of the video.
I tried both methods described above to remedy my issue. Each method was tried independently of each other.

The method suggested by grandpapabi88 did not help in creating the multiple thumbnails at upload time, but when I went to the admin area and clicked regenerate I noticed that all the thumbs were generated from exactly the time that I put into the code. I had used 00:01:01. So something is close there but not quite what I need to fix. This would be acceptable to me if it worked to create the thumb without needing the regenerate effort.

The method by Arman to add code to the php.ini file was interesting. It did not work at all and the process created runtime errors with my SourceGuardian which needed to be fixed first by adding a line of code for SourceGuardian. After testing I found that since I had put the php.ini file in the root directory of my video server, it had indeed modified the date for some operations. Uploading file time stamps were affected but the thumbs were still not created. And the timezone setting did not have any effect on normal database entries such as last viewed videos or last comments.

So, in the end I did not install either code. It is back as it was before with a need for the admin to manually regenerate the thumbs and then select which one I want to use. The times in the database are not correct to my timezone, but it is of no real consequence.

CB 2.8.2, PHP 5.4 running on Arvixe dedicated server.