J
J
J. Snow2020-01-23 10:55:57
Video
J. Snow, 2020-01-23 10:55:57

Why does the video get darker after converting to DNxHD (DNxHR)?

Hi all!
Why does the video get darker (higher contrast) after converting from h264/265 to DNxHD/DNxHR?
5e294b589f759374815640.jpeg
Converting with ffmpeg:

ffmpeg -i in.mov -c:v dnxhd -profile:v dnxhr_hqx -vf "scale=in_range=pc" out.mov

Tried different combinations of in/out_range. The output video is always different.
ORIGINAL MediaInfo
General
Format : MPEG-4
Format profile : QuickTime
Codec ID : qt 0000.02 (qt )
File size : 124 MiB
Duration : 10 s 40 ms
Overall bit rate : 103 Mb/s
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main [email protected]@High
Codec ID : hvc1
Codec ID/Info : High Efficiency Video Coding
Duration : 10 s 40 ms
Bit rate : 101 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.487
Stream size : 121 MiB (98%)
Language : English
Color range : Full
Color primaries : BT.709
Transfer characteristics : BT.601
Matrix coefficients : BT.601
Codec configuration box : hvcC

DNxHR MediaInfo
General
Format : MPEG-4
Commercial name : DNxHR HQX
Format profile : QuickTime
Codec ID : qt 0000.02 (qt )
File size : 873 MiB
Duration : 10 s 40 ms
Overall bit rate mode : Constant
Overall bit rate : 730 Mb/s
Writing application : Lavf58.29.100
Video
ID : 1
Format : VC-3
Commercial name : DNxHR HQX
Format version : Version 3
Format profile : [email protected]
Codec ID : AVdh
Codec ID/Info : Avid DNxHR
Duration : 10 s 40 ms
Bit rate mode : Constant
Bit rate : 728 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 10 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 3.512
Stream size : 872 MiB (100%)
Language : English

Answer the question

In order to leave comments, you need to log in

2 answer(s)
@
@nidalee, 2020-01-23
@j-snow

Color primaries : BT.709
Transfer characteristics : BT.601
Matrix coefficients : BT.601
Probably, you need to not only set in_range, but also all characteristics and coefficients.
See: color_range=, color_space=, color_transfer=, color_primaries=
You can read, in particular, this article, with the telling title " Color Hell : Ffmpeg Transcoding and Preserving BT.601"
In addition, you turn 4:2:0 into 4:2:2 - this also does not add accuracy to the colors.
What is your purpose for converting?

B
Balling, 2021-08-07
@Balling

You need to understand the swscale defaults of the ffmpeg component. Firstly, by default it uses a BT.601 matrix (this is YCbCr encoding), and secondly, a limited range. So without -vf scale=out_range=pc (but also -color_range pc) you won't get full range. And by the way. I'm not at all sure that the VC-3 has a full range. And also you need to add 1 -color_primaries bt709 -color_trc bt601 -colorspace smpte170m
BT.601 matrix with BT.709 primaries is not quite standard mechanics. For proper display, mpv should be used.
Oh, and by the way. You should check that your .hevc source is really full, this is a standard android bug.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question