I'm trying to build a python application to convert a 10bit DPX sequence to a 4k DNXHR_444 MOV with a Arri to Rec709 lut, just as I would in Davcincci resolve.
When comparing the output to the dpx in resolve with the lut on it, there is a slight colour shift making everything slightly more red. Even when i take the lut out of the ffmpeg code, there is still a slight redness. The colourmatrix helps a bit to get it closer but it isn't close enough. Any ideas why I can't get them to match?Code:ffmpeg -f image2 -framerate 24 -pattern_type glob -i INPUT.dpx -c:v dnxhd -profile:v dnxhr_444 -vf lut3d=ArriAlexa_LogCtoRec709_Resolve.cube,colormatrix=bt601:bt709 -pix_fmt yuv444p10le -c:a pcm_s16le -y -timecode 00:00:41:16 OUTPUT.mov
Here is a:
- JPG - reference of what the DPX + LUT should look like
- DPX - a frame of the dpx sequence I'm trying to convert to DNXHR_444
- the ArriLogC_to_Rec709 LUT to be applied to the DPX
Let me know if you need anything else.
+ Reply to Thread
Results 1 to 4 of 4
The problem is the RGB => YUV conversion. And colormatrix is to be avoided if possible (8bit, quality issues)
In ffmpeg, zscale is the preferred method these days
This works ok, confirmed in Resolve 15, and other programs
ffmpeg -i DPX(what_I_want_to_convert_to_DNXHR).dpx -vf lut3d=ArriAlexa_LogCtoRec709_Resolve.cube,zscale=matrix=709,format=yuv444p10le -c:v dnxhd -profile:v dnxhr_444 -an test_zscale.mov
Sorry for my slow reply!
This worked perfectly! You're a legend thanks for that.
I'm trying to do a simlar conversion, but with 2K JPGs that already have the LUT baked in. When I do the same conversion, but take out the lut command and the change the profile to "dnxhr_hqx" and format to "yuv422p10le", the resulting MOV is darker then the jpgs as compared in resolve. The JPGs are 8bit so maybe that is why?
Any idea? I've messaged you a file from the jpg sequence.
ffmpeg -i JPG_sequence.jpg -vf zscale=matrix=709,format=yuv422p10le -c:v dnxhd -profile:v dnxhr_hqx -an test_zscale.mov
jpeg is usually stored as "yuvj" or "full range" YUV . Your image is yuvj422p (422 subsampled YUV) . When it's "viewed" by some application , it's converted to RGB for display, with a full range conversion so everything looks normal
But when converting to a YUV video format, you typically have to scale the range from full range to limited ("video legal") range .
That's the main difference why it's "darker"; but jpeg usually uses "601" for the matrix by convention, so you have to adjust the matrix 601=>709 as well
ffmpeg -i "INPUT.jpg" -vf zscale=matrixin=470bg:matrix=709:rangein=full:range=limited,format=yuv422p10le -c:v dnxhd -profile:v dnxhr_hqx -an test_jpg_zscale.mov