Why does the video size become smaller after ffmpeg cuts it?

1. Background

A 1080 * 1920 video was recorded using a mobile phone. The size is 345 MB and the duration is 3 minutes and 50 seconds.
Directly copy it to the mac and use ffmpeg (re-encoding) to cut off the last 5 seconds and get a video of 3 minutes and 45 seconds, but the size is 78 MB (resolution remains unchanged). And to the naked eye, there is no loss of image quality.
The command for cutting video with ffmpeg is as follows:

 ffmpeg -i input.mp4 -ss 00:00:10 -t 00:00:20 -y output.mp4

Two, the problem

Why does the size become so much smaller by just removing 5 seconds?

3. Reasons

To put it simply: the mobile phone hardware encoding effect is too poor + ffmpeg re-encoded

  1. The mobile phone performs hardware coding, which has the advantage of being computationally resource-friendly and does not require a high CPU computing load. The disadvantage is that the encoding effect is very poor - the simple manifestation is that the video size is relatively large (the specific soft encoding and hard encoding can be queried by yourself)
  2. Because I re-encoded when using ffmpeg video cutting (in order to perfectly align the sound and picture), ffmpeg used its own best software encoding algorithm, and thus obtained a good compression volume. It is certain that when encoding, the CPU load of my M1 pro reached 90%. It can be seen that this CPU pressure is completely unacceptable for mobile terminals.

Guess you like

Origin blog.csdn.net/qq_29007291/article/details/126630708