X265 doesn’t honor keyframe interval defined by chp file

Issue #293 resolved
Former user created an issue

X265 doesn’t honor keyframe interval defined by chp file during analysis or pass 1 My command line look like this

"D:\BD-RB\BD-RBV05018\tools\avs2yuv.exe" "E:\BD-RB\WORKFILES\VID_00001.AVS" -o - | "D:\BD-RB\BD-RBV05018\tools\x265-64.exe" - --preset superfast --qpfile "E:\BD-RB\WORKFILES\VID_00001.CHP" --keyint 240 --bitrate 4991 --y4m --no-info --colorprim bt709 --colorprim bt709 --colormatrix bt709 --sar 1:1 --stats "E:\BD-RB\WORKFILES\VID_00001.AVS.hevc.stats" --pass 2 --output "E:\BD-RB\WORKFILES\VID_00001.AVS.hevc"

When doing second pass encoder print error message that I frame inserted even though two pass stats says B X265

I was thinking we add code so encoder will take into account where keyframe is and always mark them I or keyframe.

Comments (18)

  1. Divya Manivannan

    The slicetype decided in the 1st pass will be reused in the 2nd pass. So, the slicetype from the stats file and qpfile may be conflicting in pass 2. You can try qpfile with pass 1 so that you will get the same type in pass 2.

  2. H0W1K2

    Hello, I specify qpfile for both pass 1 and 2. Output is shown from pass 2, that is when encoder prints error message, In pass 1 it doesn't print error message.

    I am gonna try 3 pass options and see if it any different.

  3. H0W1K2

    Update

    Ok so I re did Man of Steel all over again, this time I did three pass.

    In all cases my command line options are , except which control pass option.

    "D:\BD-RB\BD-RBV05018\tools\avs2yuv.exe" "E:\BD-RB\WORKFILES\VID_00001.AVS" -o - | "D:\BD-RB\BD-RBV05018\tools\x265-64.exe" - --preset superfast --qpfile "E:\BD-RB\WORKFILES\VID_00001.CHP" --keyint 240 --bitrate 4610 --y4m --no-info --colorprim bt709 --colorprim bt709 --colormatrix bt709 --sar 1:1 --stats "E:\BD-RB\WORKFILES\VID_00001.AVS.hevc.stats" --pass 1 --output "E:\BD-RB\WORKFILES\VID_00001.AVS.hevc"

    First Pass

    No problem encoder create stats file and cutree file and all is well.

    X265_pass_1.PNG

    Second Pass (Encoder Pass 3)

    I get three separate instance where it prints message (Screenshot below) though encoder finish encoding

    “x265 [Warning]: specified frame type <5> at 70672 is not compatible with keyframe interval” X265 [error]: Slice=I but 2pass stats says B

    “x265 [Warning]: specified frame type <5> at 111884 is not compatible with keyframe interval” X265 [error]: Slice=I but 2pass stats says B

    “x265 [Warning]: specified frame type <5> at 187557 is not compatible with keyframe interval” X265 [error]: Slice=I but 2pass stats says B X265_pass_3.PNG

    Last Pass (Encoder Pass 2)

    Get error message and encoder abort (Screenshot Below)

    X265 [error] CU-tree frametype 0 doesn’t match actual frame type 2.

    Aborted at input frame 70674, output frame 70655 (input frame is two frame after where encoder warn about not compatible with keyframe interval)

    X265_pass_2.PNG

  4. Divya Manivannan

    Tested multi-pass with qpfile, its working. We are unable to reproduce the above issue. Can you please share the input?

  5. H0W1K2

    Divya,

    It's man of steel which is causing issue, I also tested Captain America Civil War and it also does same. If I do World War Z it doesn't. so basically it is hit and miss for some movies. As for share I will send you PM with Link which contain iso image.

  6. H0W1K2

    Thank you, unfortunately I am not sure how I would go about handling patch. Is it possible to get it compiled for 10 bit windows, if not can you push out to commits I will get it with automated build.

  7. Log in to comment