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.
-g 1since FFmpeg 4.3, and with-x265-params keyint=1before FFmpeg 4.3; b)-crf 0has no effect with-x265-params lossless=1so should not be used. That will make your answer even more awesome. – Géry Ogam Mar 03 '20 at 14:05bis already covered, andais not directly relevant to the Q as asked. – Gyan Mar 03 '20 at 14:07-crf 0has no effect when combined with-x265-params lossless=1. So I have been wondering if I should keep it or not (for you it might be obvious since you are an FFmpeg maintainer, but me I am a new FFmpeg user, like most future readers of this post). In addition, with the H.264 codec,-crf 0does mean true lossless mode (cf. this answer), which is very confusing, so a little explanation would not harm. – Géry Ogam Mar 03 '20 at 14:25