Emote generation

In order to create an emote the following flow must happen:

First, a user must have been created, follow the user creation guide if it's not already done.

You will have to create a generation token with the following route.

You can generate a QR code with the 'url' field in order to redirect to the PWA. The PWA will use the token and run the process on it's own. The token can only be used once, and has a 5 minutes TTL in order to prevent abuses. You have the ability to provide arbitrary metadata that will be attached to the process and then the emote. This could be used for example to implement customizable emotes with GTA's animation flags. As the server owner, you are responsible for the token generation. Generation processes will cost money and you have to design your system in a way that ensure you can generate revenue.

You can list the processes of a user with the following route :

The emote creation process will evolve through these different states :

  • Pending: When the process is queued to be processed by our GPU cluster

  • Processing: When the ML algorithm is running on the video

  • Done: When the inference was successful

  • Failed:

    • An unknown error happens when the algorithm failed due to an unhandled error

    • A known error code will be returned if the video input is not processable

      • Too many people

      • No human detected on screen

      • The detected actor is too small

  • Validated & Rejected: Optional user validation step that is detailed here.

When the YCD File generation setting is enabled, an extra status called 'gta_done' will be present in the webhook.

You are also able to filter the processes by their creation date, allowing you for example to only display the processes recently created.

In order to fetch the content of a successful process, you need to call the emote route with the 'emote' uuid of the process object:

With this route you are able to get the asset's metadata and all the associated files, including the YCD file through a signed download link.

In our FiveM implementation, we download the output file and let the Cfx Server handle the Client - Server streaming. This way, even if the API was down, you would still be able to play existing emotes in game.

Last updated