vtenc: randomly stops on encode H264
I use gstreamer 1.22.1, macOS Ventura, Xcode 14.3 and regular MacBook Air with M1 CPU. I have the next pipeline:
avfvideosrc do-timestamp=1 capture-screen=1 ! "video/x-raw, framerate=(fraction)60/1" ! videoconvertscale ! "video/x-raw, width=1440, height=900" ! vtenc_h264_hw allow-frame-reordering=0 max-keyframe-interval=60 quality=1.0 bitrate=4096 realtime=1 ! "video/x-h264, profile=(string)main" ! h264parse ! "video/x-h264, stream-format=(string)byte-stream, aligment=(string)nal" ! queue ! appsink
I have 1440x900 display resolution, but macOS has double (2880x1800) frame buffer on not native display resolutions and I have to decrease it with scaler. After start the pipeline it works 2-5 minutes and stops with the next message:
Encoding error., debugging information: ../sys/applemedia/vtenc.c(1861): gst_vtenc_enqueue_buffer (): /GstPipeline:pipeline/vtenc_h264_hw:video_encoder:
Failed to encode frame 276: -12912'
This issue is not so easy to reproduce. I saw it 1-2 times.