Skip to main content

Overview

Extend Video uses Veo 3.1 AI to intelligently continue and extend your videos. Perfect for creating longer content, extending storytelling sequences, and optimizing video length.

Basic Extension (8 seconds)

const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Extended Story Video',
    media: 'media_video123',
    prompt: 'The camera slowly zooms out revealing a beautiful sunset over the ocean',
    targetDuration: 8,
    generateAudio: true
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);

Medium Extension (16 seconds)

const extendVideoMedium = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Extended Story Video',
      media: 'media_product_demo',
      prompt: 'The product rotates smoothly as the background transitions from blue to purple with subtle particle effects',
      targetDuration: 16,
      generateAudio: true,
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'q1-product-launch',
        platform: 'youtube',
        targetAudience: 'tech-enthusiasts'
      }
    })
  });

  return await response.json();
};

Long Extension (32 seconds)

const extendVideoLong = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Extended Story Video',
      media: 'media_story_video',
      prompt: 'The scene continues with smooth camera movement, transitioning through different environments while maintaining visual consistency',
      targetDuration: 32, // Processed in 4 segments of 8 seconds
      generateAudio: true,
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'storytelling-2024',
        type: 'narrative'
      }
    })
  });

  return await response.json();
};

Marketing Video Extension

const extendMarketingVideo = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Extended Story Video',
      media: 'media_ad_clip',
      prompt: 'The camera pulls back to show the full product lineup as the brand logo fades in with a golden glow effect',
      targetDuration: 12,
      generateAudio: true,
      webhook: 'https://yoursite.com/webhook/video-complete',
      metadata: {
        campaignId: 'q1-product-launch',
        platform: 'youtube',
        targetAudience: 'tech-enthusiasts'
      }
    })
  });

  return await response.json();
};

Tips for Extend Video

Specific prompts: Be detailed about camera movement, lighting changes, and object behavior
Match the source: Reference the style and mood of your source video in the prompt
Start small: Test with 8-16 seconds first, then scale to longer durations
Audio consistency: Enable generateAudio for smooth audio transitions
Duration multiples: Target duration must be a multiple of 4 seconds

Duration Guide

Choose the right extension duration for your use case:
DurationUse CaseProcessing Time
4-8sQuick transitions, social clips2-3 minutes
12-16sShort scene extensions4-6 minutes
20-32sMedium storytelling sequences8-12 minutes
36-60sLong-form content extensions15-20 minutes

Handling the Webhook Response

// Express.js webhook handler
app.post('/webhook', (req, res) => {
  const { data, status, message } = req.body;

  if (status === "COMPLETED") {
    const { videoId, url, shareUrl, metadata } = data;
    console.log('Video extended successfully!');
    console.log('Video ID:', videoId);
    console.log('Download URL:', url);
    console.log('Share URL:', shareUrl);
    console.log('Original Duration:', metadata.originalDuration);
    console.log('Extended Duration:', metadata.extendedDuration);

    // Save to your database, notify user, etc.
  } else if (status === "FAILED") {
    console.error('Video extension failed:', message);
    // Handle failure, notify user, retry, etc.
  }

  res.status(200).send('OK');
});

Common Use Cases

  • Content Creation: Extend short clips into longer, more engaging content
  • Storytelling: Continue narrative sequences with AI-generated footage
  • Marketing: Create extended product demos and promotional videos
  • Social Media: Optimize video length for platform requirements
  • B-Roll Generation: Generate additional footage that matches your style
  • Video Loop Creation: Extend videos to create seamless loops

Prompt Examples by Category

Camera Movement

  • “The camera continues to dolly backward, revealing the full scene as it maintains focus on the subject”
  • “Smooth pan to the right, discovering new elements in the environment”
  • “Gentle zoom in on the product while maintaining the same lighting”

Transitions

  • “The scene gradually transitions from day to night with natural lighting changes”
  • “Soft cross-fade into a new environment while maintaining visual continuity”
  • “The background shifts from warm tones to cool tones over the duration”

Action Continuation

  • “The dancer completes the spin and strikes a final pose with arms extended”
  • “The product rotates a full 360 degrees, showcasing all angles”
  • “The character walks toward the horizon as the sun sets behind them”

Atmospheric Effects

  • “Particles begin to float upward as the lighting becomes more dramatic”
  • “Rain starts falling gently as the mood becomes more contemplative”
  • “Fog rolls in from the sides, creating a mysterious atmosphere”