Skip to main content
This guide shows you how to add professional video-based intro and outro sequences to your videos. Video backgrounds automatically detect duration, making it easy to add branded sequences without manual timing configuration.

What You’ll Learn

Video Intro/Outro

Add video-based branded intro and outro sequences

Auto Duration Detection

Automatically use video’s actual duration without manual configuration

Duration Override

Optionally override duration to trim or loop videos

Audio Control

Control audio playback with mute and loop settings

Before You Begin

Make sure you have:
  • A Pictory API key (get one here)
  • Node.js or Python installed on your machine
  • Intro and outro video URLs (MP4 format recommended)
  • Videos are high quality (1920x1080 or higher recommended)
npm install axios

How Video Intro/Outro Works

When you add video intro/outro sequences:
  1. Intro Scene Definition - Create first scene with video background pointing to intro URL
  2. Duration Detection - System automatically detects video duration from file
  3. Duration Override (Optional) - Add minimumDuration to trim or loop to specific length
  4. Main Content Addition - Include your main content scenes after intro
  5. Outro Scene Definition - Create last scene with video background pointing to outro URL
  6. Audio Settings Application - Mute and loop settings are applied to intro/outro videos
  7. Video Rendering - Final video rendered with intro, content, and outro
For intro and outro videos, omit minimumDuration to use the video’s actual duration. This ensures your branded sequences play completely without trimming.

Complete Example

import axios from "axios";

const API_BASE_URL = "https://api.pictory.ai/pictoryapis";
const API_KEY = "YOUR_API_KEY";

const STORY_TEXT = "AI is poised to significantly impact educators and course creators.";
const INTRO_VIDEO_URL = "https://pictory-static.pictorycontent.com/PictoryLogoINTRO.mp4";
const OUTRO_VIDEO_URL = "https://pictory-static.pictorycontent.com/PictoryLogoOUTRO.mp4";

async function createTextToVideoWithIntroOutro() {
  try {
    console.log("Creating video with intro and outro...");

    const response = await axios.post(
      `${API_BASE_URL}/v2/video/storyboard/render`,
      {
        videoName: "text_to_video_intro_outro",

        scenes: [
          // Intro scene - with optional minimumDuration
          {
            background: {
              type: "video",
              visualUrl: INTRO_VIDEO_URL,
            },
            minimumDuration: 2, // Optional: override video duration
          },

          // Main content
          {
            story: STORY_TEXT,
            createSceneOnNewLine: true,
            createSceneOnEndOfSentence: true,
          },

          // Outro scene - without minimumDuration (auto-detect)
          {
            background: {
              type: "video",
              visualUrl: OUTRO_VIDEO_URL,
            },
            // minimumDuration omitted - uses actual video duration
          },
        ],
      },
      {
        headers: {
          "Content-Type": "application/json",
          Authorization: API_KEY,
        },
      }
    );

    const jobId = response.data.data.jobId;
    console.log("✓ Video with intro and outro render job created!");
    console.log("Job ID:", jobId);

    // Monitor progress
    console.log("\nMonitoring video creation...");
    let jobCompleted = false;
    let jobResult = null;

    while (!jobCompleted) {
      const statusResponse = await axios.get(
        `${API_BASE_URL}/v1/jobs/${jobId}`,
        {
          headers: { Authorization: API_KEY }
        }
      );

      const status = statusResponse.data.data.status;
      console.log("Status:", status);

      if (status === "completed") {
        jobCompleted = true;
        jobResult = statusResponse.data;
        console.log("\n✓ Video with intro and outro is ready!");
        console.log("Video URL:", jobResult.data.videoURL);
      } else if (status === "failed") {
        throw new Error("Video creation failed: " + JSON.stringify(statusResponse.data));
      }

      await new Promise(resolve => setTimeout(resolve, 5000));
    }

    return jobResult;
  } catch (error) {
    console.error("Error:", error.response?.data || error.message);
    throw error;
  }
}

createTextToVideoWithIntroOutro();

