There's quite a bit of info about using ffmpeg (more) to encode with x265: HEVC. However, when I try to encode my video from x264 to x265 with scaling to reduce overall bit rate in order to save even more space on my hard drive, I am still missing the Frame Rate Mode option. Currently, my video after encoding has changed to CFR whereas it was originally VFR. The command is

ffmpeg -i input -vsync 2 -vf scale=1280:-1 -c:v hevc_nvenc -preset:v slow -crf 24 -rc vbr_hq -qscale:a 1

The output is OK, but I'm curious about the frame rate mode. Do you have any idea to output VBR with x265?

I am also curious about the information in this file, for I can understand some of the details, but not others.

Files info from MediaInfo x264 and x265.

Some other information Rate-control, x265, Encode H.265 Super User Super User encode x264

  • Run ffmpeg -i in -vf vfrdet -an -f null - on both files. I suspect a handful of frames had their duration regularized. – Gyan Nov 6 '18 at 16:22
  • Hi @Gyan, I am not sure understand well what you mean. So I call the command as you suggest %ffmpeg% -i %input720% -vf vfrdet -an -f null - and here is the result x264 output , x265_720output – seal2002 Nov 7 '18 at 14:45
  • I'll post an answer in a while - this has nothing to do with the encoder. – Gyan Nov 7 '18 at 15:03

The input is 23.976 fps, exactly represented as 24000/1001. So each frame ideally should be 1001/24000 seconds long. But the input has a timescale of 90k (90000), and in that timescale the ideal duration requires 3753.75 ticks, which isn't possible, as timestamps are integers. So, what your input does is assign half the frames 3753 and the other half 3754. This makes it "VFR". The output has a timescale of 24000 in which the ideal duration can be exactly represented by 1001 ticks.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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