Videos Component Question

Bob Weston Posted in Technical Support 4 years ago

I have been hunting around trying to find some information regarding the videos component in relation to thumbnails but cannot find anything. When I upload videos to my site there is never a thumbnail. I am wondering if there is something I need to set to make this happen. I noticed there is a file called VideoThumb.php in the classes folder of the component which looks like it controls the creation of the thumbnail. I changed it from 5 seconds to 25 seconds to see if maybe 5 seconds was too early... but I never see a thumbnail.. can anyone help with this?

Replies
German Michael Zülsdorff Replied 4 years ago

Congratulations!
I'm happy we didn't need to continue the low-level way :)

German Bob Weston Replied 4 years ago

So it fixed even the thumbnail issue..

Here is the fix for anyone else who is running CentOs with cPanel.
In your WHM, in the search field search for MultiPHP and click on MultiPHP Manager.
This will take you to Home >> Software >> MultiPHP Manager:

enter image description here

In the above picture, turn the PHP-FPM Status to Off and from the sites listed below this that need to run FFMPEG, you need to also turn it off... THAT'S IT!

@ Arsalan, I would add this to the wiki and to the system requirements to save headache.. OMG I am so happy! :)

German Bob Weston Replied 4 years ago

I CAN'T BELIEVE IT.. I FIXED IT!!!!!!!!!!!

It was one damn default setting in cPanel!
EVERYTHING is working now!

German Michael Zülsdorff Replied 4 years ago

you wrote:

here the same command in ssh as user (ossntest)..

Well, it's not very likely that your apache's PHP module is executed by ossntest, thus a comparison like that may show what ossntest can't do - but not where apache fails. :)

So the next step is finding out which user is executing apache.
Log in to ssh as root and run

 ps -ef | grep [a]pache

Doing so on my system gives

root      1065     1  0 Sep18 ?        00:00:23 /usr/sbin/apache2 -k start
www-data 15933  1065  0 06:25 ?        00:00:43 /usr/sbin/apache2 -k start
www-data 15935  1065  0 06:25 ?        00:01:01 /usr/sbin/apache2 -k start

along with several more lines starting with www-data
This table shows from left to right

process_owner name | process_id | parent_process_id

So we see: the first apache running as root has been started by process 1 (linux init), and process 1065 has forked several child process which are running as www-data. And that's the user responsible for serving your Ossn, and that's the user you would have to run your comparison with.

German Bob Weston Replied 4 years ago

I had this enabled in the past, will try without this time:
'
https://docs.cpanel.net/ea4/apache/the-easyapache-4-fileprotect-option/

German Bob Weston Replied 4 years ago

this is the command works in root but not from ossntest:
/usr/bin/ffmpeg -i /home/ossntest/video.avi -vcodec libx264 -profile:v baseline -level 3 /home/ossntest/video.mp4 1> /home/ossntest/progress.txt 2>&1

German Bob Weston Replied 4 years ago

here the same command in ssh as user (ossntest)..

OUTPUT from ossntest creates a 0Byte file:

ffmpeg version 3.4.8 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x8664 --optflags='-O2 -g -pipe -Wall -Wp,-DFORTIFYSOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, avi, from '/home/ossntest/video.avi':
Metadata:
encoder : Lavf57.19.100
Duration: 00:00:30.61, start: 0.000000, bitrate: 194 kb/s
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 480x270 [SAR 1:1 DAR 16:9], 37 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc
Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 139 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x12539c0] using SAR=1/1
[libx264 @ 0x12539c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bitrate, rate, width or height
[aac @ 0x1245080] Qavg: 65536.000
[aac @ 0x1245080] 2 frames left in the queue on closing
Conversion failed!

German Michael Zülsdorff Replied 4 years ago

You wrote:

If I log into ssh as root, everything works through command line.

Ok, so with what other username do you log into ssh and the same command fails?
and what is ffmpegs output then? (any error messages?)

German Bob Weston Replied 4 years ago

Hi Z,

When I have cPanel installed FFMPEG works with mp4 only on the site, avi does not.
If I log into ssh as root, everything works through command line.
If I log in as user, I cannot convert avi.

When plesk is installed, everything converts in command line in ssh as user and as root but the website at first would not recognize the ffmpeg path until I disabled open_basedir.
Once it was recognized the website still would do nothing so it is some setting within plesk or php for that but I have 0 knowledge of plesk or patience for it because the website ran slower than a snail.

So knowing all that, I have decided I have to set something within the cPanel setup to allow the user to convert with ffmpeg, I just don't know what because exec is allowed.

I also noticed that there is a different 5.5 build out since two weeks, I have downloaded it and will upload it once I get the cpanel back on.

German Michael Zülsdorff Replied 4 years ago

Hi Bob,
honestly, my way of tracking down issues differs:
I would ask myself: Is ffmpeg part of Plesk? No it isn't. Or part of Cpanel? Not either. Thus I wouldn't spend a thought on all that in first place but focus on ffmpeg itself.
And that's why I was asking you:
With what user id/name are you logged in to ssh when running ffmpeg from the shell?