Understanding the Parameters

Video Background Parameters

ParameterTypeDefaultDescription
background.typestring-Must be "video" for video backgrounds
background.visualUrlstring-URL to the video file (MP4 recommended)
background.settings.mutebooleantrueWhen true, mutes video audio. When false, includes video’s original audio.
background.settings.loopbooleantrueWhen true, loops video if shorter than scene. When false, video plays once and freezes on last frame.
minimumDurationnumber-Optional. Scene duration in seconds. If omitted for videos, uses actual video duration.

Duration Behavior by Scenario

ScenariominimumDurationBehavior
Custom video URLNot providedUses actual video duration (auto-detected) ✅ Recommended for intro/outro
Custom video URLProvided (e.g., 3)Video is trimmed or looped to match 3 seconds
Stock library videoProvidedVideo is trimmed or looped to match duration
Image backgroundRequiredMust specify duration (images have no inherent duration)
Important: For intro and outro videos, omit minimumDuration to use the video’s full duration. This ensures your branded sequences play completely without trimming.

Intro Duration Explained

{
  background: {
    type: "video",
    visualUrl: INTRO_VIDEO_URL
  }
  // minimumDuration omitted - uses actual video duration
}
When to use:
  • Want full branded intro sequence to play
  • Video duration is already optimal length
  • Don’t want to trim or loop the video
  • Most common use case for intro/outro
Result: Video plays for its full duration automatically.

With minimumDuration Override

{
  background: {
    type: "video",
    visualUrl: INTRO_VIDEO_URL
  },
  minimumDuration: 3   // Override to 3 seconds
}
When to use:
  • Need to trim long intro to specific duration
  • Want consistent timing across multiple videos
  • Need to loop short video to fill time
Result: Video is trimmed or looped to match 3 seconds. Example: 5-second intro with minimumDuration: 3 plays only first 3 seconds.

Outro Duration Explained

{
  background: {
    type: "video",
    visualUrl: OUTRO_VIDEO_URL
  }
  // minimumDuration omitted - uses actual video duration
}
When to use:
  • Want full branded outro sequence to play
  • Outro contains important info (CTAs, contact info)
  • Video duration is already optimal length
  • Most common use case for outro
Result: Video plays for its full duration automatically.

With minimumDuration Override

{
  background: {
    type: "video",
    visualUrl: OUTRO_VIDEO_URL
  },
  minimumDuration: 8   // Override to 8 seconds
}
When to use:
  • Need to trim long outro to specific duration
  • Want consistent timing across multiple videos
  • Social media platforms have time constraints
Result: Video is trimmed or looped to match 8 seconds.
Best Practice: Keep intro videos short (2-5 seconds) to maintain viewer attention. Outro videos can be longer (5-10 seconds) to include calls-to-action and contact information.

Duration Best Practices

DurationUse CasePlatformExample
2-3 secondsQuick logo revealSocial mediaBrand logo animation
3-5 secondsBranded intro with taglineCorporate videosCompany name + slogan
5-8 secondsFull branded sequenceEducational contentLogo + tagline + music
8+ seconds⚠️ Too longNot recommendedMay lose viewer attention
DurationUse CasePlatformExample
5-8 secondsSimple CTASocial media”Subscribe” message with logo
8-12 secondsDetailed CTACorporate/EducationalSubscribe + social links + website
12-15 secondsExtended CTALong-form contentFull contact info + multiple CTAs
15+ seconds⚠️ Too longNot recommendedViewers may leave before completion

Video Background with Audio Settings

Control audio playback in your intro and outro videos:
{
  background: {
    type: "video",
    visualUrl: OUTRO_VIDEO_URL,
    settings: {
      mute: true,        // Mute outro video audio (allows voiceover to be heard)
      loop: false        // Don't loop the video (play once and freeze on last frame)
    }
  }
}
When to use mute:
  • mute: true - When you have voiceover narration or want silent branded sequences
  • mute: false - When intro/outro has important music or sound effects
