UT Video

From wiki.selur.net
Jump to navigation Jump to search

UT Video (Ut Video Codec Suite) is a fast lossless intra-frame codec by Takeshi Umezawa. It is popular for screen and game capture and as an intermediate for editing, because it decodes quickly and has codecs for the common editing systems. Hybrid encodes it with ffmpeg's utvideo encoder, which writes 8-bit video.

Base → Video: UT Video, then the UT Video tab

UT Video tab in Hybrid
UT Video tab in Hybrid

What it does

UT Video predicts every sample from its neighbours and stores the difference with Huffman codes. There is no quantization, so decoding gives back exactly the encoder's input, and no quality or bit rate setting. Each frame is split into slices that are coded independently, which is what makes encoding and decoding scale over many CPU cores.

The variant of the format is identified by a four-character code (FourCC) that names the color format and, for YUV, the color matrix. Lossless refers to what the encoder receives: a 10-bit source is reduced to 8 bit first, and a 4:2:0 variant drops chroma resolution from a 4:2:2 or 4:4:4 source.

Requirements

ffmpeg, which is part of Hybrid on every system. UT Video is usually stored in AVI, MOV or Matroska; to open the files in editing software outside the ffmpeg world the UT Video codec has to be installed there.

Settings

Control ffmpeg option Range / values Hybrid default Meaning
Prediction -pred left, median left How a sample is predicted before the entropy coding. left uses the sample to the left and is the fastest; median uses the median of left, top and their gradient, which usually gives smaller files and is slower. The picture is identical either way.
Slices -slices 0 – 256 0 Number of slices a frame is split into. 0 leaves the choice to ffmpeg. More slices allow more threads when encoding and decoding and cost a little compression.
Color sampling and matrix -pix_fmt, -colorspace ULH0, ULY0, ULH2, ULY2, ULRG, ULRA ULH0 The UT Video variant to write, named by its FourCC: ULH0 is YUV 4:2:0 with BT.709, ULY0 YUV 4:2:0 with BT.601, ULH2 YUV 4:2:2 with BT.709, ULY2 YUV 4:2:2 with BT.601; ULRG is RGB, ULRA RGB with an alpha channel. Hybrid writes the pixel format (yuv420p, yuv422p, gbrp, gbrap) and, for the BT.709 variants, -colorspace bt709. For ULRG and ULRA the script delivers YUV 4:4:4 and ffmpeg converts it to RGB.
(color sampling, matrix; next to it) – i420, i422, i444; BT.601, BT.709, – i420, BT.709 Display only: the color sampling and the color matrix that belong to the selected variant. Both are always locked.
Interlacing -flags +ildct+ilme on/off off Encode the output as interlaced.
(field order) -vf setfield auto, top field first, bottom field first auto Field order that is flagged in the output. auto takes the scan order of the video that Hybrid feeds to the encoder. Only available with Interlacing on.

The Configuration row at the bottom saves, loads and deletes named sets of these settings.

Example

Prediction left, Slices 0 and the variant ULH0 on a 10-bit YUV 4:2:0 source (640x352, 25 fps); Hybrid converts the video to 8-bit 4:2:0 in the script:

vspipe "encodingTempSynthSkript.vpy" - --outputindex 0 -c y4m --progress | ffmpeg -y -noautorotate -nostdin -threads 8 -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv -f yuv4mpegpipe -i - -an -sn -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv -fps_mode auto -r 25/1 -vcodec utvideo -pred left -slices 0 -pix_fmt yuv420p -colorspace bt709 -metadata encoding_tool="Hybrid 2026.11.22.1" "test.mkv"

With Prediction median, 8 slices and the variant ULY2 the encoder part becomes:

-vcodec utvideo -pred median -slices 8 -pix_fmt yuv422p

How Hybrid calls it

  • The filter script (Vapoursynth or AviSynth) is piped into ffmpeg; without a script ffmpeg reads the source itself.
  • -pred, -slices and -pix_fmt are always written.
  • ffmpeg picks the FourCC from the pixel format and the color matrix: for the BT.709 variants Hybrid writes -colorspace bt709 behind the pixel format, for the BT.601 variants nothing. The matrix of the variant is a label only; Hybrid does not convert the colors to it, so choose the variant that matches the video.
  • With Interlacing on Hybrid adds -flags +ildct+ilme and sets the field order with -vf setfield=tff or setfield=bff. Progressive input is then turned into interlaced video at half the frame rate, see Interlace.
  • The number of ffmpeg threads follows Hybrid's general thread setting.

Sources