Recommended Lossless Codec


I have been experimenting with lossless codecs, yet I don’t know which codec/preset I should use.
input files: lossy, bt.709, 4:2:0, 8bit, 1080p60/30fps, 720p60/30fps .mp4(avc)

  • I want to push YouTube lossless (the best possible) video to maximize quality, without glitches
  • Short encoding time
  • File size doesn’t matter
  • Possibly SDR output(?)

Which interpolation (nearest/bilin/bic/hyper) method to use?
Which codec or Shotcut preset is recommended for my use case?

Bicubic if the source videos will be shrunk down to fit within the output resolution.

Lanczos if the source videos will be scaled up (made larger) to fit the output resolution.

If there is a mixture, bicubic is the overall safest option since Lanczos can produce halos/ringing on certain sharp or high-contrast lines. If the source videos are low quality, grainy, mushy, or otherwise not full of razor sharp edges, then Lanczos won’t have side effects and will probably produce better results.

1 Like

So basically Bicubic if it’s scaled down, Lanczos is it’s scaled up and Bicubic if it’s mixed?

So what if there is no scaling up or down then it’s Bilinear? Or can Bicubic be used instead of Bilinear as a general default?

By the way, these interpolation options have an effect with lossless codecs like Ut Video and HuffYUV? I thought when it came to lossless codecs those fields wouldn’t matter. I guess I misunderstood that.

Interpolation happens any time that video is scaled, and probably also when rotated.

When 4K video is dropped onto a 1080 timeline, there is an implicit down-scale from 4K to 1080 that would refer to the interpolation settings. The same is true for an SD 576 video dropped onto a 1080 timeline… there is an implicit up-scale to make the video fill the screen. An explicit up- or down-scale would result from the Size, Position, & Rotate filter (among others), and the filter would in theory refer to the interpolation setting to see what method to use. (This statement is theoretical because there was a recent change that caused the SPR filter to run slower, which could possibly mean interpolation for SPR is always done with a higher-quality method. I haven’t checked source lately to see how it works now.) Lastly, if 1080 video is dropped onto a 1080 timeline, no resize takes place at all and the interpolation setting is not needed.

A lossless codec means that the final output frame from the timeline will be perfectly preserved. However, interpolation happens before that point, as a part of the process that constructs an output frame in the first place. There isn’t a lossless way to drop 4K video onto a 1080 timeline because some data must be removed to fit. Interpolation determines how data is removed (or created if up-scaling), and then a lossless codec perfectly preserves the 1080 result.

Bilinear looks significantly worse than bicubic, but it’s a little faster to process. This is useful to make a quick preview or draft export to check filter settings. It is also useful as the display preview interpolation method because it’s faster than bicubic for real-time preview, and looks way better than nearest neighbor. But I can’t think of any case where I would want to use bilinear for the final export.

Nearest neighbor is useful when 4:2:0 needs a lossless up-scale to 4:2:2. But this is a pretty niche use.

For all of my personal use cases, this is true. The export default has also been changed to Bicubic as of the current beta release. I noticed a line about it in the release notes.

1 Like

Thanks for the answer! I think I will choose ut video, which produces 4:2:2 results. What do you think, should I change pix_fmt=yuv422p to pix_fmt=yuv420p or just upload 4:2:2 to YouTube?

4:2:2 improves nothing in this situation. The sources are not 4:2:2 and YouTube playback is not 4:2:2. Also, libx264 lossless ultrafast is both faster to export and radically smaller in file size. It can also do 4:2:2 if absolutely required by adding pix_fmt=yuv422p to the Export > Other box. If you are attempting to post video daily, small file size is a big deal for its ability to re-upload quickly if something goes wrong with the first attempt. There isn’t a single reason to use Ut Video in this instance. And I say this as a Ut Video fanboy.

This topic was automatically closed after 90 days. New replies are no longer allowed.