ffmpeg - two videos having same video length but different file size I'm new to this compression thing. I use following command with the latest ffmpeg version to compress and downscale my 1080p videos.

ffmpeg -i input.mkv -af "aresample=async=1:first_pts=0" -c:v libx264 -crf 18 -preset medium -b:v 3000k -maxrate 3000k -bufsize 10000k -acodec aac -c:s copy -map 0 -vf scale=1280:-2 output.mkv


what i don't understand, two videos having same duration, only one audio stream. after compression one has filesize 2GB while other 5GB. Why so much difference?
The -b:v doesn't have effect here since crf was set. Drop crf for similar sizes. CRF varies the bitrate to do justice to the complexity of the video. It aims for keeping quality constant.

Whether it's bitrate or CRF mode, the maxrate and bufsize do take effect.