Live stream problem in version 5.2.1

After the update to version 5.2.1, I have problems with live streaming with the option: This is a permanent/recurring live.
When I stop the live stream and want to start it again, on peertube the stream doesn’t stop, but only plays for the last minute.
Until I do systemctl restart peertube I can’t start the live stream again.

In the logs I see this:

error[06/10/2023, 14:52:16] FFmpeg transcoding error.

{
« err »: {
« stack »: « Error: ffmpeg exited with code 12: Failed to inject frame into filter network: Cannot allocate memory\nCannot allocate memory\nConversion failed!\n\n at ChildProcess. (/var/www/peertube/versions/peertube-v5.2.1/node_modules/fluent-ffmpeg/lib/processor.js:182:22)\n at ChildProcess.emit (node:events:513:28)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) »,
« message »: « ffmpeg exited with code 12: Failed to inject frame into filter network: Cannot allocate memory\nCannot allocate memory\nConversion failed!\n »
},
« stdout »: «  »,

I found the problem, the problem is in the Plugin: hardware-transcode-vaapi, I changed back to H.264 and the problem disappeared, but it already requires more cpu resources.

The error message (Cannot allocate memory) suggest that it is a lack of memory. Maybe on the GPU (as you are using the hardware-transcode-vaapi plugin).