mlt_image_format=yuv444p10 ?

I improved support for mlt_image_format=yuv420p10 and mlt_image_format=yuv444p10 in MLT for the next version of Shotcut. Like I said, it was not really considered outside of the Movit integration because I tend to think of a 8-bit CPU pipeline and 10-bit GPU pipeline. However, now one can carefully tread a 10-bit CPU pipeline by avoiding most effects. You asked about MLT changing its “internal processing.” Any effect that does not handle what was requested from downstream or supplied by upstream will convert to a different mlt_image_type. So, one needs to avoid those, and the work here was to ensure some components behave better when using those 10-bit image formats. Basically, only scaling and some FFmpeg filters are supported. Which ones is not very convenient because you need to look in the libavfilter source code for a function like query_formats() or a block like this from vf_hue.c

static const enum AVPixelFormat pix_fmts[] = {
    AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
    AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUV411P,
    AV_PIX_FMT_YUV410P,      AV_PIX_FMT_YUV440P,
    AV_PIX_FMT_YUVA444P,     AV_PIX_FMT_YUVA422P,
    AV_PIX_FMT_YUVA420P,
    AV_PIX_FMT_YUV444P10,      AV_PIX_FMT_YUV422P10,
    AV_PIX_FMT_YUV420P10,
    AV_PIX_FMT_YUV440P10,
    AV_PIX_FMT_YUVA444P10,     AV_PIX_FMT_YUVA422P10,
    AV_PIX_FMT_YUVA420P10,
    AV_PIX_FMT_NONE
};

This is Hue/Lightness/Saturation in Shotcut. Other Shotcut filters that will work are:

  • Blur: Gaussian
  • Chroma Hold
  • Deband
  • Flip
  • Mirror
  • LUT (3D) (must convert to RGB, but I see it using gbrp10le)
  • Nervous
  • Noise: Fast
  • Trails
  • Reduce Noise: Wavelet
  • Vibrance (also RGB with gbrp10le)

This means it will be possible to do cuts-only editing and limited filtering of HLG HDR video. Also, one must avoid track blending and transitions. Also, the preview is not in HDR; so color work will be almost useless. Then, in Export > Other add

colorspace=2020
color_trc=arib-std-b67
pix_fmt=yuv420p10le
mlt_image_format=yuv420p10

If you leave out mlt_image_format MLT will infer it from pix_fmt, but ensure it is not rgb. MLT also infers FFmpeg’s colorspace=bt2020 when you use MLT colorspace=2020. Again, next version ( beta early January).

MLT accepts YUV422p16, too

A contributor added that almost 10 years ago to do 10-bit capture from Blackmagic Design DeckLink SDI (decklink producer with avformat consumer). In MLT, you cannot expect to combine something with everything else. That image format is not supported in the general sense.

a bunch of HDR10+ phone recordings and needed to include them together with a couple of SDR gameplay videos

I can only recommend at this time with Shotcut to convert the HDR to tone-mapped SDR (you can use our convert function or grab its command line from the log as a starting point). However, I am now curious about trying to include SDR in a HDR project–not absurdly stretch range and gamut but simply to make it look nice alongside the HDR footage. With 10-bit HLG support that now seems possible in Shotcut, but I am not confident about HDR10+. One can manually add x265-params with max-cll and color_trc=smpte2084. I tested that, it appears to work fine. Of course, that is not dynamic metadata. I have not yet learned much about libdovi.

2 Likes