Skip to main content
This guide shows you how to transform long-form videos into short, engaging clips perfect for social media. Use AI to automatically extract the most impactful moments from webinars, interviews, lectures, or any long video content.

What You’ll Learn

Video Repurposing

Convert long videos into short clips

AI Highlights

Automatically detect key moments

Social Ready

Perfect for TikTok, Reels, Shorts

Auto Captions

Subtitles generated automatically

Before You Begin

Make sure you have:
  • A Pictory API key (get one here)
  • Node.js or Python installed on your machine
  • Long-form video accessible via public URL
  • Understanding of target platform requirements
npm install axios

How Video-to-Shorts Works

When you convert a long video to short clips:
  1. Video Access - Your source video is downloaded and analyzed
  2. Audio Transcription - AI transcribes the audio content
  3. Content Analysis - Speech patterns, visual changes, and content relevance are analyzed
  4. Highlight Detection - Key moments and engaging segments are identified
  5. Clip Extraction - Short clips are generated from the highlights
  6. Enhancement - Clips are optimized with captions and formatting
  7. Video Rendering - Final short clips are ready for download
The source video must be accessible via a public URL. Processing time depends on video length - expect approximately 1-2 minutes of processing for every minute of source video.

Complete Example

import axios from "axios";

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

// Sample video URL - replace with your own long-form video URL
const VIDEO_URL = "https://pictory-static.pictorycontent.com/sample_long_video.mp4";

async function createVideoToShorts() {
  try {
    console.log("Creating short clips from long video...");

    const response = await axios.post(
      `${API_BASE_URL}/v2/video/storyboard/render`,
      {
        videoName: "video_to_shorts",
        url: VIDEO_URL,                    // Long-form video URL
        videoToVideo: true,                // Enable video repurposing mode
      },
      {
        headers: {
          "Content-Type": "application/json",
          Authorization: API_KEY,
        },
      }
    );

    const jobId = response.data.data.jobId;
    console.log("✓ Video processing started!");
    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✓ Short clips are ready!");
        console.log("Video URL:", jobResult.data.videoURL);

        if (jobResult.data.highlights) {
          console.log("Highlight clips:", jobResult.data.highlights);
        }
      } 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;
  }
}

createVideoToShorts();

Understanding the Parameters

ParameterTypeRequiredDescription
videoNamestringYesA descriptive name for your video project
urlstringYesPublic URL to the long-form source video file
videoToVideobooleanYesSet to true to enable video repurposing mode

Supported Video Formats

FormatExtensionDescriptionQuality
MP4.mp4Most common format (recommended)Excellent
MOV.movApple QuickTime formatExcellent
AVI.aviWindows video formatGood
MKV.mkvMatroska multimedia containerExcellent
WebM.webmWeb video formatGood
WMV.wmvWindows Media VideoGood
Best Format: Use MP4 (H.264 codec) for the best balance of quality, compatibility, and processing speed.

Ideal Clip Durations by Platform

PlatformIdeal DurationMaximum LengthNotes
TikTok15-60 seconds10 minutesShorter is better (under 60s)
Instagram Reels15-90 seconds90 secondsSweet spot: 30-60 seconds
YouTube Shorts15-60 seconds60 secondsMust be vertical or square
Twitter/X15-45 seconds2 minutes 20 secondsConcise content performs best
LinkedIn30-90 seconds10 minutesProfessional, value-focused
Facebook30-90 seconds240 minutesAttention span: first 3 seconds crucial

Common Use Cases

Webinar Highlights for LinkedIn

{
  videoName: "webinar_key_moments",
  url: "https://storage.example.com/full-webinar.mp4",
  videoToVideo: true
}
Result: Key insights extracted as 30-90 second clips perfect for LinkedIn.

Podcast to Social Media Clips

{
  videoName: "podcast_episode_highlights",
  url: "https://storage.example.com/podcast-ep-042.mp4",
  videoToVideo: true
}
Result: Best moments from podcast as shareable social clips.

Interview Highlights for YouTube Shorts

