Générer des sous-titres pour une vidéo

Intermédiaire

Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 13 nœuds.Utilise principalement des nœuds comme Gmail, Merge, Webhook, HttpRequest, ExecuteCommand. Générer et traduire les sous-titres vidéo avec OpenAI Whisper et LibreTranslate

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Point de terminaison HTTP Webhook (généré automatiquement par n8n)
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "w2qeYCgIcuMglLEB",
  "meta": {
    "instanceId": "058026fc00ddd0f398afec59419d60070007f9155d42ea1b5598fa1878c9da96",
    "templateCredsSetupCompleted": true
  },
  "name": "Generate Subtitles for Videos",
  "tags": [],
  "nodes": [
    {
      "id": "7fa3143f-a837-4711-a72e-ee8b85e56757",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1504,
        112
      ],
      "webhookId": "a5f7f098-25f6-40ea-b139-c1fb1ef25b74",
      "parameters": {
        "path": "generate-subtitles",
        "options": {
          "responseData": {
            "responseBody": "Processing started"
          }
        },
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "23f12e94-e98c-4787-be58-763624e59537",
      "name": "Télécharger la vidéo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        112
      ],
      "parameters": {
        "url": "={{$json[\"body\"][\"video_url\"]}}",
        "options": {},
        "responseFormat": "file"
      },
      "typeVersion": 2
    },
    {
      "id": "d0f75494-fa2c-46f1-9ff2-2e17f8a88d0b",
      "name": "Extraire l'audio (FFmpeg)",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -896,
        112
      ],
      "parameters": {
        "command": "ffmpeg -i /data/video.mp4 -q:a 0 -map a /data/audio.wav"
      },
      "typeVersion": 1
    },
    {
      "id": "8d462da7-7935-4c5d-9528-2f4a41d2b79b",
      "name": "Exécuter Whisper (Local)",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -608,
        112
      ],
      "parameters": {
        "command": "whisper /data/audio.wav --model base --output_format srt --output_dir /data/"
      },
      "typeVersion": 1
    },
    {
      "id": "85ffc4ca-8f9d-485b-ab99-83b6774781b0",
      "name": "Lire le fichier SRT",
      "type": "n8n-nodes-base.readBinaryFile",
      "position": [
        -304,
        112
      ],
      "parameters": {
        "filePath": "/data/audio.srt"
      },
      "typeVersion": 1
    },
    {
      "id": "c982d95f-b63b-4dc0-abc5-0bfdb6fbced9",
      "name": "Traduire les sous-titres (LibreTranslate)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        560
      ],
      "parameters": {
        "url": "https://libretranslate.com/translate",
        "options": {},
        "authentication": "genericCredentialType",
        "jsonParameters": true
      },
      "typeVersion": 2
    },
    {
      "id": "aa3eee42-8559-4f05-891c-9169b32f58cf",
      "name": "Écrire le SRT traduit",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        448,
        560
      ],
      "parameters": {
        "options": {},
        "fileName": "audio_translated.srt"
      },
      "typeVersion": 1
    },
    {
      "id": "fb95e5aa-dd78-4249-b0d1-775dc259a870",
      "name": "Fusionner les chemins",
      "type": "n8n-nodes-base.merge",
      "position": [
        112,
        128
      ],
      "parameters": {
        "mode": "passThrough"
      },
      "typeVersion": 1
    },
    {
      "id": "dae85000-c87f-4607-b80c-5c9c70276ce1",
      "name": "Envoyer un message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        768,
        128
      ],
      "webhookId": "0dc39fa6-fac8-480d-a4cc-a1074edac0c2",
      "parameters": {
        "sendTo": "your-email@gmail.com",
        "message": "Attached are the subtitles (original and translated, if requested).",
        "options": {},
        "subject": "Video Subtitles Generated"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "f2AXAChfee6nsCv9",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "22d8ef5e-e319-4f76-8366-7b23bc600f43",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -176
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 480,
        "content": "## Input\n- Receives a video URL via webhook.\n- Acts as the workflow’s entry point.\n- Downloads the video from the provided URL.\n- Prepares it for audio extraction."
      },
      "typeVersion": 1
    },
    {
      "id": "5bf9004c-5e09-4cc2-af0f-63f9a2df15f7",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -176
      ],
      "parameters": {
        "color": 4,
        "width": 848,
        "height": 480,
        "content": "## Audio Extraction & Transcribing\n- Uses FFmpeg to separate audio from the video file.\n- Run Whisper (Local)\n- Uses OpenAI Whisper (running locally) to transcribe the extracted audio into text/subtitles.\n- Read SRT File\n- Reads the generated subtitle file (.srt)\n- Prepares the subtitle data for optional translation."
      },
      "typeVersion": 1
    },
    {
      "id": "2627a7bc-a0f7-4d03-b849-878abe63eb6a",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        336
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 400,
        "content": "## Translation\n- Combines transcription and translation paths.\n- Ensures that subtitles (original or translated) are passed downstream.\n- Translate Subtitles (LibreTranslate)\n- Sends the .srt file text to LibreTranslate for language translation.\n- Write Translated SRT\n- Outputs a new .srt file containing translated subtitles."
      },
      "typeVersion": 1
    },
    {
      "id": "fc33c12c-d054-4afe-bbf3-2f8a36c2f9df",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        -160
      ],
      "parameters": {
        "width": 608,
        "height": 912,
        "content": "# Subtitle Generator & Translator N8N Template Instructions\n\nThis workflow automatically processes a video URL received via a webhook, generates highly accurate subtitles using **OpenAI Whisper**, and optionally translates them before delivering the final `.srt` file.\n\n---\n\n## 🔴 Prerequisites\n\n- **Self-Hosted N8N**  \n  This workflow requires a self-hosted N8N instance, as it uses the **Execute Command** node.\n\n- **FFmpeg**  \n  The **Extract Audio (FFmpeg)** node requires the `ffmpeg` command-line tool to be installed and accessible via your N8N server's shell path.\n\n- **OpenAI Whisper**  \n  The **Run Whisper (Local)** node requires the `whisper` command-line tool (Python package) to be installed and accessible via your N8N server's shell path.\n\n- **Translation Service**  \n  You will need a credential for the **LibreTranslate** node "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "66d89da8-0755-4e8b-bf81-d1ae3fad5507",
  "connections": {
    "fb95e5aa-dd78-4249-b0d1-775dc259a870": {
      "main": [
        [
          {
            "node": "dae85000-c87f-4607-b80c-5c9c70276ce1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "85ffc4ca-8f9d-485b-ab99-83b6774781b0": {
      "main": [
        [
          {
            "node": "fb95e5aa-dd78-4249-b0d1-775dc259a870",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "23f12e94-e98c-4787-be58-763624e59537": {
      "main": [
        [
          {
            "node": "d0f75494-fa2c-46f1-9ff2-2e17f8a88d0b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7fa3143f-a837-4711-a72e-ee8b85e56757": {
      "main": [
        [
          {
            "node": "23f12e94-e98c-4787-be58-763624e59537",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8d462da7-7935-4c5d-9528-2f4a41d2b79b": {
      "main": [
        [
          {
            "node": "85ffc4ca-8f9d-485b-ab99-83b6774781b0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aa3eee42-8559-4f05-891c-9169b32f58cf": {
      "main": [
        [
          {
            "node": "fb95e5aa-dd78-4249-b0d1-775dc259a870",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "d0f75494-fa2c-46f1-9ff2-2e17f8a88d0b": {
      "main": [
        [
          {
            "node": "8d462da7-7935-4c5d-9528-2f4a41d2b79b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c982d95f-b63b-4dc0-abc5-0bfdb6fbced9": {
      "main": [
        [
          {
            "node": "aa3eee42-8559-4f05-891c-9169b32f58cf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Création de contenu, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds13
Catégorie2
Types de nœuds8
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Auteur
Paul Abraham

Paul Abraham

@hellopaul

Software Engineer & Automation Consultant with over 3+ years in experience helping teams streamline workflows with n8n, APIs, and AI-driven solutions.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34