Skip to main content
MediaBeacon University

Installing FFmpeg for use as MediaBeacon's Transcoding Engine

MB Build / Version: 8.4+

Issue

Quicktime cannot run as a service, a requirement for many Windows-based servers. Instead of using Quicktime as the transcoding solutions, MediaBeacon may use FFmpeg. 

Note: FFmpeg does not need to run as a service.

Expectations

The below instructions expect that MediaBeacon, Remote Preview and N3twork are running as services. If not using any of the external components (Preview, N3twork, WebHeads, Tomcat, Etc.) you may disregard any steps referencing these.

After completion of these steps, QuickTime may be uninstalled.

Installation Directions

  1. Install FFmpeg
    1. Browse to http://ffmpeg.org/download.html
      1. Click on "Windows Packages"
      2. Click on "Windows Builds"
        (redirects to http://ffmpeg.zeranoe.com/builds/)
      3. Version: Choose the latest release build (the non-dated selection)
      4. Architecture: 64 bit
      5. Linking: Static
      6. Click "Download Build"
        ffmpeg-download.png
    2. Install
      1. Decompress the ZIP file
      2. Place contents in C:\ffmpeg\
        1. (Not necessary, but for custom MediaBeacon installation path, may be preferable to install this on the same drive as MediaBeacon is installed Ex: D:\ffmpeg)
      3. Screen Shot 2017-12-08 at 11.08.07 AM.png
      4. Navigate to the ‘bin’ directory and run the ‘ffmpeg.exe’ to execute it for the first time.
      5. (you need 'ffprobe.exe' as a sidecar to that, which naturally happens with most ffmpeg.exe distributions.)
    3. Configure a helper batch file for both WebM and MP4
      1. Create a batch file in the ffmpeg directory and title the file ffmpeg_webm_helper.bat.
      2. Save the batch file with the text below, properly referencing the ffmpeg.exe install path

NOTE: The number of threads is arbitrarily set to 4, but can be adjusted to the resources available.

@echo off
"C:\ffmpeg\bin\ffmpeg.exe" -y -v -1 -i %1 -threads 4 %2
if exist %2 (
        if %~z2 GTR 0 (
                echo video_complete 1>&2
        )
)
  1. Create a batch file in the ffmpeg directory and title the file ffmpeg_mp4_helper.bat.
  2. Save the batch file with the text below, properly referencing the ffmpeg.exe install path
@echo off
"C:\ffmpeg\bin\ffmpeg.exe" -y -v -1 -i %1 -threads 4 %2
if exist %2 (
        if %~z2 GTR 0 (
                echo video_complete 1>&2
        )
)
  1. Configure Mediabeacon Core server
    1. Add the following system properties to the mediabeacon.properties file on the Core MB server.
mb.QTOutputHelper=true
mb.video.commandline.worker=true
  1. Perform a full shutdown of all MB Cores and Preview servers so the Movie Profiles can be configured.
    1. Stop the webserver, usually Tomcat
    2. Stop the MediaBeacon service 
  2. On the MB Core server gui, open the Control Panel and click on the Admin Tab, then click "Movie Profiles".
  3. Select the “HTML5” button on the Movie Profiles window.
    1. Enable the “Optional WebM support” checkbox and select Apply
  4. A Profile with the profile name “WebM Profile” should be created.
    1. Ensure the “Prepare” and “Use for HTML5 video” options are checked/enabled
    2. Double-click the Helper App to edit the helper app command line string
    3. The “Disable Quicktime Transcoding” should be checked
    4. The file suffix should be “.webm”
    5. The “Automatic Outfile” should be unchecked
    6. Set the command line string to following with reference to the created batch file install path:
C:\\ffmpeg\\ffmpeg_webm_helper.bat %INFILE% %OUTFILE%
  1. Select “Save”
  1. Create a WebM MP4 profile by selecting the “Add format” dropdown and choosing WebM

    It is required to create a profile for multiple browsers to handle both webm and mp4.

    1. Change the Profile column name to “WebM MP4”
    2. Ensure the “Prepare” and “Use for HTML5 video” options are checked/enabled
    3. Double-click the Helper App to edit the helper app command line string
    4. The “Disable Quicktime Transcoding” should be checked
    5. The file suffix should be “.mp4”
    6. The “Automatic Outfile” should be unchecked
    7. Set the command line string to following with reference to the created batch file install path:
C:\\ffmpeg\\ffmpeg_mp4_helper.bat %INFILE% %OUTFILE%
  1. Select “Save”
  1. When finished creating profiles:
    1. Maximum frame width and height of 512 is good
    2. Select Apply on the Movie profiles window
  2. Perform a startup of all MB Cores and Preview servers so the Movie Profiles can be configured.
    1. Start the MediaBeacon service
    2. Once the MediaBeacon service is up and running start the webserver

Advanced Installation

The following instructions are only for installation on a remote Preview server, with N3twork installed as a service.

  1. Install ffmpeg on the preview server, similar to instructions for core server
  2. Setup the Movie Profiles with the exact same profile names and settings from the core server
  3. Verify the /AppData/Local/N3twork/ directory exists, if not, create it
  4. Create a mediabeacon.properties file within the /N3twork/ directory and add the same sys props to it.
  5. Need to add the necessary sys props from mediabeacon.properties in the service installer mb_preview_inst.bat file. If running MB Preview as a Windows service you need to put in the Java options in the mb_preview_inst.bat (in addition to them being in the mediabeacon.properties file). This requires uninstalling and re-installing the service
    1. Ex: 
set PR_JVMOPTIONS=-Dmb.video.commandline.worker=true;-Dmb.QTOutputHelper=true;
  1. Perform a full shutdown and restart of all MB Cores and Preview servers after.
  2. Correctly shutdown/restart on service-enabled MediaBeacon.
  • Was this article helpful?