Transloadit

Export files to YouTube

🤖/youtube/store exports encoding results to YouTube.

Installation

Since YouTube works with OAuth, you will need to generate Template Credentials to use this Robot.

To change the title, description, category, or keywords per video, we recommend to inject variables into your Template.

Adding a thumbnail image to your video

You can add a custom thumbnail to your video on YouTube by using our "as" syntax for the "use" parameter to supply both a video and an image to the step:

"exported": {
  "use": [
    { "name": "video_encode_step", "as": "video" },
    { "name": "image_resize_step", "as": "image" },
  ],
  ...
},

If you encounter an error such as "The authenticated user doesnʼt have permissions to upload and set custom video thumbnails", you should go to your YouTube account and try adding a custom thumbnail to one of your existing videos. Youʼll be prompted to add your phone number. Once youʼve added it, the error should go away.

Usage example

Export an uploaded video to YouTube and set some basic parameters:

{
  "steps": {
    "exported": {
      "robot": "/youtube/store",
      "use": ":original",
      "credentials": "YOUR_YOUTUBE_CREDENTIALS",
      "title": "Transloadit: Video Example",
      "description": "Some nice description",
      "category": "science & technology",
      "keywords": "transloadit, robots, botty",
      "visibility": "private"
    }
  }
}

Parameters

  • output_meta

    Record<string, boolean> | boolean

    Allows you to specify a set of metadata that is more expensive on CPU power to calculate, and thus is disabled by default to keep your Assemblies processing fast.

    For images, you can add "has_transparency": true in this object to extract if the image contains transparent parts and "dominant_colors": true to extract an array of hexadecimal color codes from the image.

    For videos, you can add the "colorspace: true" parameter to extract the colorspace of the output video.

    For audio, you can add "mean_volume": true to get a single value representing the mean average volume of the audio file.

    You can also set this to false to skip metadata extraction and speed up transcoding.

  • result

    boolean (default: false)

    Whether the results of this Step should be present in the Assembly Status JSON

  • queue

    "batch"

    Setting the queue to 'batch', manually downgrades the priority of jobs for this step to avoid consuming Priority job slots for jobs that don't need zero queue waiting times

  • force_accept

    boolean (default: false)
      Force a Robot to accept a file type it would have ignored.
    

    By default Robots ignore files they are not familiar with. 🤖/video/encode, for example, will happily ignore input images.

    With the force_accept parameter set to true you can force Robots to accept all files thrown at them. This will typically lead to errors and should only be used for debugging or combatting edge cases.

  • use

    string | Array<string> | Array<object> | object

    Specifies which Step(s) to use as input.

    • You can pick any names for Steps except ":original" (reserved for user uploads handled by Transloadit)
    • You can provide several Steps as input with arrays:
      {
        "use": [
          ":original",
          "encoded",
          "resized"
        ]
      }
      
  • credentials

    string · required

    The authentication Template credentials used for your YouTube account. You can generate them on the Template Credentials page. Simply add the name of your YouTube channel, and you will be redirected to a Google verification page. Accept the presented permissions and you will be good to go.

  • title

    string · required

    The title of the video to be displayed on YouTube.

    Note that since the YouTube API requires titles to be within 80 characters, longer titles may be truncated.

  • description

    string · required

    The description of the video to be displayed on YouTube. This can be up to 5000 characters, including \n for new-lines.

  • category

    · required

    The category to which this video will be assigned.

  • keywords

    string · required

    Tags used to describe the video, separated by commas. These tags will also be displayed on YouTube.

  • visibility

    "public" | "private" | "unlisted" · required

    Defines the visibility of the uploaded video.

Related blog posts