It is not uncommon for institutions to be concerned about their student recordings being sent off for conversion to Poodll servers. In fact uploaded recordings are deleted from the servers within 24 hours and access to those files is tightly restricted. And recorded files are not hosted by Poodll. However its a topic that does  raise privacy concerns from time to time. In the situation where cloud conversions are not acceptable in your organisation, its possible to configure FFmpeg on your Moodle server to handle file conversion. N.B. FFMPEG works fine with Poodll, but we can not offer support for it.


To set up FFMPEG for Poodll you will need to:

i) install FFMPEG on your server
ii) test that it can convert files from the command line
iii) instruct Poodll to use it.


Install FFMPEG on your server

First check if FFMPEG is installed on your server. From the command line type:
ffmpeg -version

If version information is then displayed, then FFMPEG is installed. If not you will need to install it. If you are lucky a static compiled binary might work for you. In that case download the binary and place it in the [MOODLE]/filter/poodll directory. Download links can be found here:
http://www.ffmpeg.org/download.html
After doing that, on Linux and Mac machines be sure to set the FFMPEG file executable:
chmod 755 ffmpeg

Then test it actually works on your machine
ffmpeg -version

On some OSs you can use a package manager to install FFmpeg. On CENTOS try:
yum install ffmpeg

On Ubuntu try:
sudo apt-get install ffmpeg libavcodec-extra-53

One method of installing FFMPEG on an Ubuntu server is using the build script available here:
https://github.com/stvs/ffmpeg-static
This will download all the bits and pieces you need to static compile an FFmpeg executable.


Testing your FFMPEG from command line

Depending on how FFMPEG is built it may or may not have the ability to encode MP3 or MP4. If you use another media file and try to convert it to MP3 or MP4, you will be able to see if it has that ability.
ffmpeg -i myfile.webm myfile.mp3

For video, try this:
ffmpeg -i myfile.webm -strict -2 myfile.mp4

Or this, which is long but produces mp4 files playable on most devices:
ffmpeg -i myfile.webm  -c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -crf 28 -f -strict -2 mp4 myfile.mp4

If you wish, you can use this webm file for testing. Right click to download.
zombie_problems.webm

 

Configuring Moodle for FFMPEG

First turn off cloud recording in the Poodll filter general settings.

Then in the Audio/Video File conversion settings, also on the Poodll filter general settings page, check

  • Auto conv. to MP4
  • Auto conv. to MP3
  • Convert uploaded media with FFMPEG

You might need to tweak the actual command line call that Poodll makes. This will depend on your FFMPEGand the results of your command line testing earlier. To do that enter your custom flags in the conversion options section of the Poodll filter general settings page. Note that your options will be inserted in between the input and output filenames.
ie ffmpeg -i something.flv  [your conv. options go here]  something.mp4

For video we recommend this set of conversion options:
-c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -crf 28 -f -strict -2 mp4

Finally you will want to run the conversions in the background from Moodle’s cron. Make sure your Moodle cron job is set up. And check the two “Perform conversion in the background” options.

TIPS:

  • It can take a fair amount of time to get FFMPEG running with Poodll properly. Make sure the permissions are correct and the FFMPEG executable is either
    i) in the root of the /filter/poodll folder
    (it needs to be the executable file, a folder called ‘ffmpeg’ with ffmpeg in it is not the same thing.)
    OR
    ii) on the system path. ie you can type “ffmpeg -v” on the command line from anywhere and it will work.
  • Setup debug logging in Poodll and the logs will report if the conversion task failed. This will indicate that Poodll could not successfully call FFmpeg. And the placeholder video will not be replaced. Its likely that ffmpeg is in the wrong place or has incorrect permissions.
  • If you get an unplayable file back from the conversion, then its likely that the options you set for MP3 or MP4 conversion are the problem.
  • If it does not try to convert at all, and you get WEBM and OGG and similar files instead of MP3 and MP4, then confirm that you turned on background conversions.
  • If conversions never even seem to start then check that your cron job is running, or try to run it from the Moodle web interface (admin/cron.php)
  • Longer(bigger) recordings can be rejected by your web server. This will appear as files that don’t finish uploading . When testing recordings that upload directly to your Moodle server, use small 5 second recordings. Later you will need to make sure that your server can accept big file uploads. Thats a whole other hassle, that sometimes involves apache mod_security or  the Suhosin extension. But it might be enough to just increase your post_max_size in php.ini.