3

I have a thirty seconds 1080p video file that was rendered from Premiere Pro/Media Encoder (target Bitrate 10) and is encoded in H.265. It has 36.6 MB. When i run the command

ffmpeg -i input -c:v libx265 -c:a copy output.mp4

the new file only hast 5.04 MB. mediainfo reveals that the new file has a Bitrate of only 1164 kb/s. Even though one is vastly smaller than the other, both videos look identical (both have a VMAF score above 97 when compared to the uncompressed version).

Does the libx265 smartly choose Bit rate and thus makes the video size that much smaller?

2 Answers2

2

You will have lost data in re-encoding irrespective of perceptual "quality". That is one of the places that the reduction in size has come from. Minor or imperceptible detail will be lost or approximated using algorithms of the compressor.

The major difference though is going to be in the fact that Adobe and ffmpeg have different default quality and bandwidth settings. That "VMAF score" looks similar just tells you that a human probably won't see a difference, not how much data has been lost.

ffmpeg will decode frames and reencode them using whatever its default settings are. Chances are the defaults are aggressive and according to https://trac.ffmpeg.org/wiki/Encode/H.265 it will default to medium quality profile.

The default is medium. The preset determines compression efficiency and therefore affects encoding speed. Valid presets are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo. Use the slowest preset you have patience for. Ignore placebo as it provides insignificant returns for a significant increase in encoding time.

Slower compression settings will more faithfully preserve the true original quality at the cost of higher file sizes and compression time.

ffmpeg also defaults to a CRF of 28 which will be quite high relative compression

Choose a CRF. CRF affects the quality. The default is 28, and it should visually correspond to libx264 video at CRF 23

It is even possible that ffmpeg has some more advanced compression features enabled by default. Adobe may eschew some encoding approximation features in favour of higher bitrates in order to reduce rendering time, or to preserve quality or other features. It is difficult to know without knowing exactly what settings are in use.

If you want to have a fair comparison between Adobe and ffmpeg outputs then you should render to an uncompressed format, find out exactly what settings Adobe is using and then compress that uncompressed file in both.

Recompressing an already compressed file (decoding and reencoding) will result in generation loss which, while it may not look significant on only one pass, will lose data and quality. After several passes the loss will be significant.

Mokubai
  • 95,412
1

VMAF is not a good metric at all for very high quality encodes. Even comparing mathematically identical content can sometimes give you vmaf scores as low as around 97.4, while not even vmaf 100 guarantees visual transparency.

Which means VMAF scores tell you almost nothing about the quality of these specific encodes.

At the time, the best visual metric suitable for near transparency video would be a still-image metric like Butteraugli or SSIMULACRA.

damian101
  • 103