Skip to main content

🎭 Captioning Tasks

Tasks are the core components of video processing in the ZapCap API. They represent different stages of the video enhancement process, from transcription to rendering. This guide will help you understand the main types of tasks and how they work.

Types of Tasks

🎙️ Transcription Task

The transcription task is responsible for generating subtitles for your video.

How it works:

  1. When you create a video task using the POST /videos/{videoId}/task endpoint, a transcription task is automatically initiated.
  2. The API processes your video and generates a transcript.
  3. Once completed, the task status will change to indicate that transcription is done.

Key Points:

  • You can specify the language for transcription using the language parameter when creating the task.
  • If you want to use a transcript from a previous task, you can use the transcriptTaskId parameter.
    • This is useful if you want to use the same transcript for multiple videos and avoid incurring additional transcription costs.

✅ Transcript Approval

Approval is an optional step that allows you to review and approve the generated transcript before rendering.

How it works:

  1. After the transcription task is completed, you can review the transcript.
  2. Use the POST /videos/{videoId}/task/{id}/approve-transcript endpoint to approve the transcript.
  3. This approval allows the task to proceed to the rendering stage.

Key Points:

  • If you set autoApprove: true when creating the task, this step will be skipped automatically.
  • Approval is useful when you want to ensure the accuracy of the transcript before final rendering.

🎬 Render Task

The render task is responsible for creating the final video with stylized subtitles.

How it works:

  1. After the transcript is approved (or auto-approved), the render task begins.
  2. The API applies the chosen template and render options to create the final video.
  3. Once completed, you can download the rendered video.

Key Points:

  • You can specify a template using the templateId parameter when creating the task.
  • Various render options can be set to customize the appearance of your subtitles. Learn more about render options here

Task Lifecycle

  1. Task Creation: Use POST /videos/{videoId}/task to create a new task.
  2. Transcription: The API automatically starts transcribing your video.
  3. Approval (if not auto-approved): Review and approve the transcript.
  4. Rendering: The API creates the final video with subtitles.
  5. Completion: Download the rendered video and transcript.

Monitoring Tasks

You can monitor the progress of your tasks using the GET /videos/{videoId}/task/{id} endpoint. This will return the current status of the task, which can be one of the following:

  • pending: The task is queued and waiting to be processed.
  • transcribing: The video is being transcribed.
  • transcriptionCompleted: Transcription is done, waiting for approval (if not auto-approved).
  • rendering: The final video is being rendered with subtitles.
  • completed: The task is finished, and the final video is ready for download.
  • failed: The task encountered an error during processing.

Best Practices

  1. Language Selection: Always specify the correct language for accurate transcription.
  2. Template Choice: Explore different templates to find the best fit for your video style. Explore templates here
  3. Auto-Approve: Use auto-approve for faster processing if you don't need to review the transcript.
  4. Task Monitoring: Regularly check the task status to track progress and handle any potential issues promptly.

By understanding these tasks and how they work together, you can effectively use the ZapCap API to enhance your videos with dynamic, automated subtitles.