UE5.2 with pixel streaming in docker failing on NVENC 8

I have created a simple demo with UE5.2 and PixelStreaming plugin, it works on bare linux machine, but fails on docker env when a player connected to pixel streaming http page, the game just flush printing error logs:

[2024.01.24-12.57.10:738][377]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]
[2024.01.24-12.57.10:755][382]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]
[2024.01.24-12.57.10:755][382]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]
[2024.01.24-12.57.10:769][387]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]
[2024.01.24-12.57.10:769][387]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]
[2024.01.24-12.57.10:787][392]LogAVCodecs: Error: Error Creating: Failed to initialize encoder [NVENC 8]

the docker image inherited from ghcr.io/epicgames/unreal-engine:runtime-pixel-streaming, and when the game starts, from nvidia-smi I can see it consuming the GPU.

The startup arguments:

./game -RenderOffScreen -AudioMixer -PixelStreamingIP=localhost -PixelStreamingPort=8100 -Unattended -StdOut -FullStdOutLogOutput

and the docker startup arguments:

docker run -d --runtime=nvidia -e NVIDIA_DRIVER_CAPABILITIES=all --gpus all  [IMAGE_NAME]

Extra informations:
GPU: Nvidia A10
Driver Version: 535.154.05
Hosting PC: Ubuntu 22.04

I’ve tested NVENC by ffmpeg:

ffmpeg -hwaccel cuda -i input.mp4 -c:v h264_nvenc -preset fast output.mp4

it works, and during converting, nvidia-smi dmon -s u shows that GPU was working on encoding. So, it might not be the problem of the driver or docker environment.

Hi there!

So there could be a number of issues with this, but the first one that comes to mind is a potentially massive resolution.
If you’re running on an ultra wide for example, Pixel Streaming may pick up on that and try and stream at a resolution that NVENC can not handle.

Please try running again with -ResX=1920 -ResY=1080 in your launch args and see if this helps resolve the issue.

1 Like

Thanks for the reply!

I actually started it with ’ -ResX 1920 -ResY 1080 -ForceRes ', and tried without ForceRes too, the error log still be the same. I thought these options might be irrelevant so not mentioned here, sorry for the misleading.

recently I noticed another log:

[2024.01.29-07.20.59:655][526]LogPixelStreaming: Error: Selected codec was not a supported codec, falling back to negotiating codecs...
[2024.01.29-07.20.59:655][526]LogPixelStreaming: OnRenegotiationNeeded

this refers to code:

		// If we are not negotiating codecs simply return just the one codec that is selected in UE
		if (!Settings::CVarPixelStreamingWebRTCNegotiateCodecs.GetValueOnAnyThread())
		{
			const EPixelStreamingCodec SelectedCodec = UE::PixelStreaming::Settings::GetSelectedCodec();
			if (CodecMap.Contains(SelectedCodec))
			{
				for (auto& Format : CodecMap[SelectedCodec])
				{
					SupportedFormats.push_back(Format);
				}
				return SupportedFormats;
			}
			else
			{
				UE_LOG(LogPixelStreaming, Error, TEXT("Selected codec was not a supported codec, falling back to negotiating codecs..."));
			}
		}

I’m not familiar to UE source, I need some time figure out what is wrong there. If you have suggestions please let me know, thanks.

One more thing, I have tried -PixelStreamingEncoder="VP8|VP9" forcing using software encoder, but it didn’t work, is this argument still support? I didn’t find it in the document

Ah! The reason is actually the resolution, arguments must be -ResX=1920, not -Res 1920.

1 Like

Hello @IskandarMa

I see you’ve figured out the resolution issue with your setup! For your upcoming projects, you might find Vagon Streams extremely helpful. Vagon Streams simplifies the streaming process for applications on any device, with a special focus on no-code configuration. This means you can effortlessly make any application, including those developed with Unreal Engine, accessible globally without dealing with complex setups.

If you would like to do a test drive, please let me know. Or, you can create your account and easily start your first Stream anytime you want. :slight_smile:

Great news! I’m glad you solved the issue.

Aye the syntax for launch args can be a real sticking point, I hope the project goes well for you here on out.

Please let me know if you needed any further assistance!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.