+ /* the encoder has to be flushed before it can be closed */
+ if (ctx->nvenc_ctx) {
+ NV_ENC_PIC_PARAMS params = { .version = NV_ENC_PIC_PARAMS_VER,
+ .encodePicFlags = NV_ENC_PIC_FLAG_EOS };
+
+ nv->nvEncEncodePicture(ctx->nvenc_ctx, ¶ms);
+ }
+