3

I made a music video with a still image (input.jpg ≈ 1 MB) and a music (input.wav ≈ 20 MB) using FFmpeg. Why do I get such a huge difference in file size between the video generated with the lossless HEVC codec (output.mkv ≈ 70 MB) and that generated with the FFV1 codec (output.mkv ≈ 10 GB)?

The issued commands

  • for lossless HEVC:
ffmpeg -loop 1 -i input.jpg -i input.wav \
       -c:v hevc -crf 0 -c:a flac -s 3840x2160 -r 60 -shortest output.mkv
  • for FFV1:
ffmpeg -loop 1 -i input.jpg -i input.wav \
       -c:v ffv1 -c:a flac -s 3840x2160 -r 60 -shortest output.mkv

It looks like either the provided parameters for lossless HEVC are incorrect (in the sense not really lossless) or FFV1 is a terrible codec.

1 Answers1

6

FFV1 is intra-coded so each frame is compressed independently of other frames; HEVC is typically inter-coded.

Assuming you're using libx265, you have to add -x265-params lossless=1 for true lossless mode (-crf 0 isn't). At the end of encoding, x265 should print a line displaying lossless compression ratio.

x265 has better intra-prediction than x264 and I expect, FFV1, so lossless compression is more efficient. But it takes more resources to decode.

Gyan
  • 38,955