Transcode and Encrypt Video With FFmpeg

Before get started, make sure that you have installed the FFmpeg software, after activating the WP Video Encoder plugin, navigate to Appearance > Customize > WP Video Encoder panel and configure your encoder.

Activating required plugins Install Plugins

Install FFmpeg

Installing FFmpeg is straightforward, especially on Ubuntu. Simply open the terminal and type:

sudo apt-get install ffmpeg

Alternatively, Install FFmpeg from source

  1. Download the latest FFmpeg version https://launchpad.net/ubuntu/+source/ffmpeg

  2. Extract the zipped file

  3. Navigate to the extracted folder in the terminal

  4. Run the following commands to configure, compile, and install FFmpeg:

$./configure --enable-libx264 --enable-gpl --enable-libwebp
$ make
$ sudo make install

Configure plugin

Navigate to Appearance > Customize > WP Video Encoder section and configure necessary options.

Encrypt Video


Step 1: Generate an encryption key from your terminal console

Step 2 (Optional): Generate an IV string

Step 3: Navigate to Appearance > Customize > WP Video Encoder panel.

  1. Check on HLS Encryption checkbox to enable the feature.

  2. HLS Encryption File Info Endpoint: This option allows you to change the default file info endpoint, leave it as default or change to a unique string, the string does not include special characters, space, or uppercase words.

  3. HLS Encryption File URL: put your encryption file URL which you have generated above. This encryption file is crucial for the HLS video encoding feature. It is necessary to keep the file accessible at all times during the lifetime of your website. If the URL for this file changes or the file is lost, the encrypted videos will not be decrypted and will be permanently inaccessible. It is recommended to upload the file to a secure and accessible location to ensure it remains available.

  4. HLS Encryption File: upload the encryption file.

  5. HLS Encrypt Initialisation Vector (optional): Put the IV string which you have generated.

  6. Save changes.

If you prefer to rely on a streaming service with low cost and high bandwidth, you may consider trying either Bunny Stream or Cloudflare Stream, as their APIs are already integrated

Bunny StreamCloudflare Stream

Last updated