When to use loop:
  • loop: false - For branded sequences that should play once (recommended for intro/outro)
  • loop: true - For background ambient videos in main content scenes

Common Use Cases

Corporate Video with Branded Intro/Outro

{
  scenes: [
    // Corporate intro with company branding
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/corporate-intro.mp4",
        settings: {
          mute: false,      // Include intro music
          loop: false       // Play once only
        }
      }
      // minimumDuration omitted - uses actual video duration
    },

    // Main content scenes
    {
      story: "Our quarterly results show significant growth..."
    },

    // Corporate outro with contact information
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/corporate-outro.mp4",
        settings: {
          mute: false,      // Include outro music
          loop: false       // Play once only
        }
      }
    }
  ]
}
Result: Professional corporate video with branded intro/outro and company music.

Educational Video with Quick Branding

{
  scenes: [
    // Short 2-second logo reveal
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/edu-logo-intro.mp4"
      },
      minimumDuration: 2    // Trim to exactly 2 seconds for quick intro
    },

    // Educational content with voiceover
    {
      story: "Today we'll learn about photosynthesis...",
      voiceOver: {
        speaker: "Matthew"
      }
    },

    // Outro with call-to-action
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/edu-cta-outro.mp4"
      }
      // Uses full 8-second outro duration
    }
  ]
}
Result: Quick branded intro, educational content with voice, full CTA outro.

Social Media Video with Attention-Grabbing Intro

{
  scenes: [
    // Eye-catching 3-second intro
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/social-hook-intro.mp4",
        settings: {
          mute: false,      // Include energetic music
          loop: false
        }
      },
      minimumDuration: 3    // Keep it short for social media
    },

    // Main content
    {
      story: "5 tips to boost your productivity..."
    },

    // Call-to-action outro
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/social-cta-outro.mp4"
      },
      minimumDuration: 5    // Short CTA for social media
    }
  ]
}
Result: Fast-paced social media video with short intro/outro for platform best practices.

Product Demo with Professional Bookends

{
  scenes: [
    // Professional intro with product branding
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/product-intro.mp4",
        settings: {
          mute: false,
          loop: false
        }
      }
    },

    // Product demonstration scenes
    {
      story: "Our new software streamlines your workflow..."
    },

    // Outro with purchase information and discount code
    {
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/product-outro-with-discount.mp4",
        settings: {
          mute: false,
          loop: false
        }
      }
      // Uses full outro duration to show all purchase info
    }
  ]
}
Result: Product demo with professional branded intro and detailed purchase outro.

Best Practices

Maintain viewer attention with brief intros:
  • Social Media: 2-3 seconds maximum
  • Corporate Videos: 3-5 seconds
  • Educational Content: 3-4 seconds
  • Long Intros: Increase drop-off rates significantly
  • First Impression: Viewers decide quickly whether to continue
  • Test Variations: A/B test different intro lengths
Ensure professional appearance with quality files:
  • Resolution: 1920x1080 minimum for HD quality
  • Format: MP4 with H.264 codec for best compatibility
  • Bitrate: 5-10 Mbps for optimal quality/size balance
  • Frame Rate: 30fps or 60fps for smooth playback
  • Aspect Ratio: 16:9 for standard video players
  • Brand Reflection: Low-quality intro/outro reflects poorly on brand
Ensure complete branded sequences:
  • Branded Sequences: Omit for full animation playback
  • Outro with Info: Ensure all contact info is visible
  • CTA Videos: Let complete CTA message play
  • When to Include: Only for trimming long videos
  • Auto-Detection: Let system use actual video duration
  • Professional Finish: Full sequences look more polished
Manage audio layers for clear sound:
  • With Voiceover: Set mute: true on intro/outro
  • Without Voiceover: Set mute: false to include music
  • Background Music: Keep volume lower than voiceover
  • Audio Conflicts: Don’t mix multiple audio sources
  • Professional Mix: Fewer audio layers = cleaner sound
  • Test Output: Preview to ensure audio balance
