I have downloaded a TikTok reel video and I want to reduce its file size. I have seen people doing it with the help of FFmpeg. But when I try to do it, FFmpeg increases my video file size. I am using the following FFmpeg command.
ffmpeg -i tiktok.mp4 -c:v libx264 -c:a copy -f mp4 tiktok_out.mp4
Well, there are a lot of things that can affect file size while transcoding a video such as a Video codec, target bitrate, and rate control methods that are most effective on output file size.
It seems that you have chosen H.264 as your output video codec.
When you try to transcode a video using the command you’ve mentioned, FFmpeg assumes CRF (constant rate factor) as the rate control method, it acts as setting the target visual quality. It can be set with the -crf
option with values ranging from 0 to 51, a lower number means better video quality and higher file size.
-
Modifications to compression or codec settings
The file size may grow when transcoding a movie, particularly if you’re altering the codec or compression parameters. This is because the efficiency of various codecs and compression settings varies. For instance, a more sophisticated codec might result in higher video quality, but the file size would increase. -
Bitrate parameters
The process of transcoding frequently entails establishing the video’s target bitrate. The file size will increase if the bitrate is higher than it was for the original video. The amount of compression used on the video is mostly determined by its bitrate; greater bitrates typically equate to less compression and larger file sizes. -
Changes in frame rate and resolution
A video’s file size may change when its resolution or frame rate is changed during transcoding. A higher file size will usually come from increasing the resolution or frame rate, although a smaller file size can be obtained by decreasing either. -
Error-free transcoding
A video’s file size may rise dramatically if lossless compression is used during transcoding. Lossless compression results in a bigger file size but preserves all of the original video quality. It is imperative to give considerable thought to whether lossless compression is required in your particular use case.
Do let me know if you have more questions on that topic.
Thank you
I see you haven’t specified -crf option in your FFmpeg command so by default it assumes 23 as your CRF value which is fair given the quality and size trade-off.
But this CRF value does not apply the same to all videos, some videos require a very low bitrate to achieve decent video quality and when you transcode these types of video with the CRF rate control method, the encoded becomes very generous and assigns a very high bitrate to it which makes your output file larger.
Which rate control method is best for transcoding small reels like videos?
Since reels are user-generated content, you will never be able to determine what kind of bitrate should be enough for a particular video. In this kind of scenario, the 2-Pass VBR rate control method would be best because it comprises two steps, in the first step, it determines how much bitrate is needed for each individual video frame by analyzing the information content of the frame, and in the second pass, it performs actual encoding process. For videos smaller in duration (up to 60 seconds), this rate control method is well worth given the very good compression ratio provided by it.