Archiving videos with lossless codecs

Hi,

I’d like to archive my timelapse videos with a lossless codec. Those videos are generated from 16 bit TIFs which are darktable export files. I’ve tried various Codecs (HUFFYUV, FFV1, H264 and H265), but I’m confused about the output and whether I’m doing it right or wrong.

I’ve generated a bunch of video files from the same source in order to compare the output size. I did not care about the encoding time.

$ du -csh *.tif | grep total
43G     total

11G	output_ffv1_lossless_from_huffyuv_ffmpeg_422.mkv
36G	output_ffv1_lossless_from_tif_ffmpeg_422.mkv
13G	output_huffyuv_lossless_from_tif_ffmpeg_422.mkv
8,2G	output_libx264_lossless_from_huffyuv_ffmpeg_422.mkv
6,5G	output_libx264_lossless_from_tif_ffmpeg_422.mkv
12G	output_libx265_lossless_from_huffyuv_ffmpeg_422.mkv
27G	output_libx265_lossless_from_tif_ffmpeg_422.mkv

The files which have from_tif in them were generated with
ffmpeg -f image2 -i '*.tif' ...
The files which have from_huffyuv in them were generated with
ffmpeg -i output_huffyuv_lossless_from_tif_ffmpeg_422.mkv ...

The options for H264 were -crf 0. For H265 I used -x265-params lossless=0.

So, first I generated all video files with the original TIF files as source, then I used the lossless HUFFYUV file as source.

Why are the output files smaller when I use the huffyuv for input (except H264)? Am I missing something? Is information lost?

And why are the H265 files so much larger than the H264 files?

Given that H264 from TIF is about half the size than the HUFFYUV, is it really lossless?

Questions over questions, I hope someone can help me out!

Thank you and cheers,

Jochen

ffprobe output for all the mkv’s:

output_libx265_lossless_from_tif_ffmpeg_422_ffprobe.txt (2.1 KB) output_libx265_lossless_from_huffyuv_ffmpeg_422_ffprobe.txt (2.1 KB) output_libx264_lossless_from_tif_ffmpeg_422_ffprobe.txt (2.1 KB) output_libx264_lossless_from_huffyuv_ffmpeg_422_ffprobe.txt (2.2 KB) output_huffyuv_lossless_from_tif_ffmpeg_422_ffprobe.txt (2.1 KB) output_ffv1_lossless_from_tif_ffmpeg_422_ffprobe.txt (2.1 KB) output_ffv1_lossless_from_huffyuv_ffmpeg_422_ffprobe.txt (2.1 KB)

You may also want to try VP9. It’ll test your theory that you “don’t care” about encoding times. The output is supposed to be nice though.

Well, it encoded my sample video in under 1 hour, so that’s ok for me. :slight_smile:

Output size is something around 12G, so pretty good.

However, this is an interesting answer:

Apparently there’s the libx264 and the libx264rgb encoder. libx264 does not support bgr transcoding, so there’s something missing.