Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

Christoph Gerstbauer
Hello,

I am testing some MXFs probes with different codecs: AVC-Intra, DNxHD,
XDCAMHD422 and IMX50.

When opening the mxfs with ffprobe or ffmpeg, the program shows me
following Color Range and ITU-Recommendation Color Form in brackets at
the end of the pixel_format information ( e.g. yuv422p10le(pc,bt709) ):

a) AVC-Intra: (pc,bt709)
b) DNxHD: no info
c) IMX50: (tv)
d) XDCAMHD422: (tv, bt709)

As I know it:
"tv" : 16-235 / 64-940 limited Video ranges
"pc" : Full Range 0-255 / 0-1023
"bt709": Standard HDTV YCbCr colorhandling / color primaries
"bt601": Standard SDTV YCbCr colorhandling / color primaries

Question(s) 1:
Where does ffmpeg get these information packet? From the container itself?
And why is at IMX50 no bt601 information?

I made some tests with MXF BMX -> mxf2raw and mxfdump.
With mxfdump I can check the set Color Ranges in the MXF container by
dumping the file information into text file an searching for these KLVs:
BlackRefLevel WhiteReflevel ColorRange


And these KLVs are always the same in IMX50 and XDCAMHD422:
16
        235
        225
00 00 00 10 00 00 00 eb 00 00 00 e1


So the "tv" info in ffmpeg seems correct for me.

When I check the DNxHD file, there is no info in the mxf dump about
BlackRefLevel, WhiteRefLevel and ColorRange -> ffmpeg does not show the
info "tv" or "pc" -> seems correct.

BUT:
When opening AVC INTRA files there are 2 groups:
1.) NO information in mxfdump about BlackRefLevel, WhiteRefLevel and
ColorRange
2.) existing information in mxfdump: BlackRefLevel 64/ WhiteRefLevel 940
/ ColorRange 897 -> that means for me "tv" in ffmpeg language.

But ffmpeg always show "pc" -> Full Range 0-255 / 0-1023

Question(s) 2:
Where does ffmpeg get the information packet from the MXF which is
forcing to show "pc"?
Or is ffmpeg guessing the Color Range when it gets a specific codec
(MPEG2 -> "tv" / AVCI -> "pc")?

I hope you can help, I am very confused about that.
For me it seems that the MPEG2 Codecs IMX50 and XDCAMHD are very well
standardized for MXF.
But DNxHD and AVC-INTRA are not.

Best Regards
Christoph
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

Carl Eugen Hoyos
Christoph Gerstbauer <christophgerstbauer <at> gmx.at> writes:

> I hope you can help

Sure.

Please provide sample(s), command line (ffmpeg -i file)
and complete, uncut console output.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

Christoph Gerstbauer
Hello Carl,

you can download here 2 samples (including text-dumpfile), each 150MB.
I am not able to crop the MXFs (and I am not shure if I would destroy
something when cropping).
https://dl.dropboxusercontent.com/u/26129407/ffmpeg_user_mailing_sample_AVCI_MXF.zip


Command line syntax/output:

A) AVC-Intra file WITH_KLV_ColorLevelInfo

C:\Users\gersti>ffmpeg -i "I:\New
folder\AVC-INTRA100_(pc_bt709)_WITH_KLV_ColorLevelInfo.mxf"
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
   built on Apr 11 2014 00:32:01 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-li
bass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopenco
re-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libtwolame --enable-libvidst
ab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
   libavutil      52. 66.100 / 52. 66.100
   libavcodec     55. 52.102 / 55. 52.102
   libavformat    55. 33.100 / 55. 33.100
   libavdevice    55. 10.100 / 55. 10.100
   libavfilter     4.  2.100 /  4.  2.100
   libswscale      2.  5.102 /  2.  5.102
   libswresample   0. 18.100 /  0. 18.100
   libpostproc    52.  3.100 / 52.  3.100
[h264 @ 00000000003b1b00] Overread VUI by 5 bits
     Last message repeated 1 times
