I'm trying to compress my content while preserving quality. I'm measuring the quality using Netflix's VMAF.

Only focusing on HEVC and tried different parameters available for libx265 such as crf, two pass encoding, preset, tune. Not all of these together for example crf doesn't go with two pass encoding.

Now the same video was shared with a third party content management service(or vendor) and somehow they have created a video that has only 1 i_frame per 5 seconds and remaining frames are b_frames.

For similar VMAF, this results in their file size being almost half of what I have generated using different params.

I looked into forcing the same split of i_frames and b_frames but am running into error.

FFMPEG command I used, something could be horribly wrong though -

ffmpeg -i original.mp4 -c:a copy -c:v libx265 -g 248 -keyint_min 248 -x265-params "keyint=248:bframes=247:no-scenecut=1:no-open-gop=1" -crf 20 -preset faster -tag:v hvc1 del.mp4


[libx265 @ 0x123e07b10] Cannot open libx265 encoder.
[vost#0:0/libx265 @ 0x123e07840] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Can someone please help me with the correct way to force a single i_frame every x seconds and remaining all frames be b_frames?

  • I see no option in x265 for this. Your vendor is using a proprietary or custom encoder.
    – Gyan
    Aug 3, 2023 at 6:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.