How to Add FFMPEG or LIBAV-Tools to Docker WordPress Image?

Issue:

I’m having problem playing my .mov video after uploaded to my WordPress site. So I installed “Video Embed & Thumbnail Generator” plugin to display and play my video files, but it required FFMPEG or LIBAV for encoding. How do I add FFMPEG or LIBAV to my docker image?

Environment:

Docker, WordPress with Debian image, Video Embed & Thumbnail Generator plugin

Resolution:

Finding what you have and how to install it into your docker container is crucial. Otherwise, it’s pretty straight forward for installing libav-tools to WordPress Debian container. Follow these steps to install video encoding to your docker container.

Step-by-step instructions:-

  1. Find the name of the container you want to install libav-tools to by executing docker ps -a

  2. Once you get the name, use following syntax if you are running the same WordPress image that I have shown above.
    docker exec wp_tfphotos apt-get install -y libav-tools
  3. After it installed, check the WordPress image and make sure you can find FFMPEG under /usr/bin folder
    docker exec wp_tfphotos ls -li /usr/bin | grep ffmpeg
  4. Now you can go back to WordPress Admin screen under setting to continue setup your “Video Embed & Thumbnail Generator”.


    Enter “/usr/bin” next to path and select “LIBAV” as an application

  5. Scroll down to the bottom of the screen and you should see FFMPEG test data.

  6. By now, you are ready to upload your first video file and encode with plugin software that required FFMPEG or LIBAV. Upload Issue?


    Click on “Encode selected” button to encode your video.

  7. If encoding is successful, the mp4 file should be listed on your media page. From here you can either embed or create a playlist to display on the post/page. Have fun!
    {playlist type="video" ids="634,635"}

    Note: replace above “{” bracket with “[” for WordPress playlist embed code

 

Troubleshoot:

  • To verify if encoding is installed:
    docker exec [container-name] ls -li /usr/bin
  • To get updated package for your container:
    docker exec [container-name] apt-get update

Reference:

libav-tools