[mxf @ 0000000002a97de0] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Guessed Channel Layout for  Input Stream #0.7 : mono
Guessed Channel Layout for  Input Stream #0.8 : mono
Input #0, mxf, from 'I:\New
folder\AVC-INTRA100_(pc_bt709)_WITH_KLV_ColorLevelInfo.mxf':
   Metadata:
     uid             : f6509fb0-93ad-466c-9a27-80346b0016ae
     generation_uid  : dbaa571c-beae-4eff-913a-40cc3e8fb409
     company_name    : QUANTEL
     product_name    : GenerationQ
     product_version : V5.3 rev 3_P6
     product_uid     : b4d908cf-53d5-4b41-91a4-82e018e69daa
     modification_date: 2013-11-04 11:55:46
     timecode        : 00:00:10:00
   Duration: 00:00:10.00, start: 0.000000, bitrate: 123812 kb/s
     Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(pc,
bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 50 tbc
     Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:5: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:6: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:7: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:8: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
At least one output file must be specified


B) AVC-Intra file without_KLV_ColorLevelInfo

C:\Users\gersti>ffmpeg -i "I:\New
folder\AVC-INTRA100_(pc_bt709)_without_KLV_ColorLevelInfo.mxf"
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
   built on Apr 11 2014 00:32:01 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-li
bass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopenco
re-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libtwolame --enable-libvidst
ab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
   libavutil      52. 66.100 / 52. 66.100
   libavcodec     55. 52.102 / 55. 52.102
   libavformat    55. 33.100 / 55. 33.100
   libavdevice    55. 10.100 / 55. 10.100
   libavfilter     4.  2.100 /  4.  2.100
   libswscale      2.  5.102 /  2.  5.102
   libswresample   0. 18.100 /  0. 18.100
   libpostproc    52.  3.100 / 52.  3.100
[mxf @ 0000000000347de0] invalid KAGSize 0 - guessing 1
[mxf @ 0000000000347de0] invalid KAGSize 0 - guessing 1
[mxf @ 0000000000347de0] Field dominance 0 support is not implemented.
Update your FFmpeg version to the newest one from Git. If the problem
still occurs, it means that your file h
as a feature which has not been implemented.
[mxf @ 0000000000347de0] If you want to help, upload a sample of this
file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the
ffmpeg-devel mailing list.
[h264 @ 000000000034a420] Overread VUI by 5 bits
     Last message repeated 1 times
[mxf @ 0000000000347de0] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Guessed Channel Layout for  Input Stream #0.7 : mono
Guessed Channel Layout for  Input Stream #0.8 : mono
Input #0, mxf, from 'I:\New
folder\AVC-INTRA100_(pc_bt709)_without_KLV_ColorLevelInfo.mxf':
   Metadata:
     uid             : b851fd97-6241-e311-b144-98fe944f6c6c
     generation_uid  : e452fd97-6241-e311-b4e9-98fe944f6c6c
     company_name    : Omneon Inc.
     product_name    : Omneon Media Subsystem
     modification_date: 2013-10-30 12:55:46
     product_version : Omneon libommedia 7,3,0,2 10-01-2013
