Skip to main content
With Serverless AI, you can translate and dub a video into another language. To do so, create a Docker image and run a fine-tuning job based on it. The job converts audio to text, translates the text and creates a dubbed video.

Costs

Nebius AI Cloud charges you for the following billing items:

Prerequisites

Make sure you are in a group that has at least the editor role within your tenant or project; for example, the default editors group. You can check this in the Administration → IAM section of the web console.

Steps

Prepare infrastructure

Locate all resources in the same project.
  1. Create a CPU-only VM. The VM is required to build the Docker image based on the VM’s Linux operating system (OS). If you build the image on a non-Linux OS, the image architecture will be incompatible with Serverless AI, and the fine-tuning job will fail. Configure SSH access to the VM so that you can connect to it later.
    1. In the web console, go to ComputeVirtual machines.
    2. Click Create resourceVirtual machine.
    3. On the page that opens, set the following VM configuration:
      • Computing resources: Without GPU.
      • Platform: Non-GPU AMD EPYC Genoa.
      • Preset: 4 CPUs — 16 GiB RAM.
      • Boot disk operating system: Ubuntu 24.04 LTS.
      • Boot disk size: At least 100 GiB.
      • Public IP address: Auto assign dynamic IP.
      • Username and SSH key: Configure access credentials.
    4. Click Create VM.
  2. Create a bucket to store fine-tuning artifacts.
    1. In the web console, go to  Storage → Object Storage.
    2. Click  Create bucket.
    3. In the Maximum size field, select Unlimited. Leave the other settings at their default values.
    4. Click Create bucket.

Prepare files for the Docker image

  1. To connect to the VM, get its public IP address:
    1. In the web console, go to ComputeVirtual machines.
    2. On the Standalone VMs tab, open the VM page.
    3. In Network → Public IPv4, copy the address.
  2. Connect to the VM by using SSH:
    Specify the username that you set when creating the VM.
  3. On the VM, create a working directory:
  4. In this directory, create the following files for building the Docker image:
    To verify that all files are present, run ls or tree.
  5. Make the process_video.py file executable:

Build and push the Docker image

On the VM:
  1. Install Docker.
  2. Install additional packages and prepare Docker for building the image:
  3. Check that the Docker daemon is running:
    If Docker is running, this command returns a table of containers (can be empty). If you don’t see the table and the daemon isn’t running, launch it.
  4. Create an account in Docker Hub. Use it for authentication when you push your image to a repository.
  5. Create a public repository in Docker Hub. You will push your Docker image there.
  6. In the ~/video-translation-nebius directory, build the image:
    In the command, specify your public repository. For example, myrepository/dubbing:video-translation-nebius. This operation can take several minutes to complete.
  7. Authenticate in Docker Hub:
    Specify your username at Docker Hub and enter your password when prompted.
  8. Push the image to the repository:
    This operation can take several minutes to complete.

Create a dubbed video

  1. Create a fine-tuning job that generates a model for translation and that dubs the video:
    1. In the web console, go to  Serverless AI → Jobs.
    2. Click  Create job.
    3. On the page that opens, specify the following job parameters:
      • Image path: <repository>/<image>:video-translation-nebius. Set the image that you’ve pushed to the Docker repository.
      • Entrypoint command:
        The --url parameter contains a link to the video being processed. The --target-lang parameter specifies what language the audio track is translated into.
      • Computing resources and Container disk: Keep the predefined settings.
      • Mount volumes: Bucket.
      • Mount path: /mnt/data. After that, click  Attach bucket and then select the bucket created earlier.
    4. Click Create.
    While the job is running, you can check its logs on the job’s page, on the Logs tab. The logs show how the model is processing the audio, transcribing and translating the text.
    After the job reaches the Complete status, the following files are created in the bucket:
    • output/transcript.txt: Speech that the model recognized in the video.
    • output/translated.txt: Translation of this speech.
    • output/output_video_with_audio.mp4: Dubbed video.
    The speech-to-text (STT) quality in this tutorial is not production-level. Accuracy may be low with short sample videos and default model settings. That is expected because the tutorial’s purpose is only to showcase the process of STT, video translation and dubbing. To improve the quality, use stronger STT or translation models, split audio into smaller segments and add audio post-processing.
  2. Download the dubbed video:
    1. Open the bucket’s page and go to the output directory.
    2. In the line of the output/output_video_with_audio.mp4 object, click  → Download.

How to delete the created resources

Some of the created resources are chargeable. If you don’t need them, delete these resources, so Nebius AI Cloud doesn’t charge for them: