Joan Venge
Joan Venge

Reputation: 330872

How to compress h265 video using ffmpeg h265?

I am using my camera app to record some videos. Before they only had h264 option so the file sizes very huge like 10GB for 1hour for standard smartphone camera quality. I was using ffmpeg to compress them and they would reduce to about 150-200MB while looking the same.

Now they added an h265 option so I used that to record in the first place. Now these files might be a bit smaller but they are still quite large like 5GB. So naturally I tried ffmpeg on these videos but not only they are much slower to compress i.e. 0.3x speed, but also the file size is maybe reduced by 5%.

So not sure what I have to do to get these new h265 videos just like the ones I encoded before using ffmpeg so that their size would be about 150-200MB.

Is it because ffmpeg can not efficiently compress h265 using h265 coded?

Upvotes: 0

Views: 4527

Answers (1)

llogan
llogan

Reputation: 133703

Not all formats are equal

H.265 is a newer generation format than H.264, and in ideal situations H.265 can provide significant file size savings (but it can be much slower to encode).

So it may be unfair and unrealistic to compare H.264 to H.265.

Not all encoders are equal

Some encoders are crap no matter the format. Your H.264 input may have been created by a hardware encoder which sacrifices quality-per-bit for encoding speed. These are inefficient encoders.

So if you take a H.264 input that was made from an inefficient encoder, then re-encode it using an efficient H.265 encoder you may see significant file savings despite compression unfriendly encoding artifacts present in the source.

Your H.265 input was created by ffmpeg

As shown in your console output: encoder: Lavf58.34.101, which is the libavformat library version. This library is responsible for muxing the file.

I'm not sure which encoder was used, but it could indicate that x265–an efficient encoder–could have been used. The output from mediainfo may indicate the actual encoder.

So if that is the case, and you re-encode it, you may not see much of a difference other than generation loss.

Upvotes: 2

Related Questions