[FFmpeg-user] setpts filter produces much smaller files

George Welch george at grwelch.com
Mon May 19 05:00:49 EEST 2025


Howdy ffmpeg users.

I have found a behavior that seems strange to me.  The following two commands:

$ ffmpeg -i input.mkv -an -c:v libx265 -preset slow -crf 21 output1.mkv

and

$ ffmpeg -i input.mkv -an -c:v libx265 -preset slow -crf 21 -vf "setpts=PTS-STARTPTS" output2.mkv

produce output files that are very different.  The input file is 1080p h264 recorded at 15Mbps.  The output file in the first case is about 1.66 times larger than the second output file.  The video channel in the first case averages 7342 kbps while the video channel in the second case averages 4423 kbps.

Unsurprisingly, dumping frames to png files and using imagemagick to compare them shows that the first output file has much higher fidelity to the original than the second.

This is with ffmpeg 7.1.1 installed via homebrew on a fairly modern macbook pro.  Checking on a linux machine with a fairly old intel xeon processor (all I have access to) also with ffmpeg installed via homebrew produces nearly identical files.

I wonder if this a bug in the mac version of ffmpeg?  I don't see why the setpts filter should produce a much lower bitrate, nor why it would be different under linux.

Thank you for your time.


More information about the ffmpeg-user mailing list