Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
RemoteViz::Rendering::FrameEncoders Class Reference

RemoteViz More...

#include <RemoteViz/Rendering/FrameEncoders.h>

Public Types

enum  Encoder {
  NONE ,
  JPEG ,
  PNG ,
  H264_NVENC ,
  H264_OPENH264 ,
  VP9_VPX
}
 Frame encoder. More...
 
enum  Status {
  SUPPORTED ,
  UNSUPPORTED ,
  INCOMPATIBLE ,
  CLIENT_UNSUPPORTED
}
 Frame encoder status. More...
 

Public Member Functions

 FrameEncoders ()
 Constructor.
 
 FrameEncoders (const FrameEncoders &obj)
 Copy constructor.
 
FrameEncodersoperator= (const FrameEncoders &obj)
 Copy assignment operator.
 
 ~FrameEncoders ()
 Destructor.
 
void setInteractiveEncoder (Encoder value)
 Sets the interactive encoder.
 
Encoder getInteractiveEncoder () const
 Gets the interactive encoder.
 
void setStillEncoder (Encoder value)
 Sets the still encoder.
 
Encoder getStillEncoder () const
 Gets the still encoder.
 
Status getInteractiveEncoderStatus () const
 Gets the interactive encoder status.
 
Status getStillEncoderStatus () const
 Gets the still encoder status.
 

Detailed Description

RemoteViz

Defines a pair of encoders that are used to encode still and interactive frames.

Default value for both still and interactive is NONE when a FrameEncoders object is created. But when a client connects to the service, RemoteViz will set PNG for still frames and JPEG for interactive frames. Frames are considered "interactive" when the user is interacting with the scene, for example dragging the mouse to move the camera. In this case it may be acceptable to use (for example) lossy JPEG encoding to maximize performance, then switch to loss-less PNG encoding for the "still" frame when the user interaction is finished.

Video encoding (H.264 or VP9) generally provides better performance (frames per second) than image encoding (JPEG and PNG). However this depends on many factors. Video encoded frames usually require less bandwidth, but the encoding of each frame can take more time. See the hardware and software dependencies for each encoder below.

A FrameEncoders object is passed to the RenderAreaListener methods onOpenedConnection(), onInitializedConnection() and onRefusedEncoder().

  • In the onOpenedConnection() method, use the FrameEncoders object to request non-default encoders. Use the ConnectionSettings::isSupportedEncoders() method to query if the proposed encoders are available.
  • onRefusedEncoder() will be called if one of the encoders is not supported in the current environment or the combination of encoders is not supported. Use the FrameEncoders object to determine which encoder is invalid (see getStillEncoderStatus() and getInteractiveEncoderStatus()), then set new encoders. onRefusedEncoder() will be called again if the requested encoders are not valid.
  • In the onInitializedConnection() method, use the FrameEncoders object to query which encoders will actually be used.

The current frame encoders can also be queried using ConnectionSettings::getFrameEncoders().

See also ConnectionSettings::setFrameEncodingPolicy().

See the examples HelloConeH264 and HelloConeVP9.

Limitations:

  • Currently it is not possible to "mix" video and image encoding.
    In other words, the interactive and still encoders must be both video encoders (H264, VP9, ...) or both image encoders (JPEG, PNG, ...).
  • Currently, when using video encoding, the interactive and still encoders must be the same, e.g. both H264_NVENC.

Definition at line 89 of file FrameEncoders.h.

Member Enumeration Documentation

◆ Encoder

Frame encoder.


Enumerator
NONE 

Internal usage.

JPEG 

JPEG encoder.

PNG 

PNG encoder.

H264_NVENC 

H.264 encoder using Nvidia Video Codec.

This encoder requires an NVIDIA GPU Kepler or higher, CUDA Toolkit 11 or higher and driver version 451.22 or higher on Windows / driver version 450.36.06 or higher on Linux. On Windows, this encoder requires the library nvEncodeAPI(64).dll. On Linux, this encoder requires the libraries libnvidia-encode and libva.

H264_OPENH264 

H.264 encoder using OpenH264.

On Linux, this encoder requires the library libva.

VP9_VPX 

VP9 encoder using libvpx.

On Linux, this encoder requires the library libva.

Definition at line 100 of file FrameEncoders.h.

◆ Status

Frame encoder status.


Enumerator
SUPPORTED 

The encoder can be loaded and used by the service.

UNSUPPORTED 

Reasons:

  • The encoder cannot be loaded by the service: the RemoteViz codec library (fei_remoteViz_*_codec) is missing or at least one dependency is not satisfied (On Linux, the command ldd can be used to check if dependencies are satisfied).
  • The encoder is not supported by the system (Example: no Nvidia GPU to use H264_NVENC). Enabling debugging will output more verbose information.
INCOMPATIBLE 

The pair (still encoder, interactive encoder) is incompatible.

CLIENT_UNSUPPORTED 

The codec format is not supported by the client (Example: the client does not support H.264 decoding).

Definition at line 125 of file FrameEncoders.h.

Constructor & Destructor Documentation

◆ FrameEncoders() [1/2]

RemoteViz::Rendering::FrameEncoders::FrameEncoders ( )

Constructor.


◆ FrameEncoders() [2/2]

RemoteViz::Rendering::FrameEncoders::FrameEncoders ( const FrameEncoders obj)

Copy constructor.

◆ ~FrameEncoders()

RemoteViz::Rendering::FrameEncoders::~FrameEncoders ( )

Destructor.


Member Function Documentation

◆ getInteractiveEncoder()

Encoder RemoteViz::Rendering::FrameEncoders::getInteractiveEncoder ( ) const

Gets the interactive encoder.


Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to JPEG when a connection is initialized.

Returns
the interactive encoder.

◆ getInteractiveEncoderStatus()

Status RemoteViz::Rendering::FrameEncoders::getInteractiveEncoderStatus ( ) const

Gets the interactive encoder status.


Default value is UNSUPPORTED.

Returns
the interactive encoder status.

◆ getStillEncoder()

Encoder RemoteViz::Rendering::FrameEncoders::getStillEncoder ( ) const

Gets the still encoder.


Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to PNG when a connection is initialized.

Returns
the still encoder.

◆ getStillEncoderStatus()

Status RemoteViz::Rendering::FrameEncoders::getStillEncoderStatus ( ) const

Gets the still encoder status.


Default value is UNSUPPORTED.

Returns
the still encoder status.

◆ operator=()

FrameEncoders & RemoteViz::Rendering::FrameEncoders::operator= ( const FrameEncoders obj)

Copy assignment operator.

◆ setInteractiveEncoder()

void RemoteViz::Rendering::FrameEncoders::setInteractiveEncoder ( Encoder  value)

Sets the interactive encoder.


This encoder will be used to encode interactive frames. Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to JPEG when a connection is initialized.

Parameters
value: interactive encoder.

◆ setStillEncoder()

void RemoteViz::Rendering::FrameEncoders::setStillEncoder ( Encoder  value)

Sets the still encoder.


This encoder will be used to encode still frames.
Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to PNG when a connection is initialized.

Parameters
value: still encoder.

The documentation for this class was generated from the following file: