2

My goal is to reduce the overall file size of a video without quality loss. The source video is at 30fps with keyframes every 90 frames. For our purposes we only need the video to be at 3fps and keyframes every 300 frames my assumption is transcoding the video to this will reduce the overall video size.

This ffmpeg command re-encodes the source video to out.mp4

ffmpeg -i in.mp4 -vcodec libx264 out.mp4

This command reduces the fps and increases the GOP.

ffmpeg -i in.mp4 -vcodec libx264 -x264-params keyint=300:scenecut=0 fps=fps=3 out.mp4

My question is why does the output from both commands result in the same video size?

Gcoop
  • 121

1 Answers1

0

This answer and the linked, detailed answer finally pointed me in the right direction: for me, reducing FPS didn't do much if I didn't also tweak the bitrate (or, similarly, the constant rate factor).

Increasing the CRF decreases the quality. A value of 28 is on the lower end quality-wise for x264:

ffmpeg -i in.mp4 -c:v libx264 -crf 28 -vcodec libx264 -x264-params keyint=300:scenecut=0 -filter:v fps=fps=3 out.mp4

Similarly, you can specify the target bitrate:

ffmpeg -i in.mp4 -b:v 450k -vcodec libx264 -x264-params keyint=300:scenecut=0 -filter:v fps=fps=3 out.mp4

Both of these methods led to a >2x decrease in file size.

webelo
  • 101