![]() |
MainConcept AVC/H.264 Broadcast Encoder Plug-in for FFmpeg 3.1.0
|
This section describes how to use the MainConcept AVC Broadcast Encoder plug-in for FFmpeg.
The command line format should follow the structure below, depending on which operating system you are using.
ffmpeg <ffmpeg-params> \ -c:v omx_enc_avc \ -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video \ -omx_param "<mc-general-params>" \ [AVC Settings] "<mc-codec-params>" \ -f omx_mxf_mux \ -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other \ -omx_format_param "<mc-mux-params>" \ <ffmpeg-output-parameters>\
Below are two basic command-line examples:
ffmpeg -r 25 -pix_fmt yuv420p -s 1920x1080 -i 1920x1080p_25p_YV12.yuv -b:v 3500k -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param " force_omx_param=1:preset=H264_HIGH_10:perf_level=10:acc_type=sw:[AVC Settings]:time_scale=20000000:num_units_in_tick=1000000" 1920x1080p_25p_YV12_ffmpeg.h264 -y
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 omx_enc_avc -omx_core omxil_core.dll -omx_name:v OMX.MainConcept.enc_avc.video -map 0:a:0 -c:a:0 pcm_s24le -r:a 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other output.mxf -y
The following is a command line using a configuration file:
ffmpeg -r 25 -pix_fmt yuv420p -s 1920x1080 -i 1920x1080p_25p_YV12.yuv -b:v 3500k -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "force_omx_param=0:cfg_file_path=avc_config.ini" 1920x1080p_25p_YV12_ffmpeg.h264 -y
/opt/mainconcept/ffmpeg-omx/bin/
. Ensure this folder is in your search path for the following examples.ffmpeg <ffmpeg-params> \ -c:v omx_enc_avc \ -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_avc.video \ -omx_param "<mc-general-params>" \ [AVC Settings] "<mc-codec-params>" \ -f omx_mxf_mux \ -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mxf.other \ -omx_format_param "<mc-mux-params>" \ <ffmpeg-output-parameters> \
Below are two basic command-line examples:
ffmpeg -r 25 -pix_fmt yuv420p -s 1920x1080 -i 1920x1080p_25p_YV12.yuv -b:v 15000k -c:v omx_enc_avc -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_avc.video -omx_param " force_omx_param=1:preset=H264_LONG_GOP_420_CLASS_G12:perf_level=10:acc_type=sw:[AVC Settings]:time_scale=20000000:num_units_in_tick=1000000" 1920x1080p_25p_YV12_ffmpeg.h264 -y
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 omx_enc_avc -omx_core libomxil_core.so -omx_name:v OMX.MainConcept.enc_avc.video -map 0:a:0 -c:a:0 pcm_s24le -r:a 48000 -f omx_mxf_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mxf.other output.mxf -y
Here is a command-line example using a configuration file:
ffmpeg -r 25 -pix_fmt yuv420p -s 1920x1080 -i 1920x1080p_25p_YV12.yuv -b:v 10000k -c:v omx_enc_avc -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_avc.video -omx_param "force_omx_param=0:cfg_file_path=avc_config.ini" 1920x1080p_25p_YV12_ffmpeg.h264 -y
The following FFmpeg options are mapped from the command-line to the MainConcept AVC/H.264 Broadcast Encoder:
FFmpeg option | Usage example |
---|---|
bit_rate | -b:v 1M -b:a 192k |
pix_fmt | -pix_fmt yuv420p |
gop_size | -g 4 |
max_b_frames | -bf 2 |
interlace_mode | -flags +ildct |
framerate | -r 30 |
width ; height | -s 720x480 |
All settings below are optional parameters for omx_param (mc-general-params):
Function | Description |
---|---|
force_omx_param | Specifies whether to prioritize the FFmpeg generic global options or the MainConcept codec specific settings:
|
perf_level | Specifies the predefined performance level 1 to 15 for encoding. Other predefined values permitted are:
|
acc_type | Specifies whether you want to use software ("sw"), Intel Quick Sync Video ("iqsv") or NVIDIA NVENC ("nvenc") encoding. IQSV and NVENC are GPU-encoding modes. |
preset | Specifies the built-in encoder presets. Available options are "H264_BASELINE", "H264_CIF", "H264_MAIN", "H264_D1", "H264_HIGH_10", "H264_HIGH_422", "H264_DASH_L1"..."H264_DASH_L12", "H264_HLS_L1" ... "H264_HLS_9", "H264_LONG_GOP_422_CLASS_G50", "H264_XAVC_4K_INTRA_CLASS_480_CBG", "H264_P2_4K_INTRA_422", "H264_INTRA_CLASS_200_RP2027", etc.. For more details, see Command line examples |
cfg_file_path | Specifies path to AVC/H.264 encoder configuration file containing all parameters for encoding. -omx_param "cfg_file_path=avc_config.ini" |
pass | 2-pass encoding is an option to achieve better visual quality but with strict target bitrate and HRD compliance. It cannot be used in live encoding. In the first encoding pass, called analysis, intermediate statistics are saved for further use in the second pass where the actual encoding will take place. 2-pass encoding can take up to twice as long as single-pass encoding.
|
passlogfile | Specifies the filename and path where you store the log file that includes the data and statistics from the first analyzing pass. This parameter is optional. If not specified, the file is created using default naming conventions in the current working directory. The following are command-line examples: ffmpeg -r 30 -vsync 0 -pix_fmt yuv420p -s 1920x1080 -i converted_file_raw.yuv -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "pass=1:passlogfile=mc_mpass_avc" ffmpeg_2pass.h264 ffmpeg -r 30 -vsync 0 -pix_fmt yuv420p -s 1920x1080 -i converted_file_raw.yuv -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "pass=2:passlogfile=mc_mpass_avc" ffmpeg_2pass.h264 |
[AVC Settings] | Specifies parameters from the AVC/H.264 encoder configuration on the command line, which can be applied under "[AVC 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 "force_omx_param=1:preset=H264_MAIN:acc_type=sw:[AVC Settings]:bit_rate_mode=0:bit_rate=1000000: ... : ..."These arguments match the MainConcept AVC/H.264 Encoder settings (see [AVC Settings] as a reference later or an AVC Encoder configuration file as an example). |
Function | Description |
---|---|
mplex_type | Specifies the MXF stream type to multiplex:
|
profile | Specifies the MXF format type you want to multiplex:
|
dm_xml_filename | The Panasonic P2 AVC-Ultra compliant AVC-Intra or AVC-LongG formats require that a descriptive metadata is specified for encoding. You need to run the P2_LongG_dm_creation.py Python script on the source file to create the XML file (see Panasonic P2 AVC Ultra Pre-Encoding Notes for more details). Once this is done, use the dm_xml_filename parameter to specify location and filename of the XML file (file extension: * .xml). |
dm_thumbnail_filename | Panasonic P2 AVC-Ultra compliant AVC-Intra or AVC-LongG formats require that a thumbnail is specified for encoding. You need to run the P2_LongG_dm_creation.py Python script on the source file to create the thumbnail (see Panasonic P2 AVC Ultra Pre-Encoding Notes for more details). Once this is done, use the dm_thumbnail_filename parameter to specify location and filename of the thumbnail file (file extension: * .bmp). |
operational_pattern | Specifies the operational pattern that should be used for MXF wrapping:
|
Function | Description |
---|---|
split_channel | Depending on the Panasonic P2 AVC-Intra format, the encoded files need to be separate video and audio MXF files. In this case, the different audio channels are encoded as separate mono PCM files in an MXF container, e.g. a four channel input file will be encoded to a Panasonic P2 AVC-Intra with one MXF video file and four mono channel MXF audio files. Usage: -split_channel 1 (see Panasonic for more details). |
split_track | Some MXF specifications require one separate video and one separate audio MXF file with all tracks included. In this case, the different audio channels are encoded in a separate single PCM file in an MXF container, e.g. a four channel input file will be encoded to one MXF video file and one MXF audio file with four audio tracks. Usage: -split_track 1 (see Command line examples for more details) |
The MainConcept AVC Broadcast Encoder plug-in offers an option to force the current frame to become an IDR frame with FFmpeg. This option is essential for adaptive bitrate streaming formats like Apple HLS and MPEG-DASH for creating segments that only occur at key frames. This will provide smooth proper playback of the segments.
You can use FFmpeg's generic force_key_frames
parameter to specify when a new IDR frame should be set. However, you also need to define some MainConcept AVC/H.264 Video Encoder parameters via -omx_param
. So if -force_key_frames 'expr:gte(t,n_forced*N)'
is present (N is the number of seconds) then you should disable internal
idr_interval (set it to 0
), which means infinite GOP. If you want to get additional I-frames at scene cuts, the vcsd_mode
must be set to 1
.
There are currently two typical use cases to set force_key_frames
in FFmpeg:
...-force_key_frames 'expr:gte(t,n_forced*N) ... -omx_param "... :idr_interval=0:vcsd_mode= 0:..."
...-force_key_frames 'expr:gte(t,n_forced*N) ... -omx_param "... :idr_interval=0:vcsd_mode= 1:idr_frequency=0:..."
idr_frequency
parameter disables IDR at scene cuts, so they are simple I-frames. -omx_core omxil_core.dll
, you need to specify -omx_core libomxil_core.so
on Linux.fmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4k:acc_type=sw" output_h264_xavc_4k_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4k_422:acc_type=sw" output_h264_xavc_4k_422_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_MP4:acc_type=sw" output_h264_xavc_hd_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_MXF:acc_type=sw" output_h264_xavc_hd_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_INTRA_VBR:acc_type=sw" output_h264_xavc_hd_intra_vbr_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_INTRA_CLASS_50_CBG:acc_type=sw" output_h264_xavc_hd_intra_50_cbg_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_INTRA_CLASS_100_CBG:acc_type=sw" output_h264_xavc_hd_intra_100_cbg_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_HD_INTRA_CLASS_200_CBG:acc_type=sw" output_h264_xavc_hd_intra_200_cbg_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_2K_INTRA_CLASS_100_CBG:acc_type=sw" output_h264_xavc_4k_intra_100_cbg_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4K_INTRA_CLASS_300_CBG:acc_type=sw" output_h264_xavc_4k_intra_300_cbg_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=4096:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4K_INTRA_CLASS_480_CBG:acc_type=sw" output_h264_xavc_4k_intra_480_cbg_4096x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_2K_INTRA_CLASS_100_VBR:acc_type=sw" output_h264_xavc_4k_intra_100_vbr_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4K_INTRA_CLASS_300_VBR:acc_type=sw" output_h264_xavc_4k_intra_300_vbr_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=4096:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4K_INTRA_CLASS_480_VBR:acc_type=sw" output_h264_xavc_4k_intra_480_vbr_4096x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_QFHD_INTRA_CLASS_300_CBG:acc_type=sw" output_h264_xavc_qfhd_intra_300_cbg_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_QFHD_INTRA_CLASS_480_CBG:acc_type=sw" output_h264_xavc_qfhd_intra_480_cbg_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_QFHD_INTRA_CLASS_300_VBR:acc_type=sw" output_h264_xavc_qfhd_intra_300_vbr_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_QFHD_INTRA_CLASS_480_VBR:acc_type=sw" output_h264_xavc_qfhd_intra_480_vbr_3840x2160.264
ffmpeg -i source.h264 -c copy -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=XAVC_MEL:profile=MXF_PROF_SONY_XDCAM:operational_pattern=OP1A" output.mxf -y
ffmpeg -i source.h264 -c copy -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=XAVC_SXS:profile=MXF_PROF_SONY_XDCAM: operational_pattern=OP1A" 468908959_output2.mxf -y
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_XAVC_4K_INTRA_CLASS_300_VBR:acc_type=sw" -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=XAVC_SXS:profile=MXF_PROF_SONY_XDCAM: operational_pattern=OP1A" output_H264_XAVC_4K_INTRA_CLASS_300_VBR.mxf -y
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_50:acc_type=sw" output_h264intra_class_50_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_100:acc_type=sw" output_h264intra_class_100_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_200:acc_type=sw" output_h264intra_class_200_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_P2_HD_INTRA_422:acc_type=sw" output_h264intra_hd_422_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -vf scale=2048:1080 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_P2_2K_INTRA_422:acc_type=sw" output_h264intra_2k_422_2048x1080.264
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_P2_4K_INTRA_422:acc_type=sw" output_h264intra_4k_422_3840x2160.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_420_CLASS_G6:acc_type=sw" output_h264longgop_420_g6_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_420_CLASS_G12:acc_type=sw" output_h264longgop_420_g12_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_422_CLASS_G25:acc_type=sw" output_h264longgop_422_g25_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_422_CLASS_G50:acc_type=sw" output_h264longgop_422_g50_1920x1080.264
ffmpeg -i avcIntra100.h264 -c copy -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVCI:profile=MXF_PROF_PANASONIC_P2:operational_pattern=OPATOM" 1234AB.mxf -y
ffmpeg -I source.h264 -c copy -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVC_ULTRA:profile=MXF_PROF_PANASONIC_P2:operational_pattern=OP1B" AB12CD0EF.mxf -y
ffmpeg -i source.mp4 -c copy -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVC_ULTRA:profile=MXF_PROF_PANASONIC_P2:dm_xml_filename=003CC0CC.xml:dm_thumbnail_filename=003CC0CC.bmp:operational_pattern=OP1B" AA23AB0CD.mxf -y
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_200:acc_type=sw" -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVCI:profile=MXF_PROF_PANASONIC_P2:operational_pattern=OPATOM" -split_channel 1 123456.mxf -y
ffmpeg -i source.wmv -vf scale=1920:1080 -c:v omx_enc_avc -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_420_CLASS_G6:acc_type=sw" -c:a pcm_s24le -ar 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVC_ULTRA:profile=MXF_PROF_PANASONIC_P2:dm_xml_filename=source.XML:dm_thumbnail_filename=source.BMP:operational_pattern=OP1B" 001KB0OR.mxf -y
If your input has two or more audio streams and if it is required to split it by channel, you should map the video before the audio like in the example below:
ffmpeg -i source_1920x1080.m2ts -map 0:v -map 0:a -c:a pcm_s24le -c:v omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVCI:profile=MXF_PROF_PANASONIC_P2" -split_channels 1 1234AB.mxf -y
ffmpeg -i source_1920x1080.m2ts -vf scale=416:234 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L1:acc_type=sw" output_hls_l1_416x234_145kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=480:270 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L2:acc_type=sw" output_hls_l2_480x270_365kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=640:360 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L3:acc_type=iqsv" output_hls_l3_640x360_730kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=768:432 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L4:acc_type=sw" output_hls_l4_768x432_1100kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=960:540 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L5:acc_type=iqsv" output_hls_l5_960x540_2000kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=1280:720 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L6:acc_type=sw" output_hls_l6_1280x720_3000kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=1280:720 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L7:acc_type=iqsv" output_hls_l7_1280x720_4500kb.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L8:acc_type=iqsv" output_hls_l8_1920x1080_6000kb.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HLS_L9:acc_type=sw" output_hls_l9_1920x1080_7800kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=768:432 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L1:acc_type=sw" output_dash_l1_768x432_400kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=768:432 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L2:acc_type=sw" output_dash_l2_768x432_600kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=768:432 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L3:acc_type=iqsv" output_dash_l3_768x432_800kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=1280:720 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L4:acc_type=sw" output_dash_l4_1280x720_1200kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=1280:720 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L5:acc_type=iqsv" output_dash_l5_1280x720_1750kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=1280:720 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L6:acc_type=sw" output_dash_l6_1280x720_2400kb.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L7:acc_type=sw" output_dash_l7_1920x1080_3500kb.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L8:acc_type=iqsv" output_dash_l8_1920x1080_5300kb.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L9:acc_type=sw" output_dash_l9_1920x1080_8400kb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L10:acc_type=sw" output_dash_l10_3840x2160_15mb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L11:acc_type=sw" output_dash_l11_3840x2160_20mb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=3840:2160 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_DASH_L12:acc_type=iqsv" output_dash_l12_3840x2160_25mb.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=768:432 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_Baseline:acc_type=sw" output_h264baseline_768x432.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=416:234 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_CIF:acc_type=sw" output_h264baseline_416x432.mp4
ffmpeg -i source_1920x1080.m2ts -vf scale=720:576 -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_D1:acc_type=iqsv" output_h264d1_720x576.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_MAIN:acc_type=sw" output_h264main_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HIGH:acc_type=iqsv" output_h264high_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_OPTIMIZED_HIGH:acc_type=sw" output_h264high_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HIGH_10:acc_type=sw" output_h264high_10_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_HIGH_422:acc_type=sw" output_h264high_422_1920x1080.mp4
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_HIGH_10:acc_type=sw" output_h264intra_high_10_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_50_RP2027:acc_type=sw" output_h264intra_class_50_rp2027_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_100_RP2027:acc_type=sw" output_h264intra_class_100_rp2027_1920x1080.264
ffmpeg -i source_1920x1080.m2ts -c:v omx_enc_avc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_200_RP2027:acc_type=sw" output_h264intra_class_200_rp2027_1920x1080.264
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 copy -map 0:a:0 -c:a:0 pcm_s24le -r:a 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -opatom 0 -r 29.97 output.mxf -y
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 copy -map 0:a:0 -c:a:0 pcm_s24le -r:a 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -opatom 1 -r 29.97 output.mxf -y
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 omx_enc_avc -omx_core omxil_core.dll -omx_name:v OMX.MainConcept.enc_avc.video -map 0:a:0 -c:a:0 pcm_s24le -r:a 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other output.mxf -y
ffmpeg -i source.mp4 -map 0:v:0 -c:v:0 copy -map 0:a:0 -c:a:0 pcm_s24le -r:a:0 48000 -map 0:a:0 -c:a:1 pcm_s24le -r:a:1 48000 -map 0:a:0 -c:a:2 pcm_s24le -r:a:2 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -opatom 1 -r 29.97 output.mxf -y
ffmpeg -ac 2 -f s16le -acodec pcm_s16le -i source_ac2_s16le.pcm -i source.h264 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other output2.mxf -y
ffmpeg -i source.mp4 -vf scale=1920:1080 -c:v omx_enc_avc -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_INTRA_CLASS_100_RP2027:acc_type=sw" -c:a pcm_s24le -ar 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=DEFAULT:profile=MXF_PROF_DEFAULT" -split_track 1 output_h264intra_class_100_rp2027_1920x1080.mxf -y
The MainConcept AVC Broadcast Encoder plug-in for FFmpeg comes with a couple of sample config (*
.ini) files that cover the following encoder settings and parameters. You can modify them manually in a normal text editor and pass them to FFmpeg via
*
.ini file. The "....video.ini"
file can now be used in the FFmpeg plug-in.There is a specific priority order when passing parameters to FFmpeg on the command-line. It is important to be aware of this as 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 via cfg_file
or via FFmpeg optionscfg_file:
This only overrides FFmpeg optionsMethod | Setting |
---|---|
file.ini (setting framerate to 24 fps) | [AVC Settings] time_scale=27000000 num_units_in_tick=1125000 |
ffmpeg_cmdline (Windows) | ffmpeg -r 27 -pix_fmt yuv420p -s 1920x1080 -i file1920x1080.yuv \ -c:v omx_enc_avc -omx_core omxil_core.dll \ -omx_name OMX.MainConcept.enc_avc.video \ -omx_param "force_omx_param=1:cfg_file_path=file.ini:[AVC Settings]:time_scale=20000000:num_units_in_tick=1000000" ffmpeg_res_filename.h264 |
ffmpeg_cmdline (Linux) | ffmpeg -r 27 -pix_fmt yuv420p -s 1920x1080 -i file1920x1080.yuv \ -c:v omx_enc_avc -omx_core libomxil_core.so \ -omx_name OMX.MainConcept.enc_avc.video \ -omx_param "force_omx_param=1:cfg_file_path=file.ini:[AVC Settings]:time_scale=20000000:num_units_in_tick=1000000" ffmpeg_res_filename.h264 |
The resulting file will have 20 fps (as defined in omx_param
) instead of 24 fps, which was pre-defined in the cfg_file
and defined in the FFmpeg settings as 27 fps.
AVC settings are covered under the following:
profile_id
level_id
level_id
, there are several limits, e.g. maximal frame size in macroblocks or maximal bitrate. See Table A-1 of the AVC/H.264 Encoder standard (ISO/IEC 14496-10) for details.idr_frequency
force_key_frames
parameter, see Force key frame settings.idr_interval
force_key_frames
parameter, see Force key frame settings.reordering_delay
interlace_mode
def_horizontal_size
def_vertical_size
frame_rate
num_reference_frames
search_range
level_id
. See Table A-1 of the AVC/H.264 Encoder standard (ISO/IEC 14496-10).max_l0_active
max_l1_active
quant_pI
quant_pP
quant_pB
bit_rate_mode
bit_rate_buffer_size
bit_rate
(CBR), respectively max_bit_rate
(VBR), to avoid DTS/PTS underflows during multiplexing. Depending on vbv_buffer_units
, this value is taken as bits (vbv_buffer_units
= H264_HRD_UNIT_BIT
or H264_HRD_UNIT_BIT_90K
) or bytes (vbv_buffer_units
= H264_HRD_UNIT_BYTE_PERCENT
). Due to encoder limitations, the value is restricted to the maximum signed integer value for bits and (maximum signed integer value)/8 for bytes accordingly.bit_rate
max_bit_rate
bit_rate
to give rate controller a bit more space for work. Due to encoder limitations, the value is restricted to the maximum signed integer value.inter_search_shape
entropy_coding_mode
use_hadamard_transform
sar_width
pic_ar_x
and pic_ar_y
) to -1 and vice versa.sar_height
pic_ar_x
and pic_ar_y
) to -1 and vice versa.video_format
time_scale
num_units_in_tick
(frame_rate
= time_scale
/ num_units_in_tick
) to calculate exact frame rate of a stream. By default, time_scale
is set to 27000000 (27 MHz clock).num_units_in_tick
time_scale
Hz that corresponds to one clock tick. Use together with time_scale
(frame_rate
= time_scale
/ num_units_in_tick
) to calculate exact frame rate of a stream.vbv_buffer_fullness
vbv_buffer_fullness_trg
vbv_buffer_units
cpb_removal_delay
cpb_removal_delay
value should be equal to the distance to the previous IDR frame given in field units. This parameter may be used for segment re-encodings or seamless joining of several H.264 streams.bit_rate_scale
cpb_size_scale
max_frame_size
min_frame_size
hrd_maintain
hrd_low_delay
smooth_factor
hrd_preview
encoding_buffering
. Frames are delivered with an expected delay in this case.slice_arg
b_slice_reference
b_slice_pyramid
cb_offset
cr_offset
can save (or cut) some quality in chroma components, therefore chroma quality can either be increased (cb_offset
< 0) or decreased (cb_offset
> 0). Suitable values are between -2 and 2 or potentially slightly more.cr_offset
cb_offset
can save (or cut) some quality in chroma components, therefore chroma quality can either be increased (cr_offset < 0) or decreased (cr_offset > 0). Suitable values are between -2 and 2 or potentially slightly more.me_subpel_mode
me_weighted_p_mode
me_weighted_b_mode
enable_fast_intra_decisions
enable_fast_inter_decisions
pic_ar_x
pic_ar_y
sar_width
and sar_height
) to -1 and vice versa.calc_quality
cpu_opt
num_threads
live_mode
buffering
hrd_preview
.min_quant
max_quant
max_slice_size
encoding_buffering
vbv_buffer_fullness_trg
). Use of this feature is required for hrd_preview
.ow_delay
low_delay
is set to 1, the encoder overwrites other settings to encode IPPP stream without frames buffering. low_delay
can be used in two modes: synchronous (detach_thread
= 0) and asynchronous (detach_thread
= 1). In synchronous mode, the encoder freezes the calling thread in put frame and resumes the thread after a frame has been encoded. In asynchronous mode, the encoder works in a separate thread. All frames to be encoded are stored in a frames pool. The size of this is defined by the setting buffering.air_mode
air_split_frequency
air_qp_offset
detach_thread
constrained_intra_pred
hw_acceleration
hw_acc_idx
use_deblocking_filter
deblocking_alphaC0_offset
deblocking_beta_offset
adaptive_deblocking
video_type
video_pulldown_flag
pic_struct
flag in the Picture timing SEI message. The frame_rate parameter should be specified as target frame rate (i.e. 29.97, 30, 59.94 or 60). Video pulldown can only be applied to a frame, i.e. interlace_mode
can be equal only to H.264 Progressive or H.264 MBAFF.stream_type
bit_depth_luma
bit_depth_luma
and bit_depth_chroma
need to be set to the same value.bit_depth_chroma
bit_depth_chroma
and bit_depth_luma
need to be set to the same value.chroma_format
vui_presentation
write_au_delimiters
write_seq_end_code
write_seq_end_code=0
to avoid variable or wrong frame rates.write_timestamps
timestamp_offset
drop_frame_timecode
write_single_sei_per_nalu
write_seq_par_set
write_pic_par_set
log2_max_poc
log2_max_pic_order_cnt_lsb_minus4
value. Available range is [4, 16], default value is 8.log2_max_frame_num
log2_max_frame_num_minus4
value. Available range is [4, 16], default value is 8.pic_order_cnt_type
pic_order_cnt_type
value. Available values are 0 (default) and 2. Picture order count type 2 can only be used for streams with identical decoding and presentation orders, i.e. containing no B frames.pic_order_present_flag
fixed_frame_rate
frame_based_timing
frame_packing_arrangement_mode
write_pic_timing_sei
normalize_dts
vcsd_mode
min_idr_interval
min_idr_interval
frames from previous one. The SCD forced I-frame can be discarded when the distance to the next chapter point is less than min_idr_interval
. Available values from 1 to idr_interval
if idr_interval
> 0, otherwise min_idr_interval
can be from 1 (which means no limitation for minimal GOP length) to maximal signed 32-bit integer (which means in practice that no I-frames will be inserted at scene changes).adaptive_b_frames
vcsd_mode
and allows to use adaptive B-frames placement depending on sequence complexity.idr_frequency
field_order
fixed_i_position
isoleted_gops
idr_frequency
is not equal to 1 (i.e. some I-frames are non-IDR I-frames).leading_b_frames
isolated_gops
should be set to 0.fast_multi_ref_me
fast_sub_block_me
allow_out_of_pic_mvs
constrained_ref_list
motion_search_pattern
enable_intra_big
enable_intra_8x8
enable_intra_4x4
enable_intra_pcm
enable_inter_big
enable_inter_8x8
enable_inter_4x4
enable_inter_pcm
fast_rd_optimization
quant_mode
grain_mode
grain_opt_strength
rdo_ip_4x4
adaptive_quant_strength
denoise_strength_y
denoise_strength_c
black_norm_level
black_norm_level
will be set to 16. Available range is 0..255.pulse_reduction
aq_mode
adaptive_quant_strength
setting.interlace_mode
must be equal to H264_PROGRESSIVE
me_weighted_p_mode
must be equal to 0me_weighted_b_mode
must be equal to 0adaptive_b_frames
must be equal to 0input_filtering
video_type
must be equal to H264_OPTIMIZED_HIGH
interlace_mode
must be equal to H264_PROGRESSIVE
me_weighted_p_mode
must be equal to 0me_weighted_b_mode
must be equal to 0adaptive_b_frames
must be equal to 0leading_b_frames
must be equal to 0aq_mode
must not equal H264_AQ_MODE_SPATIAL
filter_low_delay_mode
filter_accuracy
seq_scaling_matrix_present_flag
scaling_list_present_flags
are present. If the scaling_matrix_present_flag
is set to 0, it specifies that scaling_list_present_flags
are not present and flat matrices will be used for all scaling lists (ITU-T Rec. H.264, 7.4.2.1.1).seq_scaling_list_present_flag
Value | Block size | MB prediction type | Component |
---|---|---|---|
0 | 4x4 | Intra | Y |
1 | 4x4 | Intra | Cb |
2 | 4x4 | Intra | Cr |
3 | 4x4 | Inter | Y |
4 | 4x4 | Inter | Cb |
5 | 4x4 | Inter | Cr |
6 | 8x8 | Intra | Y |
7 | 8x8 | Inter | Y |
This appendix contains information on the following:
For full compliance with the Panasonic specifications, the P2 AVC-Intra presets require a special folder structure to be created. The MainConcept AVC Broadcast Encoder plug-in for FFmpeg comes with a special multi-platform python script (P2_AVCI_folder_creation.py
) which allows this. It is installed together with the plug-in.
Operating system | Package |
---|---|
Windows | C:\Program Files\MainConcept\FFmpeg-PlugIns\bin\P2_AVCI_folder_creation.py
|
Linux | /opt/mainconcept/sdk/share/doc/mc-mux-mxf/examples/P2_AVCI_folder_creation.py
|
In the Windows and Linux locations of the MainConcept plug-in installation, you will also find an example Panasonic P2 XML metadata file (p2_intra.xml
) which is referenced in the python script.
The script creates the correct Panasonic P2 folder structure after encoding, generates a thumbnail from the video file and then renames as well as copies all required files to the corresponding P2 location. You need to run the script for the folder where the encoded Panasonic P2 MXF streams and the p2_intra.xml
metadata file are located.
py P2_AVCI_folder_creation.py test_folder
python P2_AVCI_folder_creation.py test_folder
The python script then automatically creates the P2 AVC-Intra folder structure (CONTENT) and updates some of the descriptive metadata from the encoded MXF files by using the p2_intra.xml
as a template and copies the updated version of the XML file to /CONTENT/CLIP/1000A0
.XML applying the correct P2 naming conventions. It also generates a thumbnail from the first frame of the encoded MXF file and copies it to the correct location, e.g. /CONTENT/ICON/1000A0
.BMP. Finally, it renames the actual MXF audio and video files to the correct Panasonic P2 AVC-Intra naming scheme and copies them to the corresponding folders /CONTENT/AUDIO/1000A0
.MXF and /CONTENT/VIDEO/1000A0
.MXF.
For full compliance with the Panasonic specifications, the P2 AVC-Ultra compliant AVC-Intra or AVC-LongG (Op1b SMPTE 391M) presets require some descriptive metadata (XML and thumbnail file) to be passed to the MXF multiplexer in the FFmpeg command-line. To obtain the XML and the thumbnail, you need to run a special multi-platform python script (P2_LongG_dm_creation.py
) on your source file. The script is installed with the MainConcept AVC Broadcast Encoder plug-in for FFmpeg and needs to be applied prior to encoding.
C:\Program Files\MainConcept\FFmpeg-PlugIns\bin\P2_LongG_dm_creation.py
/opt/mainconcept/sdk/share/doc/mc-mux-mxf/examples/P2_LongG_dm_creation.py
In the Windows and Linux locations of the MainConcept plug-in installation, you will also find an example Panasonic P2 XML metadata file (p2_long_gop.xml
) that gives you an idea of how the descriptive metadata (dm) looks like.
If you want to create a valid Panasonic P2 AVC-Ultra compliant AVC-Intra or AVC-LongG file, you need to apply the script on the source (input) file before the actual FFmpeg encoding. It creates the correct XML as well as thumbnail file for encoding.
py P2_LongG_dm_creation.py [source file]
python P2_LongG_dm_creation.py [source file]
After running the script on your input, two files are created: source file.XML
and source file.bmp
. These descriptive metadata files are now required for encoding, i.e. you must specify them on the FFmpeg command-line as follows:
ffmpeg -i newsflash.mp4 -vf scale=1920:1080 -c:v omx_enc_avc -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_420_CLASS_G6:acc_type=sw" -c:a pcm_s24le -ar 48000 -f omx_mxf_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVC_ULTRA:profile=MXF_PROF_PANASONIC_P2:dm_xml_filename=source file.XML:dm_thumbnail_filename=source file.bmp:operational_pattern=OP1B" 001KB0OR.mxf -y
fffmpeg -i newsflash.mp4 -vf scale=1920:1080 -c:v omx_enc_avc -omx_name OMX.MainConcept.enc_avc.video -omx_param "preset=H264_LONG_GOP_420_CLASS_G6:acc_type=sw" -c:a pcm_s24le -ar 48000 -f omx_mxf_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mxf.other -omx_format_param "mplex_type=P2_AVC_ULTRA:profile=MXF_PROF_PANASONIC_P2:dm_xml_filename=source file.XML:dm_thumbnail_filename=source file.bmp:operational_pattern=OP1B" 001KB0OR.mxf -y
The file encoded with the MainConcept AVC Broadcast Encoder plug-in for FFmpeg now includes the descriptive metadata as outlined above.
For full compliance with the Panasonic specifications, the P2 AVC-Ultra compliant AVC-Intra or AVC-LongG (Op1b SMPTE 391M) presets require a special folder structure to be created. The MainConcept AVC Broadcast Encoder plug-in for FFmpeg comes with a special multi-platform python script (P2_LongG_folder_creation.py
) that allows this. It is installed together with the plug-in. To apply this script, you need the encoded MXF file as well as a thumbnail (BMP) and descriptive metadata (XML) files generated from running the Python script (P2_LongG_dm_creation.py
) from the previous chapter on the source file.
C:\Program Files\MainConcept\FFmpeg-PlugIns\bin\P2_LongG_folder_creation.py
/opt/mainconcept/sdk/share/doc/mc-mux-mxf/examples/P2_LongG_folder_creation.py
In the Windows and Linux locations of the MainConcept plug-in installation, you also find an example Panasonic P2 XML metadata file (p2_long_gop.xml
) that is referenced in the python script.
This script creates the correct Panasonic P2 folder structure after encoding. You need to run the script for the folder where the encoded Panasonic P2 MXF stream, the BMP and the XML files are located, i.e. they need to be present in the same folder. When running the script, it generates the correct P2 AVC Ultra folder structure and copies the video, thumbnail and XML files to the corresponding P2 location.
py P2_LongG_folder_creation.py test_folder
python P2_LongG_folder_creation.py test_folder
The python script then automatically creates the P2 AVC Ultra or AVC-LongG (Op1b SMPTE 391M) folder structure (CONTENTS) and copies the descriptive metadata XML file to /CONTENTS/CLIP/001KB0OR
.XML applying the correct P2 naming conventions. It also copies a thumbnail from the first frame of the encoded MXF file to the correct location, e.g. /CONTENTS/ICON/001KB0OR
.BMP. Finally, it renames the actual MXF file to the correct Panasonic P2 naming scheme and copies it to the right folder /CONTENTS/AVCLIP/001KB0OR
.MXF.