Verify videos work correctly:
  • URL Accessibility: Video URL must be publicly accessible
  • Browser Playback: Video plays in browser without download
  • Format Check: Video is in MP4 format
  • Aspect Ratio: 16:9 recommended for standard players
  • Audio Levels: Audio is appropriate volume
  • Test Render: Create test video before bulk production

Troubleshooting

Problem: Video intro or outro doesn’t show in rendered video.Solution:
  • Verify video URL is publicly accessible (test in browser)
  • Ensure video format is supported (use MP4 with H.264)
  • Check video file isn’t corrupted or incomplete
  • Verify URL uses HTTPS (not HTTP)
  • Test with known working video URL to isolate issue
  • Review API response for validation errors
Problem: Video is trimmed and doesn’t play fully.Solution:
  • Remove minimumDuration parameter to use full video duration
  • If duration must be specified, ensure it matches or exceeds video length
  • Check video’s actual duration (right-click → Properties → Details)
  • Don’t guess duration - let system auto-detect
  • Test without minimumDuration first
  • Only add minimumDuration when intentionally trimming
Problem: Video repeats instead of playing once.Solution:
  • Set settings.loop: false explicitly in background configuration
  • Default is loop: true, must override for one-time playback
  • Remove minimumDuration to use actual video duration
  • If minimumDuration > video length and loop: true, video will loop
  • Verify loop setting is within scene’s background configuration
  • Preview output to confirm loop behavior
Problem: Intro/outro audio plays simultaneously with narration.Solution:
  • Set settings.mute: true to silence intro/outro audio
  • Use intro/outro videos without audio tracks
  • Adjust audio levels in source video files before upload
  • Don’t mix background video audio + voiceover
  • Plan audio strategy before configuring settings
  • Test audio balance with actual voiceover
Problem: Scene duration differs from what you expected.Solution:
  • Check actual video duration using media player
  • Re-encode video with standard settings (30fps, constant frame rate)
  • Use minimumDuration to explicitly set desired length
  • Verify video doesn’t have variable frame rate (VFR)
  • Convert to constant frame rate (CFR) for predictable duration
  • Test with explicitly set minimumDuration
Problem: Intro/outro appears pixelated or low quality.Solution:
  • Use 1920x1080 minimum resolution for source videos
  • Export videos at high bitrate (5-10 Mbps)
  • Use MP4 format with H.264 codec
  • Avoid re-compressing videos multiple times
  • Ensure aspect ratio matches project settings (16:9)
  • Test with high-quality source video to isolate issue

Supported Video Formats

Best practices for intro/outro video formats:
FormatExtensionRecommendedNotes
MP4.mp4✅ YesBest compatibility and compression
WebM.webm⚠️ LimitedMay have compatibility issues
MOV.mov⚠️ LimitedLarger file sizes, use H.264 codec
AVI.avi❌ NoNot recommended, poor compression
Recommended Format: MP4 with H.264 codec at 1920x1080 resolution for best compatibility and quality across all platforms.

Advanced Configuration

Combining Intro/Outro with Other Features

{
  scenes: [
    // Intro with transition
    {
      background: {
        type: "video",
        visualUrl: INTRO_VIDEO_URL
      },
      transition: {
        type: "fade",
        duration: 0.5
      }
    },

    // Main content with custom background and audio
    {
      story: "Your content here...",
      background: {
        type: "video",
        visualUrl: "https://your-cdn.com/background.mp4",
        settings: {
          mute: true,       // Mute background to hear voiceover
          loop: true        // Loop background video
        }
      },
      voiceOver: {
        speaker: "Matthew"
      }
    },

    // Outro with music and no transition
    {
      background: {
        type: "video",
        visualUrl: OUTRO_VIDEO_URL,
        settings: {
          mute: false,      // Include outro music
          loop: false
        }
      }
    }
  ]
}
Result: Smooth intro transition, looping background with voiceover, and musical outro.

Next Steps

Enhance your video intro/outro with these complementary features:

API Reference

For complete technical details, see: