VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Aug 2019
    Location
    Australia, NSW
    Search Comp PM
    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.

    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
    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?

    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.

    https://drive.google.com/drive/folders/1j2Qq1sV5ZJJsMYe3DOFOV0dnQ3VIotcw?usp=sharing
    Quote Quote  
  2. 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
    eg.
    Code:
    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
    Quote Quote  
  3. Member
    Join Date
    Aug 2019
    Location
    Australia, NSW
    Search Comp PM
    Hey poisondeathray,
    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

    Cheers,
    Josh
    Quote Quote  
  4. 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

    Code:
    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
    There is still negligible minor (and expected) shifting in the scopes; it's partly due to dnxhd being lossy (if you used v210 uncompressed you will see the effect of the conversion only, minus the dnxhd compression), partly due to the limited range conversion (you lose something when you squash the data into a limited range). Full range YUV is non standard for DNxHD and video formats in general, and you'd have to "legalize" eventually for distribution formats anyways
    Quote Quote  



Similar Threads