0

I render 3D animations, many of which take days or even weeks to render at a time, and I need to keep a lossless archive of the output files. The output format from the render engine is 8 bit per channel (24 bit) PNG sequences, which are then modified heavily in After Effects to create a final composite.

I would like to find a way to compress these PNG sequences without losing any quality. Because there are many pixelwise operations happening in After Effects to the original source PNG files, it is imperative that I find a way to preserve the animations truly losslessly. Near lossless is not acceptable for this use case.

I have tested several codecs in ffmpeg, and so far, libx265 and libx264rgb seem to trade blows. Here is a table showing the filesize in GB I get when compressing losslessly using various codecs in ffmpeg (each column) for a variety of different animations I have made (each row):

enter image description here

I think both of these codecs have been around for a while, so I was wondering if anything else has come out recently that could get the file sizes down a lot more? Or are libx265 and libx264rgb the pinnacle of true lossless compression?

In case it is relevant, these were the commands I used to compress for each codec:

cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v huffyuv -lossless 1 "huffyuv_lossless/{name}"'

  cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v ffvhuff -context 1 "ffvhuff_lossless/{name}"'

  cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v utvideo "utvideo_lossless/{name}"'

  cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v ffv1 -preset slow -qp 0 "ffv1_lossless/{name}"'

  cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v libx265 -x265-params lossless=1 "libx265_lossless/{name}"'

  cmd = f'ffmpeg -ss 0 -i "{unc}" -t {tt} -y -c:v libx264rgb -preset slow -crf 0 "libx264rgb_lossless/{name}"
2
  • vp9 and av1 can both do lossless, though, depending on what you read, the tradeoff may be the speed at which they perform, particularly av1 is supposed to be significantly slower, but perhaps modern GPU with AV1 hardware acceleration mitigates this disparity.
    – Bravo
    Commented Sep 28, 2023 at 1:30
  • Have you considered lagarith?
    – Kevin Hua
    Commented May 5 at 2:35

0

You must log in to answer this question.

Browse other questions tagged .