[FFmpeg-user] How to generate IRT conform D10 IMX50 MXFs (and how to set the output color_range, -space, -transfer and primaries flags)
Christoph Gerstbauer
christophgerstbauer at gmail.com
Tue Apr 28 10:20:08 CEST 2015
Hello
I am making tests with IMX50/MXF encodings with FFMBC and FFMPEG. (with
24bit audio)
The tests compare the final files with the IRT MXF Analyzer Pro tool to
be shure to be IRT conform.
(My used syntax is at the bottom of this mail)
Both files (generated with ffmbc and ffmpeg) are working very well in
editing tools but there is a little difference:
The IMX50 generated by ffmbc has no errors/warnings at IRT MXF Analyzer
(with16bit audio). It is really perfect. In fact I never had a clean
"green" MXF by testing other probes from other encoding tools. Only the
IRT probes itself are clean. So this MXF is IRT conform when using the
ffmbc standard target preset "imx50".
The Analyzis of the IMX50/MXF generated by FFMPEG (latest build from
zeganoe) has 1 warning and 1 error:
WARNING:
"Fill Item Key with a wrong RP210 (SMPTE Metadata Dictionary) version
number of 0x01. The correct version number is 0x02"
ERROR: "The Sound Essence Descriptor signals that the number if
quantization bits is 24, which is higher than actually required (16) as
detemined by parsing the essence."
Due to the fact that I am producing 24bit audio I could prevent the
WARNING by producing 16bit audio. But is there a problem in the MXF when
producing 24bit? Sound works in editing tools.
Furthermore ffmbc produces for standard a IMX with 16bit -> If I force
ffmbc to do 24bit, I get the same error.
Due to the warning: I found out that both files are different regarding
these values (by reading out via ffprobe - show_streams)
FFMBC IMX FILE stream 0:0:
color_range=tv
color_space=smpte170m
color_transfer=bt709
color_primaries=bt470bg
FFMPEG IMX FILE stream 0:0:
color_range=tv
color_space=unknown
color_transfer=unknown
color_primaries=unknown
So my questions are :
1.) How can I produce (with ffmpeg) the same output like ffmbc with
these 4 metadata flags:
color_range=tv
color_space=smpte170m
color_transfer=bt709
color_primaries=bt470bg
I didnt found a answer to that in the ffmpeg documentation :/
2.) Maybe somebody knows: Do these 4 metadata flags have a connection to
the Warning message of the MXF Analyzer? -> "Fill Item Key with a wrong
RP210 (SMPTE Metadata Dictionary) version number of 0x01. The correct
version number is 0x02"
If nobody know this answer I could do the test for myself by be able to
encode with the upper params in 1.).
3.) Is there an syntax option in ffmpeg for 24bit audio encoding to
prevent this ERROR:
"The Sound Essence Descriptor signals that the number if quantization
bits is 24, which is higher than actually required (16) as detemined by
parsing the essence."
Best Regards
Christoph
USED SYNTAX:
-------------------------------------------------------------
FFmbc (16bit audio):
ffmbc -i I:\IMX_tests\IMX50_CARBON.avi -target imx50
I:\IMX_tests\_FFMBC_PAL_IMX_16bit_2.mxf -loglevel debug
FFmbc version 0.7-rc7
Copyright (c) 2008-2012 Baptiste Coudurier and the FFmpeg developers
Input #0, avi, from 'I:\IMX_tests\IMX50_CARBON.avi':
Metadata:
encoder: Lavf55.0.100
ISMP: 00:00:00:00
Duration: 00:00:20.00, start: 0.000000, bitrate: 113291 kb/s
Stream #0.0(und): Video: ffvhuff, yuv422p, 720x608p, PAR 152:135
DAR 4:3, 25.00 fps
Stream #0.1(und): Audio: pcm_s24le, 48000 Hz, stereo, s32, 2304 kb/s
File 'I:\IMX_tests\_FFMBC_PAL_IMX_16bit_2.mxf' already exists. Overwrite
? [y/N] y
[buffer @ 00000000018E07E0] w:720 h:608 pixfmt:yuv422p tb:1/1000000
sar:152/135 sws_param:
Incompatible sample format 's32' for codec 'pcm_s16le', auto-selecting
format 's16'
Warning, QMAT_SHIFT is larger than 21, overflows possible
Last message repeated 1 times
Output #0, mxf_d10, to 'I:\IMX_tests\_FFMBC_PAL_IMX_16bit_2.mxf':
Metadata:
encoder: FFmbc 0.7
Stream #0.0(und), 0, 1/25: Video: mpeg2video, yuv422p, 720x608i tff
[PAR 152:135 DAR 4:3], tbc 1/25, cbr, 50000 kb/s, 25.00 fps
Stream #0.1(und), 0, 1/48000: Audio: pcm_s16le, 48000 Hz, stereo,
s16, 1536 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
[mxf_d10 @ 000000000037C9C0] package type:1
[mxf_d10 @ 000000000037C9C0] package type:2
[mxf_d10 @ 000000000037C9C0] edit units count 0
frame= 239 fps= 25 q=3.0 size= 72409kB time=00:00:09.52
bitrate=62307.8kbits/s eta=00:00:10.51
-------------------------------------------------------------
FFmbc (24bit audio):
ffmbc -i I:\IMX_tests\IMX50_CARBON.avi -target imx50 -acodec pcm_s24le
I:\IMX_tests\_FFMBC_PAL_IMX_24bit_2.mxf -loglevel debug
FFmbc version 0.7-rc7
Copyright (c) 2008-2012 Baptiste Coudurier and the FFmpeg developers
Input #0, avi, from 'I:\IMX_tests\IMX50_CARBON.avi':
Metadata:
encoder: Lavf55.0.100
ISMP: 00:00:00:00
Duration: 00:00:20.00, start: 0.000000, bitrate: 113291 kb/s
Stream #0.0(und): Video: ffvhuff, yuv422p, 720x608p, PAR 152:135
DAR 4:3, 25.00 fps
Stream #0.1(und): Audio: pcm_s24le, 48000 Hz, stereo, s32, 2304 kb/s
[buffer @ 00000000002EFF60] w:720 h:608 pixfmt:yuv422p tb:1/1000000
sar:152/135 sws_param:
Warning, QMAT_SHIFT is larger than 21, overflows possible
Last message repeated 1 times
Output #0, mxf_d10, to 'I:\IMX_tests\_FFMBC_PAL_IMX_24bit_2.mxf':
Metadata:
encoder: FFmbc 0.7
Stream #0.0(und), 0, 1/25: Video: mpeg2video, yuv422p, 720x608i tff
[PAR 152:135 DAR 4:3], tbc 1/25, cbr, 50000 kb/s, 25.00 fps
Stream #0.1(und), 0, 1/48000: Audio: pcm_s24le, 48000 Hz, stereo,
s32, 2304 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
[mxf_d10 @ 00000000003BF460] package type:1
[mxf_d10 @ 00000000003BF460] package type:2
[mxf_d10 @ 00000000003BF460] edit units count 0
frame= 341 fps= 25 q=3.0 size= 103570kB time=00:00:13.60
bitrate=62385.4kbits/s eta=00:00:06.41
-------------------------------------------------------------
FFMPEG (24bit audio):
ffmpegnew -i I:\IMX_tests\IMX50_CARBON.avi -map 0:v -map 0:a -c:v
mpeg2video -r 25 -pix_fmt yuv422p -aspect 4:3 -minrate 50000k -maxrate
50000k -b:v 50000k -intra -flags +ildct+low_del
ay -intra_vlc 1 -non_linear_quant 1 -ps 1 -qmin 1 -qmax 3 -top 1 -dc 10
-bufsize 2000000 -rc_init_occupancy 2000000 -rc_max_vbv_use 1
-rc_min_vbv_use 1 -c:a pcm_s24le -ar 48000 -f mxf_d10 I:\IMX_tests
\_FFMPEGNEW_PAL_IMX_24bit_2.mxf
ffmpeg version N-71727-g46778ab Copyright (c) 2000-2015 the FFmpeg
developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libdcadec
--enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --ena
ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 35.101 / 56. 35.101
libavformat 56. 31.100 / 56. 31.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 14.100 / 5. 14.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, avi, from 'I:\IMX_tests\IMX50_CARBON.avi':
Metadata:
encoder : Lavf55.0.100
timecode : 00:00:00:00
Duration: 00:00:20.00, start: 0.000000, bitrate: 113291 kb/s
Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv422p, 720x608,
111196 kb/s, SAR 152:135 DAR 4:3, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s32 (24 bit), 2304 kb/s
File 'I:\IMX_tests\_FFMPEGNEW_PAL_IMX_24bit_2.mxf' already exists.
Overwrite ? [y/N] y
Output #0, mxf_d10, to 'I:\IMX_tests\_FFMPEGNEW_PAL_IMX_24bit_2.mxf':
Metadata:
timecode : 00:00:00:00
encoder : Lavf56.31.100
Stream #0:0: Video: mpeg2video, yuv422p, 720x608 [SAR 152:135 DAR
4:3], q=1-3, 50000 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc56.35.101 mpeg2video
Stream #0:1: Audio: pcm_s24le, 48000 Hz, stereo, s32 (24 bit), 2304
kb/s
Metadata:
encoder : Lavc56.35.101 pcm_s24le
Stream mapping:
Stream #0:0 -> #0:0 (ffvhuff (native) -> mpeg2video (native))
Stream #0:1 -> #0:1 (pcm_s24le (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
[mxf_d10 @ 00000000003bf240] the number of audio channels shall be 4 or
8 : the output will not comply to MXF D-10 specs, use -d10_channelcount
to fix this
frame= 500 fps=347 q=1.6 Lsize= 152756kB time=00:00:20.00
bitrate=62568.9kbits/s
video:122070kB audio:5625kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 19.625412%
More information about the ffmpeg-user
mailing list