16:01:28,ex={0,-1},rng={0,-1,0},trimAu,exPre
     application_platform: Omneon Media Api (mach)
     product_uid     : 00000000-0000-0010-8000-050e0b010606
     timecode        : 00:00:00:00
   Duration: 00:00:10.04, start: 0.000000, bitrate: 122939 kb/s
     Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(pc,
bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 174762.67 tbc
     Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:5: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:6: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:7: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
     Stream #0:8: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
At least one output file must be specified

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

Carl Eugen Hoyos
Christoph Gerstbauer <christophgerstbauer <at> gmx.at> writes:

> Stream #0:0: Video: h264 (High 4:2:2 Intra),
> yuv422p10le(pc, bt709)

In both cases, the h264 decoder believes that the VUI
specifies pc and bt709.
Both values are never set by the demuxer, this is not
allowed by the API.

> Overread VUI by 5 bits

This may indicate that the VUI is just misread.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Issue with reading out correct Color Ranges (tv, pc) and color primaries (bt709, bt601) Info at AVCIntra- and MPEG2-MXFs

Christoph Gerstbauer
> Christoph Gerstbauer <christophgerstbauer <at> gmx.at> writes:
>
>> Stream #0:0: Video: h264 (High 4:2:2 Intra),
>> yuv422p10le(pc, bt709)
> In both cases, the h264 decoder believes that the VUI
> specifies pc and bt709.
> Both values are never set by the demuxer, this is not
> allowed by the API.

So both values are always given through the DECODER and not the
container, right?
Does this mean that if the decoder gets video values beyond the standard
range 16-235/64-940 ffmpeg shows automatically "pc" ?

>> Overread VUI by 5 bits
> This may indicate that the VUI is just misread.
>
Ok this partly answers one question of another mail ticket :).
(https://ffmpeg.org/pipermail/ffmpeg-user/2014-May/021209.html)
But what is the VUI exactly?

Best Regards
Christoph
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

How to read out Color primaries (bt709, bt601, fcc) via ffprobe -show_streams

Christoph Gerstbauer-2
In reply to this post by Carl Eugen Hoyos
Hello Carl,

how can I read out the information in brackets after the pixel format
information via ffprobe -show_streams?

When I open a file (eg. XDCAMHD) ffprobe shows me following:

Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709), 1920x1080
[SAR 1:1 DAR 16:9], max. 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc

I want to get this information with "ffprobe -show_streams":
*pix_fmt=yuv422p(tv, bt709)*
But when I use this syntax the output shows me only: *pix_fmt=yuv422p*

This happens with every file I am testing. So ffprobe does not have this
function to show the tv,bt709 information with the -show_streams option,
I guess.

CL output:

C:\Users\gersti>ffprobe -i
"I:\_Testfiles\01_SLO_REQUIRED\_fileset1_GREY\XDCAMHD\01_optPROG_MPEG2_YUV422_(tv,
bt709)__8xMono-PCM24bit__Sony Opt__C0002.MXF" -show_streams
ffprobe version N-63861-g958168d Copyright (c) 2007-2014 the FFmpeg
developers
   built on Jun  9 2014 22:09:41 with gcc 4.8.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-libcaca --enable-libfreetype --enable-libgme
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvo-aacenc
--enable-libvo-amrw
benc --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs
--enable-libxvid --enable-decklink --enable-zlib
   libavutil      52. 89.100 / 52. 89.100
   libavcodec     55. 66.100 / 55. 66.100
   libavformat    55. 42.101 / 55. 42.101
   libavdevice    55. 13.101 / 55. 13.101
   libavfilter     4.  7.100 /  4.  7.100
   libswscale      2.  6.100 /  2.  6.100
   libswresample   0. 19.100 /  0. 19.100
   libpostproc    52.  3.100 / 52.  3.100
Input #0, mxf, from
'I:\_Testfiles\01_SLO_REQUIRED\_fileset1_GREY\XDCAMHD\01_optPROG_MPEG2_YUV422_(tv,
bt709)__8xMono-PCM24bit__Sony Opt__C0002.MXF':
   Metadata:
     uid             : 57a71a00-0864-05c1-020c-08004602023b
     generation_uid  : 57a71a00-0864-05c2-020c-08004602023b
     company_name    : SONY
     product_name    : Opt
     product_version : 1.22
     product_uid     : 060e2b34-0401-0103-0e06-012002010300
     modification_date: 2013-04-26 19:23:51
     timecode        : 02:00:06:01
   Duration: 00:00:37.72, start: 0.000000, bitrate: 60236 kb/s
     Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709),
1920x1080 [SAR 1:1 DAR 16:9], max. 50000 kb/s, 25 fps, 25 tbr, 25 tbn,
50 tbc
     Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
     Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
[STREAM]
index=0
codec_name=mpeg2video
codec_long_name=MPEG-2 video
profile=4:2:2
codec_type=video
codec_time_base=1/50
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1920
height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv422p
level=2
timecode=00:00:00:00
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/25
start_pts=0
start_time=0.000000
duration_ts=943
duration=37.720000
bit_rate=N/A
max_bit_rate=50000000
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]
[STREAM]

bg
Christoph
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user