Could not execute FFMPEG inside chrooted nginx

Puntocom

Well-known member
Hello.

I have successfully upgraded to XenForo & XenForo Media Gallery RC2. All works fine except ffmpeg extras.

Nginx runs chrooted at /var/www. I have installed ffmpeg and I copied /usr/local/bin/ffmpeg to /var/www/bin/ffmpeg, but I get this error when I specify the ffmpeg path at Video Config:

Could not execute FFMPEG at the path specified: /bin/ffmpeg

ffmpeg has read and execute permissions for all users.

Please, can you help me to make it work inside the /var/www chroot? I don't get any Server Error so I don't know how can I debug it.
 
Last edited:
I'm sorry, this goes into Server Configuration and Hosting. I have to copy some libraries and archives to the chroot, surely it's not a XFMG problem.
 
Last edited:
Hello,

Please modify the ffmpeg path at Video Config to /var/www/bin/ffmpeg

And make sure that folder has 0755 permissions.

Kind regards,
George.
 
Hello, permissions are 0755. I have tried both /bin/ffmpeg (as should be seen inside the chroot) and /var/www/bin/ffmpeg with no success. Surely it needs some libraries inside the chroot to work.

I'm not sure if XFMG should send some Server Error to get more info to be able to debug this. I don't see any reference in access/error logs.
 
I'm not sure if XFMG should send some Server Error to get more info to be able to debug this. I don't see any reference in access/error logs.

That may be worthwhile, but let's see what this shows us first... there's a little hack you could do to get it to show you the output of the command that has been run.

In the file library/XenGallery/Helper/Video.php look for:
PHP:
$this->_ffmpegPathError = new XenForo_Phrase(
    'xengallery_ffmpeg_path_execute_error_x',
    array('ffmpegPath' => $ffmpegPath)
);

Directly below that add the following:
PHP:
throw new XenForo_Exception($output, true);

That might come back with something more useful.

EDIT: Hopefully Mike's post will lead toward an actual solution, though :)
 
Thanks! I'll try tomorrow in a test server and I'll report how it goes. Now it's too late here and I'm tired.
 
It worked, I had to run also:

Code:
# mkdir -p /var/www/sbin
# cp /sbin/ldconfig /var/www/sbin
# chroot /var/www ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib/
and then I set ffmpeg's path to /bin/ffmpeg.

I get this so I'll have to custom compile ffmpeg and hope libvo-aacenc is ported:

~~XenForo Media Gallery requires the following encoders to be enabled in FFMPEG: libvo_aacenc~~


Anyway the problem of this thread is solved :) thank you all.
 
Last edited:
Sadly libvo-aacenc is not ported to OpenBSD :(

Is it really necessary to just generate thumbnails? I only need that feature. Any other way to generate the thumbnails, f.e. from command line?

I found this: Encode/AAC – FFmpeg

libvo_aacenc
VisualOn AAC encoding library. Requires ffmpeg configuration with --enable-libvo-aacenc. This has the advantage of not being non-free, and is included by some distributors, but is a rather poor encoder compared to libfdk_aac and even the native FFmpeg AAC encoder according to Quality Assessment of FFmpeg AAC and a mailing list post. This encoder supports up to 2 channels, is CBR only, and does not work with -q:a/-qscale:a.
 
Last edited:
Unfortunately using any other encoder is likely to require special options that are either experimental or non-standard, including --enable-nonfree which essentially changes the license to make the libraries and binaries compiled into it, non re-distributable. That would likely restrict people to having to compile it from source manually and the bulk of people won't do that, they'll retrieve it from a redistributable source such as a package repository.

Could you try reinstalling from one of the static builds available here:
FFmpeg Static Builds

It is true that the encoder is not required for thumbnails so we can change that, but I do want to double check the static build above should solve the problem you're having.
 
I'm running OpenBSD; although it has linux binary compatibility I'm not sure if this will help you confirm that this work due to . I also completely avoid 3rd party binaries, I only trust my OS signed binary packages. Anyway I can try to run it in a Linux laptop when I install it if that's useful for you.

That would be perfect... that's the only extra feature I need :)
 
Last edited:
I'd be interested to hear if it works specifically on OpenBSD. I know generally they work fine.

It's worth noting that although they are compiled by a 3rd party, they are compiled directly from the FFMPEG source and they are linked to officially from FFMPEG's website:

Download FFmpeg

If it's not something you can test on OpenBSD yourself then I can do that easily enough so no problem :)
 
That would be very nice. Thank you.

I would gladly test it installing a new VPS but my provider does not support hourly billing yet and I'd have to pay a full month. The extra machine I have runs Libreboot so I can't install OpenBSD there, and it's not possible to run Virtualbox in OpenBSD.
 
If you have any issue installing OpenBSD feel free to send me a PC. It's pretty straightforward but it can be a bit tricky.
 
Using Latest XenForo Media Gallery 1.1.0, I didn't install anything relates to ffmpeg.
I just download the static build, and point it on my admin option, done.
Video uploads, conversion, transcode, thumbnails works perfect.
 
Ah ok, thought you might have been running on OpenBSD too.

Confident the static builds will work flawlessly for most Linux boxes.
 
  • Like
Reactions: rdn
I have tried to execute it as a different user but I need to recompile kernel and OpenBSD support is only for GENERIC kernel.

I'm going to try this in my local machine since nginx is in chroot with privilege separation.
 
Last edited:
Back
Top Bottom