The following briefly describes how to use the MainConcept Dolby Digital Plus Pro Encoder plug-in for FFmpeg.
The command-line format should follow the structure below, depending on which operating system you are using.
On Windows
ffmpeg <ffmpeg-params> \
-c:a omx_enc_ddpp
-omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio \
-omx_param "<mc-general-params>" \
[DDPP Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>
The following is a sample command line:
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "[DDPP Settings]: encoder_mode=1:coding_mode=2" -b:a 768k output.eac3 -y
The following is a command line using a configuration file:
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "cfg_file_path=enc_ddpp_config.ini" -b:a 768k output.ac3 -y
On Linux
- Note
- The command line examples below are Windows specific. To run examples on Linux, you must slightly modify them. Instead of
-omx_core omxil_core.dll
, you need to specify -omx_core libomxil_core.so
on Linux.
ffmpeg <ffmpeg-params> \
-c:a omx_enc_ddpp
-omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_ddpp.audio \
-omx_param "<mc-general-params>" \
[DDPP Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>
The following is a sample command line:
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.so -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "[DDPP Settings]:encoder_mode=1:coding_mode=2" -b:a 768k output.eac3 -y
The following is a command line using a configuration file:
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "cfg_file_path=enc_ddpp_config.ini" -b:a 768k output.ac3 -y
All settings below are optional parameters for omx_param parameters (mc-general-params)
Function | Description |
cfg_file_path | Specifies the path to the Dolby Digital Plus Pro Encoder configuration file containing all parameters for encoding. -omx_param "cfg_file_path=./ddpp_config.ini" Note that currently using a configuration file is the only way to configure the encoder settings. Its arguments match the MainConcept Dolby Digital Plus Pro Encoder settings (see [DDPP Settings] for more information or a DDPP encoder configuration file as an example). |
[DDPP Settings] | Specifies parameters from the Dolby Digital Plus Pro encoder configuration on the command line, which can be applied under [DDPP Settings]. Use : as a separator and = as a value set for the key. They must have the same structure and order as they would appear in an *.ini file, e.g. -omx_param "[DDPP Settings]:encoder_mode=1:coding_mode=2: ... : ..." These arguments match the MainConcept Dolby Digital Plus Pro encoder settings (see [DDPP Settings] for more information or a DDPP encoder configuration file as an example). |
On Windows, you have two additional acceleration modes dxva1
(deprecated) and dxva2
that use DirectX Video Acceleration.
Command line examples
- Note
- The command line examples below are Windows specific. To run examples on Linux, you must slightly modify them. Instead of
-omx_core omxil_core.dll
, you need to specify -omx_core libomxil_core.so
on Linux.
- Note
- The default file extension for the Dolby Digital Plus output file is *.eac3. If you want to use the valid *.ec3 file extension, you need to use the
-f
eac3 parameter. Refer to the samples for more details:
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "cfg_file_path=enc_ddpp_config.ini" -b:a 768k output.ac3 -y
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "cfg_file_path=enc_ddpp_config.ini" -b:a 768k output.eac3 -y
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "[DDPP Settings]:encoder_mode=0:coding_mode=2" -b:a 768k output.ac3
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "cfg_file_path=enc_ddpp_config.ini" -b:a 768k -f eac3 output.ec3 -y
ffmpeg -i input_stereo.wav -c:a omx_enc_ddpp -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_ddpp.audio -omx_param "[DDPP Settings]:encoder_mode=1:coding_mode=2" -b:a 32k -f eac3 output.ec3
Parameters
The MainConcept Dolby Digital Plus Pro Encoder plug-in for FFmpeg comes with sample configuration (*.ini) files that cover the following encoder settings and parameters. You can modify them manually in a standard text editor and pass them to FFmpeg via -omx_param "cfg_file_path=<...>"
.
- Note
- The value
-2
in the sample configuration file means Auto
, i.e. the parameter is adjusted automatically to match the permitted value.
Parameter priority order
There is a specific priority order when passing the parameters to FFmpeg on the command line. You should be aware of this, because it can have a crucial impact on the expected encoder output:
omx_param:
This has the highest priority and overrides everything that was previously set with a cfg_file
or via FFmpeg options.
cfg_file:
This only overrides FFmpeg options. However, setting a configuration file is currently the only option to configure any parameters for the plug-in.
- FFmpeg options: These have the lowest priority.
[DDPP Settings]
This section contains information on the following:
Common AC-3 and E-AC-3 settings
encoder_mode
- Sets the appropriate encoder mode.
- 0: Dolby Digital Plus (E-AC-3)
- 1: Dolby Digital (AC-3)
- 3: Blu-ray compliant Dolby Digital (primary)
- 4: Blu-ray compliant Dolby Digital (secondary)
coding_mode
- Sets the appropriate coding mode.
- 1: 1/0 (C)
- 2: 2/0 (L, R)
- 3: 3/0 (L, C, R)
- 4: 2/1 (L, R, I)
- 5: 3/1 (L, C, R, I)
- 6: 2/2 (L, R, l, r)
- 7: 3/2 (L, C, R, l, r) (default)
- 21: 3/4 (L, C, R, l, r, Lb, Rb)
- 24: 3/3 (L, C, R, l, r, Cs)
in_coding_mode
- Specifies the input audio coding mode. If this is not specified,
coding_mode
will be used. It should be equal to or less than the coding mode. If it is not equal to coding mode, it should be one of the following values:
- -2: Auto mode
- 7: 3/2 (L, C, R, l, r) (default)
- 21: 3/4 (L, C, R, l, r, Lb, Rb)
- 24: 3/3 (L, C, R, l, r, Cs)
data_rate
- Specifies the desired bitrate in kbps. This field contains the desired bitrate in kbps. For Dolby Digital Plus (E-AC-3) encoding, this field must be 32 kbps - 1024 kbps:
Audio coding mode | Min data rate (kbps) | Max data rate (kbps) | Default data rate (kbps) |
1/0 | 32 | 1024 | 64 |
2/0 | 96 | 1024 | 128 |
3/0 and 2/1 | 128 | 1024 | 160 |
2/2 and 3/1 | 160 | 1024 | 192 |
3/2 |
- 192, full 5.1
- 160, hybrid downmix 3/2
- 128, hybrid downmix 3/0
- 96, hybrid downmix 2/0
- 64, hybrid downmix 1/0
| 1024 | 192 |
3/3 | 384 | 1024 | 384 |
3/4 | 384 | 1024 | 384 |
- Note
- The following are Dolby Digital Plus individual data rates: 32, 40, 48, 56, 64, 72, 80, 88, 96, 104,112, 120, 128, 144, 160, 176, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1008, 1024.
-
400 and 512 kbps are not supported for 3/3 and 3/4 audio coding modes.
- For Dolby Digital (AC-3) encoding, this field must contain one of the following:
Audio coding mode | Min data rate (kbps) | Max data rate (kbps) | Default data rate (kbps) |
1/0 | 56 | 640 | 128 |
2/0 | 96 | 640 | 192 |
3/0 and 2/1 | 224 | 640 | 256 |
2/2 and 3/1 | 224 | 640 | 320 |
3/2 | 224 | 640 | 384 |
- Note
- The following are Dolby Digital individual data rates: 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640.
- For Dolby Digital Blu-ray Primary encoding, the data rate must contain one of the following:
Audio coding mode | Min data rate (kbps) | Max data rate (kbps) | Default data rate (kbps) |
1/0 | 64 | 640 | 96 |
2/0 | 96 | 640 | 192 |
3/0 and 2/1 | 128 | 640 | 384 |
2/2 and 3/1 | 192 | 640 | 384 |
3/2 | 224 | 640 | 384 |
3/3 | 640 | 1664 | 640 |
3/4 | 768 | 1664 | 768 |
- Note
- The following are Dolby Digital Blu-ray Primary individual data rates: 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1008, 1024, 1152, 1280, 1512, 1536, 1664.
-
400 kbps is not supported for 3/2 audio coding modes.
- For Dolby Digital Blu-ray Secondary encoding, this field must contain one of the following:
Audio coding mode | Min data rate (kbps) | Max data rate (kbps) | Default data rate (kbps) |
1/0 | 56 | 256 | 64 |
2/0 | 96 | 256 | 128 |
3/0 and 2/1 | 224 | 256 | 224 |
2/2 and 3/1 | 224 | 256 | 224 |
3/2 | 224 | 256 | 224 |
- Note
- The following are Dolby Digital Blu-ray Secondary individual data rates: 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 144, 160, 176, 192, 200, 208, 216, 224, 232, 240, 248, 256.
lfe_enabled
- Enables the low frequency effects channel flag. It must be 0 for modes 1/0 and 2/0:
- 0: Disabled
- 1: Enabled (default)
lfe_filter_flag
- Enables the LFE filter flag. It will only be used if the parameter lfe_enabled = 1:
- 0: Disabled
- 1: Enabled (default)
num_input_channels
- Specifies the number of input channels. It should be one of the following values: 1 .. 8 (default 6). The value can be more or less than the desired number of output channels.
use_channel_table
- Specifies channel routing mode.
Value | Meaning |
0 | Use default routing (default) |
1 | Use the custom channel routing table below |
2 | Use channel routing preset 1 |
3 | Use channel routing preset 2 |
4 | Use channel routing preset 3 |
5 | Use channel routing preset 4 |
6 | Use channel routing preset 5 |
7 | Use channel routing preset 6 |
8 | Use channel routing preset 7 |
9 | Use channel routing preset 8 |
- There are eight channel routing presets and a custom routing mode. The presets are:
Preset | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
mode 1 | L | R | Ls | Rs | C | LFE | - | - |
mode 2 | L | C | R | Ls | Rs | LFE | - | - |
mode 3 | L | Ls | C | Rs | R | LFE | - | - |
mode 4 | L | R | C | LFE | Ls | Rs | - | - |
mode 5 | L | C | Rs | R | Ls | LFE | - | - |
mode 6 | C | L | R | Ls | Rs | LFE | - | - |
mode 7 | C | L | R | Ls | Rs | Cs | LFE | - |
mode 8 | C | L | R | Ls | Rs | Lb | Rb | LFE |
custom_channel_table
- Specifies custom channel routing mode. Custom routing mode can be used to route arbitrary input channels (1 .. 8) to arbitrary output channels (L, C, R, Ls, Rs, LFE, X1, X2). The
channel_table
slots are defined as follows:
Value | Meaning |
channel_table [0] | Left |
channel_table [1] | Center |
channel_table [2] | Right |
channel_table [3] | Left surround |
channel_table [4] | Right surround |
channel_table [5] | Subwoofer/LFE |
channel_table [6] | Left rear surround |
channel_table [7] | Right rear surround |
le_output
- Sets the little endian output flag:
- 0: Output stream is big endian (default)
- 1: Output stream is little endian
dialnorm
- Specifies the dialnorm normalization value.
Value | Meaning |
1 | -1dB (loudest input) |
2 | -2dB |
... | ... |
31 | -31dB (quiet input) |
line_mode_profile
- Sets the line mode
dynrng
profile:
- 0: No compression
- 1: Film standard compression (default)
- 2: Film light compression
- 3: Music standard compression
- 4: Music light compression
- 5: Speed compression
rf_mode_profile
- Sets the RF mode
compr
profile:
- 0: No compression
- 1: Film standard compression (default)
- 2: Film light compression
- 3: Music standard compression
- 4: Music light compression
- 5: Speed compression
rf_mode_profile2
- Sets the RF mode
compr2
profile:
- 0: No compression
- 1: Film standard compression (default)
- 2: Film light compression
- 3: Music standard compression
- 4: Music light compression
- 5: Speed compression
line_mode_profile2
- Sets the line mode
dynrng2
profile:
- 0: No compression
- 1: Film standard compression (default)
- 2: Film light compression
- 3: Music standard compression
- 4: Music light compression
- 5: Speed compression
surround_phase_shift_flag
- Enables 90 degrees phase shift surrounds:
- 0: Phase shift disabled
- 1: Phase shift enabled (default)
surround_attenuation_flag
- Enables 3 dB surround attenuation. It is only used for modes with surround channels.
- 0: Attenuation disabled (default)
- 1: Attenuation enabled
stereo_downmix_mode
- Sets the preferred stereo downmix mode. It is only used for modes other than 1/0 and 2/0:
- 0: Not indicated (default)
- 1: Lt/Rt downmix preferred
- 2: Lo/Ro downmix preferred
- 3: Pro Logic II
Lt_Rt_center_mix_level
- Specifies the Lt/Rt center mix level:
- 0: 1.414 (+3.0 dB)
- 1: 1.189 (+1.5 dB)
- 2: 1.000 (0.0 dB)
- 3: 0.841 (-1.5 dB)
- 4: 0.707 (-3.0 dB) (default)
- 5: 0.595 (-4.5 dB)
- 6: 0.500 (-6.0 dB)
- 7: 0.000 (-inf dB)
Lt_Rt_surround_mix_level
- Specifies the Lt/Rt surround mix level:
- 3: 0.841 (-1.5 dB)
- 4: 0.707 (-3.0 dB) (default)
- 5: 0.595 (-4.5 dB)
- 6: 0.500 (-6.0 dB)
- 7: 0.000 (-inf dB)
Lo_Ro_center_mix_level
- Specifies the Lo/Ro center mix level:
- 0: 1.414 (+3.0 dB)
- 1: 1.189 (+1.5 dB)
- 2: 1.000 (0.0 dB)
- 3: 0.841 (-1.5 dB)
- 4: 0.707 (-3.0 dB) (default)
- 5: 0.595 (-4.5 dB)
- 6: 0.500 (-6.0 dB)
- 7: 0.000 (-inf dB)
Lo_Ro_surround_mix_level
- Specifies the Lo/Ro surround mix level:
- 3: 0.841 (-1.5 dB)
- 4: 0.707 (-3.0 dB) (default)
- 5: 0.595 (-4.5 dB)
- 6: 0.500 (-6.0 dB)
- 7: 0.000 (-inf dB)
surround_ex_mode
- Sets the Dolby surround EX mode. It is only used for modes 2/2 or 3/2:
- 0: Not indicated
- 1: Dolby surround EX disabled (default)
- 2: Dolby surround EX enabled
headphone_mode
- Sets the Dolby headphone mode:
- 0: Not indicated (default)
- 1: Dolby headphone disabled
- 2: Dolby headphone enabled
ad_converter_type
- Specifies the A/D converter type:
- 0: Standard (default)
- 1: HDCD
copyright_flag
- Sets the copyright flag:
- 0: Non copyrighted material 1: Copyrighted material (default)
original_flag
- Sets the original bitstream flag:
- 0: Copied
- 1: Not copied (default)
bitstream_mode
- Specifies the bitstream mode:
- 0: Main audio service: Complete Main (CM) (default)
- 1: Main audio service: Music and Effects (ME)
- 2: Associated audio service: Visually Impaired (VI)
- 3: Associated audio service: Hearing Impaired (HI)
- 4: Associated audio service: Dialogue (D)
- 5: Associated audio service: Commentary (C)
- 6: Associated audio service: Emergency (E)
- 7: Associated audio service: Voice Over (VO)
audio_mixing_level
- Specifies audio production mixing level. The default value is 105 dB:
Value | Meaning |
0 | 8 dB SPL |
1 | 81 dB SPL |
... | ... |
30 | 110 dB SPL |
31 | 111 dB SPL |
audio_room_type
- Sets the audio production room type:
- 0: Not indicated
- 1: Large room, X curve monitor
- 2: Small room, flat monitor (default)
surround_mode
- Specifies the Dolby surround mode. It is used only in mode 2/0:
- 0: Not indicated (default)
- 1: Dolby Surround disabled
- 2: Dolby Surround enabled
Dolby Digital Plus settings
auto_settings_profile
- Auto setup profile for Dolby Digital Plus. It cannot be used in transcoding mode:
- -1: Not supported in all modes
- 0: Wideband profile (default)
- 1 Speech/Commentary profile
substream_id
- Specifies the substream ID. The value ranige is 0 .. 7:
program_attenuation
- Sets the program attenuation:
Value | Meaning |
0 | mute |
1 | -50dB |
2 | -49dB |
... | ... |
50 | -1 dB |
51 | 0 dB (default) |
52 | +1 dB |
... | ... |
61 | +10 dB |
62 | +11 dB |
63 | +12 dB |
ext_program_attenuation
- Sets the external program attenuation:
Value | Meaning |
0 | mute |
1 | -50dB |
2 | -49dB |
... | ... |
50 | -1 dB |
51 | 0 dB (default) |
52 | +1 dB |
... | ... |
61 | +10 dB |
62 | +11 dB |
63 | +12 dB |
pts_offset
- Defines the starting PTS of the stream:
pts_units
- Specifies the units of the pts_offset field. A value of 10000000 = 10MHz, 27000000 = 27Mhz, etc. A value <= 0 will be treated as 27MHz.
global_drc_profile
- Specifies the Global DRC profile. It can be overridden by other DRC profiles:
- 0: No compression
- 1: Film standard compression (default)
- 2: Film light compression
- 3: Music standard compression
- 4: Music light compression
- 5: Speech compression
center_mix_level
- Sets the center downmix level:
- 0: 0.707 (-3.0 dB)
- 1: 0.595 (-4.5 dB)
- 2: 0.500 (-6.0 dB)
surround_mix_level
- Sets the surround downmix level:
- 0: 0.707 (-3.0 dB)
- 1: 0.500 (-6.0 dB)
- 2: 0.000 (-infinity)
evolution_flag
- Disables the Evolution Framework flag. The option is enabled by default:
- 0: Disable Evolution Framework
- 1: Enable Evolution Framework (default)
Real-time loudness levelling settings
rtll_mode
- Enables real-time loudness leveler (rtll) mode:
- 0: Disable rtll mode
- 1: Enable rtll mode
rtll_loud_control
- Sets loudness control amount. It controls "aggressiveness" of RTLL. Each integer step is a 1 unit increment: 0 = least aggressive, 9 = most aggressive.
rtll_in_ref_level
- Defines the input reference level source.
rtll_manual_in_ref_level
- Defines the RTLL Manual IRL in LKFS (Loudness, K-weighted, relative to full scale); valid when IRL source = manual. Each integer step is a 1 LKFS decrement: 11=-11 LKFS, 31=-31 LKFS.
rtll_limiting_mode
- Enables limiting mode for RTLL:
- 0: Disable limiting mode
- 1: Enable limiting mode
rtll_dial_intel
- Enables Dolby Dialogue Intelligence (speech gating):
- 0: Disable dialogue intelligence
- 1: Enable dialogue intelligence
rtll_peak_limit
- Sets peak limit for leveler: 1=-0.1 dBTP, 80=-8.0 dBTP (step=0.1).