I ran your script. I think it updated here is the output.
[auto_scale_0 @ 0x7f8760007100] [framesync @ 0x7f8760007228] Sync level 1
[graph -1 input from stream 0:0 @ 0x7f8760004f00] video frame properties congruent with link at pts_time: 0
[h264_vaapi @ 0x55ed94bd1940] Using input frames context (format vaapi) with h264_vaapi encoder.
[h264_vaapi @ 0x55ed94bd1940] Input surface format is nv12.
[h264_vaapi @ 0x55ed94bd1940] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x55ed94bd1940] No usable encoding entrypoint found for profile VAProfileH264High (7).
[vost#0:0/h264_vaapi @ 0x55ed94bd4680] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x55ed94bd6fc0] Error sending frames to consumers: Function not implemented
[vf#0:0 @ 0x55ed94bd6fc0] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x55ed94bd6fc0] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_vaapi @ 0x55ed94bd4680] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x55ed94bd4680] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x55ed94bd4680] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x55ed94bd4680] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/wrapped_avframe @ 0x55ed94bd3d40] [dec:wrapped_avframe @ 0x55ed94bd8a00] Decoder returned EOF, finishing
[vist#0:0/wrapped_avframe @ 0x55ed94bd3d40] [dec:wrapped_avframe @ 0x55ed94bd8a00] Terminating thread with return code 0 (success)
[vist#0:0/wrapped_avframe @ 0x55ed94bd3d40] All consumers of this stream are done
[in#0/lavfi @ 0x55ed94bcd700] All consumers are done
[in#0/lavfi @ 0x55ed94bcd700] Terminating thread with return code 0 (success)
[out#0/null @ 0x55ed94bd3f40] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[in#0/lavfi @ 0x55ed94bcd700] Input file #0 (testsrc2=size=1280x720:rate=30):
[in#0/lavfi @ 0x55ed94bcd700] Input stream #0:0 (video): 8 packets read (3520 bytes); 7 frames decoded; 0 decode errors;
[in#0/lavfi @ 0x55ed94bcd700] Total: 8 packets (3520 bytes) demuxed
Conversion failed!
[auto_scale_0 @ 0x7f3988007100] [framesync @ 0x7f3988007228] Sync level 1
[graph -1 input from stream 0:0 @ 0x7f3988004f00] video frame properties congruent with link at pts_time: 0
[h264_vaapi @ 0x55d595c01980] Using input frames context (format vaapi) with h264_vaapi encoder.
[h264_vaapi @ 0x55d595c01980] Input surface format is nv12.
[h264_vaapi @ 0x55d595c01980] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x55d595c01980] No usable encoding entrypoint found for profile VAProfileH264High (7).
[vost#0:0/h264_vaapi @ 0x55d595c04400] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x55d595c06d40] Error sending frames to consumers: Function not implemented
[vf#0:0 @ 0x55d595c06d40] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x55d595c06d40] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_vaapi @ 0x55d595c04400] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x55d595c04400] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x55d595c04400] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x55d595c04400] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/wrapped_avframe @ 0x55d595c03ac0] [dec:wrapped_avframe @ 0x55d595c08640] Decoder returned EOF, finishing
[vist#0:0/wrapped_avframe @ 0x55d595c03ac0] [dec:wrapped_avframe @ 0x55d595c08640] Terminating thread with return code 0 (success)
[vist#0:0/wrapped_avframe @ 0x55d595c03ac0] All consumers of this stream are done
[in#0/lavfi @ 0x55d595b91d00] All consumers are done
[in#0/lavfi @ 0x55d595b91d00] Terminating thread with return code 0 (success)
[out#0/null @ 0x55d595c03cc0] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[in#0/lavfi @ 0x55d595b91d00] Input file #0 (testsrc2=size=1280x720:rate=30):
[in#0/lavfi @ 0x55d595b91d00] Input stream #0:0 (video): 8 packets read (3520 bytes); 7 frames decoded; 0 decode errors;
[in#0/lavfi @ 0x55d595b91d00] Total: 8 packets (3520 bytes) demuxed
Conversion failed!
[AVHWDeviceContext @ 0x563d44890f00] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x563d44890f00] libva: User environment variable requested driver 'i965'
[AVHWDeviceContext @ 0x563d44890f00] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x563d44890f00] libva: Found init function __vaDriverInit_1_22
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
i915 does not support EXECBUFER2
[AVHWDeviceContext @ 0x563d44890f00] libva: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
[AVHWDeviceContext @ 0x563d44890f00] libva: va_openDriver() returns -1
[AVHWDeviceContext @ 0x563d44890f00] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Input/output error
Error parsing global options: Input/output error
Trying display: drm
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 25.2.3 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointEncSlice
VAProfileVP9Profile1 : VAEntrypointVLD
VAProfileVP9Profile1 : VAEntrypointEncSlice
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointEncSlice
VAProfileVP9Profile3 : VAEntrypointVLD
VAProfileVP9Profile3 : VAEntrypointEncSlice
VAProfileHEVCMain12 : VAEntrypointVLD
VAProfileHEVCMain422_10 : VAEntrypointVLD
VAProfileHEVCMain422_12 : VAEntrypointVLD
VAProfileHEVCMain444 : VAEntrypointVLD
VAProfileHEVCMain444_10 : VAEntrypointVLD
VAProfileHEVCMain444_12 : VAEntrypointVLD
VAProfileHEVCSccMain : VAEntrypointVLD
VAProfileHEVCSccMain10 : VAEntrypointVLD
VAProfileHEVCSccMain444 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileHEVCSccMain444_10 : VAEntrypointVLD
VAProfileVVCMain10 : VAEntrypointVLD
VAProfileVVCMultilayerMain10 : VAEntrypointVLD
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0





