Log in

View Full Version : DNxHR 4:4:4 12bit badly indexed


FranceBB
20th April 2018, 12:00
Hi,
I got a few files recorded in DNxHR 4:4:4 12bit.
I tried to index them via ffms2000 (latest build), LwLibavVideoSource and DirectShowSource (K-Lite Codec Pack which uses LAV).
I also tried to open it with ffmpeg (latest zeranoe build), but they are all green.
I expected them to be at double resolution 16bit or dithered down at 8bit, but instead they are shown at normal resolution, 8bit and green.
It seems that these indexers are misinterpreting the bitdepth of these files.
I'm gonna upload them via WeTransfer, if you can take a look.
I'm trying to encode them in a mezzanine format like AppleProRes and so on to work with them.
I tried to link and import them via AVID ('cause DNxHR it's supposed to be their native format), but it says that they are not supported.
I gotta say that I don't have the latest version of AVID Media Composer.
I don't know how to work with these files and the cameramen who shot them said that they have been recorded with a RED EPIC-W HELIUM 6.3.101 and wrapped in an MXF.

MediaInfo:

General
Complete name : C:\Encoding\A001_C001_0419YT_V01_001.mxf
Format : MXF
Commercial name : DNxHR 444
Format version : 1.2
Format profile : OP-Atom
Format settings : Closed / Complete
File size : 1.00 GiB
Duration : 27 s 800 ms
Overall bit rate : 310 Mb/s
Package name : A001_C001_0419YT
Encoded date : 2018-04-19 14:33:19.000
Writing application : RED.COM, Inc. EPIC-W HELIUM 6.3.101

Video
ID : 1
Format : VC-3
Commercial name : DNxHR 444
Format version : Version 3
Format profile : RI@444
Format settings, wrapping mode : Clip
Codec ID : 0D01030102110200-0401020271240000
Duration : 27 s 800 ms
Bit rate mode : Constant
Bit rate : 310 Mb/s
Width : 2 048 pixels
Height : 864 pixels
Display aspect ratio : 2.40:1
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 12 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 7.019
Stream size : 1.00 GiB (100%)
Matrix coefficients : BT.709

Other
ID : 0-Material
Type : Time code
Format : MXF TC
Time code of first frame : 14:33:19:16
Time code settings : Material Package
Time code, striped : Yes


This is a sample file: https://we.tl/2bxt35YY9f
Please, help me out.
Thank you in advance.

richardpl
20th April 2018, 13:42
Try:
ffmpeg -i input.mxf -vf mergeplanes=0x010002:gbrp12

If some file have row(s) in wrong color, please upload it.

mp3dom
20th April 2018, 14:18
Premiere have native support of all the AVID codecs, DNxHR444 included.

FranceBB
20th April 2018, 15:23
Try:
ffmpeg -i input.mxf -vf mergeplanes=0x010002:gbrp12

If some file have row(s) in wrong color, please upload it.

I tried but it didn't work.
The sample file recorded by the camera is in the first post.

This is the original file: https://we.tl/2bxt35YY9f
This is the encoded file: https://we.tl/d2Oi4VCUCS
This is a picture of the encoded file: https://i.imgur.com/d5zK4w9.jpg

This is the command line I used with the -vf you suggested:

ffmpeg.exe -i "A001_C010_0419K8_V01_001.mxf" -vf mergeplanes=0x010002:gbrp12 -pix_fmt yuv422p -vcodec mpeg2video -s 1920:1080 -aspect 16:9 -vf setfield=tff -flags +ildct+ilme -r 25 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -acodec pcm_s16le -ar 48000 -g 12 -bf 2 -profile:v 0 -level:v 2 -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -f mxf "testoutput.mxf"

PAUSE

richardpl
20th April 2018, 15:34
merge vf, you need to use : -vf mergeplanes=0x010002:gbrp12,setfield=tff

Otherwise last -vf wins.

FranceBB
20th April 2018, 15:59
merge vf, you need to use : -vf mergeplanes=0x010002:gbrp12,setfield=tff

Otherwise last -vf wins.

Got it.
I did it, it's no longer green, but the chroma is wrong (bluish).

Original: https://we.tl/oC1N9diXIi
Output: https://we.tl/QQMadM2Lgd
Picture (Output) wrong chroma: https://i.imgur.com/yonCcIh.jpg

ffmpeg.exe -i "A001_C001_0419YT_V01_001.mxf" -vf mergeplanes=0x010002:gbrp12,setfield=tff -pix_fmt yuv422p -vcodec mpeg2video -s 2048:864 -flags +ildct+ilme -r 25 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -acodec pcm_s16le -ar 48000 -g 12 -bf 2 -profile:v 0 -level:v 2 -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -f mxf "output.mxf"

PAUSE

richardpl
20th April 2018, 16:20
Apparently mergeplanes first argument needs to be something else than 0x010002, like 0x000102 or 0x020001

FranceBB
20th April 2018, 16:30
Apparently mergeplanes first argument needs to be something else than 0x010002, like 0x000102 or 0x020001

0x000102 = https://i.imgur.com/3qhQebA.jpg
0x020001 = https://i.imgur.com/KA1akfm.jpg

Nope. We are getting closer, but it must be a different value.

richardpl
20th April 2018, 16:34
Try 0x010200

FranceBB
20th April 2018, 16:42
Try 0x010200

Perfect! It worked! :D
Img: https://i.imgur.com/edyEyus.jpg

Thank you very much indeed!

poisondeathray
20th April 2018, 17:34
For avisynth+ or vpy , ffms2 will return 16bit YUV planes (but some versions of ffms2 will return 12bit YUV 444)


a=FFVideoSource()
MergeRGB(a.greyscale, a.utoy, a.vtoy)


This returns 16bit RGB and looks correct in vdub2 (or at least it matches what Adobe produces in terms of colors)

(also mediainfo reports 4:2:0 , maybe submit a bug report and that sample)