remote.arcameraquality

remote.arcameraquality

#Overview

name: remote.arcameraquality

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of remote.arcameraquality is to set the quality of JPEG compression for AR camera images in the Remote Session plugin of Unreal Engine 5. This setting variable is specifically used in the context of remote AR camera streaming.

The Remote Session plugin, particularly the AR Camera Channel module, relies on this setting variable. It is used in the RemoteSessionARCameraChannel.cpp file, which is part of the Experimental RemoteSession plugin.

The value of this variable is set using a TAutoConsoleVariable, which means it can be adjusted at runtime through console commands. The default value is set to 85, with a range of 1-100, where higher values indicate better quality but larger file sizes.

This variable interacts closely with CVarJPEGQuality, which is the associated variable that directly uses the value set by remote.arcameraquality. It also interacts with other variables like CVarJPEGColor and CVarJPEGGpu, which control other aspects of the JPEG compression process.

Developers must be aware that changing this value affects the quality and size of the AR camera images being transmitted in remote sessions. Higher values will result in better image quality but increased network bandwidth usage and potentially higher latency.

Best practices when using this variable include:

  1. Balancing image quality with performance requirements.
  2. Testing different values to find the optimal setting for your specific use case.
  3. Considering adjusting this value dynamically based on network conditions or device capabilities.

Regarding the associated variable CVarJPEGQuality:

The purpose of CVarJPEGQuality is to directly control the JPEG compression quality in the AR camera image conversion process. It uses the value set by remote.arcameraquality.

This variable is used in the RemoteSessionARCameraChannel module of the Remote Session plugin. It’s specifically utilized in the QueueARCameraImage function to set the quality parameter when converting AR camera images to JPEG format.

The value of CVarJPEGQuality is set by the remote.arcameraquality console variable, allowing for runtime adjustments.

CVarJPEGQuality interacts with other variables like CVarJPEGColor and CVarJPEGGpu in the image conversion process, affecting different aspects of the JPEG compression.

Developers should be aware that this variable directly impacts the image conversion process and should be used in conjunction with remote.arcameraquality for consistent results.

Best practices for using CVarJPEGQuality include:

  1. Ensuring it’s always in sync with remote.arcameraquality.
  2. Considering the impact on both image quality and performance when adjusting its value.
  3. Testing thoroughly to ensure the chosen quality setting meets the requirements for your AR application.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Experimental/RemoteSession/Source/RemoteSession/Private/Channels/RemoteSessionARCameraChannel.cpp:34

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarJPEGQuality(
	TEXT("remote.arcameraquality"),
	85,
	TEXT("Sets quality (1-100)"),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarJPEGColor(
	TEXT("remote.arcameracolorjpeg"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarJPEGQuality. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Experimental/RemoteSession/Source/RemoteSession/Private/Channels/RemoteSessionARCameraChannel.cpp:33

Scope: file

Source code excerpt:

#define CAMERA_MESSAGE_ADDRESS TEXT("/ARCamera")

TAutoConsoleVariable<int32> CVarJPEGQuality(
	TEXT("remote.arcameraquality"),
	85,
	TEXT("Sets quality (1-100)"),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarJPEGColor(

#Loc: <Workspace>/Engine/Plugins/Experimental/RemoteSession/Source/RemoteSession/Private/Channels/RemoteSessionARCameraChannel.cpp:433

Scope (from outer to inner):

file
function     void FRemoteSessionARCameraChannel::QueueARCameraImage

Source code excerpt:

		CompressionTask->Width = CameraImage->Size.X;
		CompressionTask->Height = CameraImage->Size.Y;
		CompressionTask->AsyncTask = IAppleImageUtilsPlugin::Get().ConvertToJPEG(CameraImage, CVarJPEGQuality.GetValueOnGameThread(), !!CVarJPEGColor.GetValueOnGameThread(), !!CVarJPEGGpu.GetValueOnGameThread());
    }
    else
    {
        UE_LOG(LogRemoteSession, Warning, TEXT("No AR Camera Image to send!"));
    }
}