FFMPEG on CentOs 7.8, PHP7.3 permissions problem

Bob1965

Member
Aug 30, 2018
23
3
3
Germany
cPanel Access Level
Root Administrator
Hi,

I hope someone can help me.
I am not sure if this is a cPanel issue or a CentOs issue, it depends on which is responsible for the permission to run FFMPEG as a user.

When I run the following command as root:

Code:
/usr/bin/ffmpeg -i /home/user-cpanel-account/video.avi -vcodec libx264 -profile:v baseline -level 3 /home/user-cpanel-account/video.mp4 1> /home/user-cpanel-account/progress.txt 2>&1
the avi video converts effortlessly to mp4 with no issues.
If I try that same code within the jailed shell of the cpanel account, the conversion fails and a 0 Byte mp4 is created.
This leads me to believe that something is blocking the user to access /usr/bin or something but maybe not because the ffmpeg command can be issued.
I am getting very frustrated with this entire issue because I have been trying for over 3 weeks now to get it to work.
I won't bore anyone with further details unless I am told I can be helped here.
If I can't get help I will be forced to change to ubuntu 20.4 with plesk installed, because everything works there.

Hopefully someone knows what the issue is.
Thanks in advance!

Bob
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @Bob1965

I am sorry to see that you are having difficulty using ffmpeg. Keep in mind these are community forums and are not our first point of contact for support. If you have any pressing issues, you are always welcome to submit a support ticket using the link in my signature.

Based on the information you provided, I am not able to determine exactly what the issue is. Also, note that ffmpeg is not provided as a component of cPanel and we do not provide support for it. We would do our best to provide basic troubleshooting and guidance. With that said, I would suggest appending the following to your command:

-loglevel debug

That should provide any available debug output when running the command.

Please let us know if you have any questions.
 

Bob1965

Member
Aug 30, 2018
23
3
3
Germany
cPanel Access Level
Root Administrator
I already reinstalled CentOs 7.8 and plesk and the user can use FFMPEG and avi videos do convert through ssh as user.. so somehow with the cPanel installation (I'm not saying the software) there must be some cPanel security setting I have set wrong, that is why I came here. I thought maybe someone could give me a tip or had the same problem in the past which keeps a user from using something such as ffmpeg which resides outside the users account. I will reinstall CentOs and cPanel and try what you said with -loglevel debug... I am just not sure where I should place that within the command, at the end maybe?
 

Spirogg

Well-Known Member
Feb 21, 2018
142
33
28
chicago
cPanel Access Level
Root Administrator
Well.. good news, I resolved this issue on my own!
The issue was having PHP-FPM enabled in the MultiPHP Manager.
When I disabled it, everything worked.
ok now that you mentioned php-fpm the issue is in the php-fpm settings

Disable Functions
Enter PHP functions you intend to disable when PHP-FPM is running.Checking the box “Block domain from changing the setting” would allow the configuration to use “php_admin_value”. It uses “php_value” if unchecked.

this is the error not allow your user to use ffmpeg, you can still use php-fpm if you remove the settings in this area this post. I remove all of it so there were nothing there. then I was able to use ffmpeg without issue. please copy and save the configuration in the php-fpm settings first then try one at a time to remove and restart php-fpm after saving.
I think shell exec was the issue. that would need to be removed and then saved. restart php-fpm should work.

hope this helps if you want to try it. but as I said make sure you save the configuration or write it down. so you can add it back in your case if it doesn't work for you. but for sure this is the issue


Spiro