Transcode Video to Lossless UT Video MKV using FFmpeg
This article provides a straightforward guide on how to transcode video files into the lossless UT Video codec wrapped in an MKV container using FFmpeg. You will learn the exact command-line syntax required, the explanation of the parameters, and how to handle audio to ensure a completely lossless conversion process.
To transcode a video to the UT Video codec inside a Matroska (.mkv) container, run the following basic FFmpeg command in your terminal:
ffmpeg -i input.mp4 -c:v utvideo -c:a copy output.mkvCommand Breakdown
-i input.mp4: Specifies the path to your source video file.-c:v utvideo: Selects the UT Video encoder for the video stream. This is a highly efficient, mathematically lossless codec.-c:a copy: Copies the stream of the source audio without re-encoding it. If you want completely lossless audio as well, you can transcode the audio to FLAC or PCM by using-c:a flacor-c:a pcm_s16le.output.mkv: Defines the output file name. The.mkvextension tells FFmpeg to use the Matroska container, which natively supports the UT Video codec.
Controlling Pixel Formats (Optional)
UT Video supports various color spaces. By default, FFmpeg will try
to match the source’s pixel format. However, you can explicitly define
the output pixel format using the -pix_fmt flag:
For YUV 4:2:0 (Standard HD/SDR):
ffmpeg -i input.mp4 -c:v utvideo -pix_fmt yuv420p -c:a copy output.mkvFor YUV 4:2:2 (High Quality):
ffmpeg -i input.mp4 -c:v utvideo -pix_fmt yuv422p -c:a copy output.mkvFor RGB (Maximum archive quality, no color compression):
ffmpeg -i input.mp4 -c:v utvideo -pix_fmt gbrp -c:a copy output.mkv
Using these commands ensures your video is preserved in a visually and mathematically lossless state, making it ideal for archiving or intermediate editing workflows.