0

I have a 24 fps video. First, I split it into frames:

ffmpeg -i input.mp4 frame%06d.png

Secondly, I joined these frames, and compressed the result in another command:

ffmpeg -r 24 -i frame%06d.png -c:v libx264rgb -crf 0 -preset ultrafast all.mp4
ffmpeg -i all.mp4 -c:v libx264 -pix_fmt yuv420p -crf 27 -preset veryslow allcompressed.mp4

Thirdly, I deleted every second frame (the ones with an even digit at the end), and renamed them so that they have continuous numbers.

Finally, I joined and compressed them with the previous commands but with 12 fps:

ffmpeg -r 12 -i frame%06d.png -c:v libx264rgb -crf 0 -preset ultrafast odds.mp4
ffmpeg -i odds.mp4 -c:v libx264 -pix_fmt yuv420p -crf 27 -preset veryslow oddscompressed.mp4

What I don't understand, is that allcompressed.mp4 is 296 741 kB and oddscompressed.mp4 is 322 369 kB. How is this possible? I did not expect to get half of the original size but getting a bigger file from less information is surprising.

Another anomaly:

Earlier (before deleting every second .png), I set the fps - wrongly - to 10: ffmpeg -r 10 -i frame%06d.png -c:v libx264rgb -crf 0 -preset ultrafast all10.mp4 ffmpeg -i all.mp4 -c:v libx264 -pix_fmt yuv420p -crf 27 -preset veryslow allcompressed10.mp4

I thought that allcompressed10.mp4 and allcompressed.mp4 should be of about the same size because they contain the same number of frames. However, the latter is 296 741 kB, while the former is 758 740 kB (now mistake, it is 2.5 times larger)

How is this possible?

3
  • 1
    See stackoverflow.com/q/49620592
    – Gyan
    Jun 8, 2021 at 11:08
  • @Gyan I think it answers the second anomaly. Regarding the first one, I still don't see why it is so, however, learning from the second, I think I should not really make assumptions on file sizes.
    – z32a7ul
    Jun 10, 2021 at 20:07
  • 1
    With half the frames and half the framerate, it's still the same thing. Less compression per existing frame.
    – Gyan
    Jun 11, 2021 at 4:19

0

You must log in to answer this question.

Browse other questions tagged .