{
  videoName: "interview_best_moments",
  url: "https://storage.example.com/full-interview.mp4",
  videoToVideo: true
}
Result: Most engaging interview segments as short-form content.

Educational Content for TikTok

{
  videoName: "lecture_key_points",
  url: "https://storage.example.com/full-lecture.mp4",
  videoToVideo: true
}
Result: Educational highlights perfect for TikTok’s short format.

Best Practices

Start with high-quality source material:
  • Resolution: 1080p or higher recommended
  • Audio Quality: Clear speech with minimal background noise
  • Lighting: Well-lit content produces better clips
  • Composition: Centered subjects work best for crops
  • Engagement: Videos with natural segment breaks work better
Select appropriate source video duration:
  • 10-30 Minutes: Ideal length for extracting multiple clips
  • Under 10 Minutes: May produce fewer highlight options
  • Over 60 Minutes: Consider splitting into segments first
  • Clear Sections: Videos with distinct topics produce better clips
  • Pacing: Varied pacing helps AI identify engaging moments
Audio quality directly affects clip selection:
  • Clear Speech: AI relies on transcription for context
  • Minimal Noise: Reduce background sounds
  • Good Microphones: Use quality recording equipment
  • One Speaker: Single speaker is easier to process
  • Natural Pauses: Helps AI identify segment boundaries
Ensure your video file can be accessed:
  • Cloud Storage: Upload to Google Drive, Dropbox, AWS S3, or CDN
  • Public Link: Generate direct, public download URL
  • No Authentication: URL must work without login
  • Test Access: Open in incognito browser to verify
  • Stable URL: Ensure link won’t expire during processing
Consider your target platform:
  • Aspect Ratio: 9:16 (vertical) for TikTok, Reels, Shorts
  • Duration: Match platform limits (15-60s typical)
  • Captions: Auto-generated captions included
  • Branding: Add logos and brand elements
  • Hook: First 3 seconds crucial for retention

Troubleshooting

Problem: The API cannot download or process your video.Solution:
  • Verify URL is publicly accessible (test in incognito browser)
  • Ensure it’s a direct download link, not streaming or preview link
  • For Google Drive: Share → “Anyone with the link” → Copy link
  • For Dropbox: Create link → change “dl=0” to “dl=1” in URL
  • Check file hasn’t been deleted or moved
  • Verify video format is supported (MP4, MOV, AVI, MKV, WebM)
Problem: Job status shows “in-progress” for extended periods.Solution:
  • Processing time is proportional to video length
  • Expected times:
    • 10-minute video: 15-20 minutes processing
    • 30-minute video: 30-45 minutes processing
    • 60-minute video: 60-90 minutes processing
  • Large file sizes take longer to download
  • Check status every 5-10 seconds (not more frequently)
  • If stuck for 2x expected time, contact support with job ID
Problem: AI doesn’t extract the segments you expected.Solution:
  • AI identifies engaging moments based on multiple factors
  • Ensure important moments have:
    • Clear, distinct speech
    • Visual changes or action
    • Natural pauses before/after
    • Energy in delivery
  • Consider manually selecting specific segments instead
  • Longer source videos give more clip options
Problem: Generated clips have muffled or unclear audio.Solution:
  • Check source video audio quality
  • Use higher bitrate audio in source (128kbps minimum)
  • Reduce background noise in source video
  • Ensure consistent audio levels throughout
  • Re-export source video with better audio settings
  • Try audio enhancement tools before uploading
Problem: Auto-generated captions don’t match audio.Solution:
  • Improve source audio quality
  • Reduce background music volume
  • Ensure clear speech (not too fast)
  • Minimize overlapping speakers
  • Check for audio distortion or clipping
  • Consider professional audio editing
Problem: API completes but doesn’t return highlight clips.Solution:
  • Verify videoToVideo parameter is set to true
  • Check source video contains clear speech
  • Ensure video isn’t purely music or sound effects
  • Try with different source video to test
  • Verify source video isn’t corrupted
  • Contact support if issue persists with valid content

Next Steps

Enhance your short-form videos with these features:

API Reference

For complete technical details, see: