0

I'm following

Speeding up playback speed
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video

However, when I speed up my playback speed by 1.5, I'd anticipate a reduce of the video's size on par with/about the same level, yet, this is what I got:

-rwxrwxr-x 1 me me 10000000 2021-10-10 16:56 original_video.mp4*
-rwxrwxr-x 1 me me 10060896 2022-01-02 16:27 speed_up_output.mkv*

I.e., the file size is even bigger.

Is it possible to speed up playback and reduce of the video's size to somewhat same degree?

1 Answer 1

3

Most of the commands mentioned in that link change the playback speed. In order to reduce the number of frames, you do not necessarily need to change playback speed.

The minterpolate filter can reduce the number of frames, but it is a rather lossy process.
You could drop every other frame, but most people notice frame-rates below 24 fps.

Reducing the number of frames will reduce the amount of data. For uncompressed videos, you can expect a linear correlation. This article includes some examples. Please note the graphs are crap as the x-tics are not evenly distributed.

In most end-user scenarios, compressed videos are used. H264 is a wide-spread compressor. It uses differential aka. predicted frames. Dropping frames will interfere with the optical flow detection, making the video harder to compress (provided you want to maintain the same per-frame quality). For this reason, reducing the frame-rate will yield a less-than-linear reduction of file-size. Related: https://superuser.com/questions/283515/video-encoding-how-much-does-the-video-file-size-increase-with-fps

I just tried it using ffmpeg's decimate filter:

ffmpeg -i raw_footage.ts -an -c:v libx264 -crf 21 30fps.mkv
ffmpeg -i 30fps.mkv -filter:v decimate=cycle=2 -c:v libx264 -crf 21 -t 30 15fps.mkv

File-sizes:

  • 30fps.mkv 9,4M
  • 15fps.mkv 8,2M

With a reduced frame-rate, the video is awfully jumpy and hard to look at. Totally butchered, in my opinion. Yet the file-size has only been reduced by 12 %. Not a good deal.

For most use-cases, it is way easier to keep the number of frames and reduce the image quality per-frame.

ffmpeg -i original_video.mp4 -c:v libx264 -crf 31 -c:a aac -b:a 64k -movflags +faststart output.mp4

crf is a quality setting. A higher number means "compress more".

Depending on what you are doing, switching to a higher profile can also help. Reducing the geometric resolution also helps. You may use a better compressor like libx265, if available.

3
  • Thanks for the answer, but I do want to increase playback speed though, that's my #1 goal. The question was how to drop file size accordingly.
    – xpt
    Jan 3, 2022 at 17:40
  • You cannot expect much in terms of file-size reduction. I extended my answer with an explanation.
    – Hermann
    Jan 3, 2022 at 21:33
  • Loud and clear. Thanks!
    – xpt
    Jan 4, 2022 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.