> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magichour.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video to Video API

> Transform existing videos by applying new styles, effects, and visual treatments.

export const ToolSection = ({type = "image", outputs = [], title = "", productSlug = "", apiSlug = ""}) => <>
    <CardGroup cols={2}>
      <Card title={`${title} API reference`} icon="webhook" horizontal href={`/api-reference/${type}-projects/${apiSlug}`}>
        Request fields, responses, and examples
      </Card>
      <Card title="API quickstart" icon="forward-fast" horizontal href="/get-started/quick-start">
        Install an SDK and complete your first generation
      </Card>
    </CardGroup>

    <p>
      Check <a href="/billing/overview">API pricing</a> and <a href="/api-reference/models">model credit costs</a>, then <a href={`https://magichour.ai/developer?tab=api-keys&ref=docs-tool-${apiSlug}&utm_source=docs&utm_medium=referral&utm_campaign=tools`}>create an API key</a>.
    </p>
    <p>
      To try {title} without code, use the <a href={`https://magichour.ai/products/${productSlug}${productSlug.includes("?") ? "&" : "?"}utm_source=docs&utm_medium=referral&utm_campaign=tools`}>browser tool</a>.
    </p>

    {outputs && outputs.length > 0 && <Tabs>
        {outputs.map((output, idx) => <Tab key={idx} title={`Example Output ${idx + 1}`}>
            <Frame>
              {type === "video" ? <video controls preload="metadata" playsInline className="rounded-lg h-80" src={`${output.src}#t=0.001`} type={`${output.src?.endsWith("mp4") ? 'video/mp4' : "video/webm"}`}>
                </video> : type === "audio" ? <audio controls preload="metadata" className="w-full" src={output.src}>
                  Your browser does not support the audio element.
                </audio> : <img height="320" className="rounded-lg h-80" src={output.src} alt={`${title} example output ${idx + 1}`} />}
            </Frame>
          </Tab>)}
      </Tabs>}

  </>;

## Overview

Video to Video transforms existing videos by applying new styles, effects, and visual treatments while preserving the original motion and structure. The API enables style transfer, artistic effects, and visual enhancement of video content.

<ToolSection
  title="Video to Video"
  productSlug="video-to-video"
  apiSlug="video-to-video"
  type="video"
  outputs={[
{
  src: "https://videos.magichour.ai/cm4104vtm0juefg9sfncm1ukz/video.mp4",
},
{
  src: "https://videos.magichour.ai/clt68qas2001120vuergh7zyz/video.mp4",
},
]}
/>

## How It Works

1. **Provide a source video** - Upload the video you want to transform
2. **Describe the style** - Use a text prompt to describe the new visual style
3. **API transforms the video** - AI applies the style while preserving motion
4. **Download the result** - Retrieve your stylized video

## Use Cases

* **Style transfer** - Apply artistic styles to real footage
* **Brand consistency** - Apply consistent visual treatments across videos
* **Creative effects** - Transform videos into anime, painting, or other styles
* **Post-production** - Apply visual effects and color grading
* **Content repurposing** - Give old content a fresh visual look

## Best Practices

### Source Video Quality

<Tip>
  **Use stable, well-lit footage** - Consistent lighting and smooth motion produce the best style
  transfers.
</Tip>

* **Good lighting** - Even, consistent lighting throughout
* **Stable footage** - Tripod or stabilized footage works best
* **Clear subjects** - Well-defined subjects transfer styles better
* **Moderate motion** - Avoid extremely fast or chaotic motion

### Style Prompts

Choose a required `style.art_style`. Set `style.prompt_type` to `custom` to use your own prompt, or `append_default` to combine it with the preset prompt. The default prompt type ignores a supplied `style.prompt`.

Describe the visual style you want to apply:

**✅ Good prompts:**

* "Studio Ghibli anime style, soft colors, hand-painted look"
* "Oil painting style with thick brushstrokes and impressionist colors"
* "Cyberpunk neon aesthetic with high contrast and purple/pink color grading"
* "Vintage film look with grain, warm tones, and faded blacks"

**❌ Avoid:**

* Changing content: "Add a person" (this changes content, not style)
* Vague descriptions: "Make it better"
* Conflicting styles: "Realistic and cartoon"

### Style Categories

| Category      | Description              | Example Prompts                |
| :------------ | :----------------------- | :----------------------------- |
| Anime/Cartoon | Hand-drawn animated look | "Anime style, vibrant colors"  |
| Painting      | Traditional art styles   | "Oil painting, impressionist"  |
| Cinematic     | Film-like treatments     | "Vintage film, warm tones"     |
| Futuristic    | Modern/sci-fi aesthetics | "Cyberpunk, neon lights"       |
| Artistic      | Abstract/creative styles | "Abstract, geometric patterns" |

## Code Examples

### Basic Style Transfer

<CodeGroup>
  ```python Python theme={null}
  from magic_hour import Client
  import os

  client = Client(token=os.getenv("MAGIC_HOUR_API_KEY"))

  result = client.v1.video_to_video.generate(
      assets={
          "video_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/obamamicdrop.mov",
          "video_source": "file"
      },
      end_seconds=2,
      fps_resolution="HALF",
      start_seconds=0,
      style={
          "art_style": "Retro Anime",
          "prompt": "Obama's mic drop, on fire, burning, flames, retro anime, textured, symbolism, retrofuturism, (intricate:1.1), (detailed:1.1), (ornate:1.1), (aesthetic:1.1), (90's:1.1), (neon:1.0), (glowing:1.0), (flat colors:1.1), (flat texture:1.1)",
          "prompt_type": "custom",
          "version": "default"
      },
      name="Anime Mic Drop",
      wait_for_completion=True,
      download_outputs=True,
      download_directory="."
  )

  if result.status == "complete":
      print(f"✅ Video complete!")
      print(f"Downloaded to: {result.downloaded_paths}")
      print(f"Credits charged: {result.credits_charged}")
  else:
      print(f"Job ended with status: {result.status}")
      if result.error:
          print(f"Error: {result.error.message}")

  ```

  ```javascript Node.js theme={null}
  import { Client } from "magic-hour";

  const client = new Client({ token: process.env.MAGIC_HOUR_API_KEY });

  const result = await client.v1.videoToVideo.generate(
    {
      assets: {
        videoFilePath:
          "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/obamamicdrop.mov",
        videoSource: "file",
      },
      endSeconds: 2,
      fpsResolution: "HALF",
      startSeconds: 0,
      style: {
        artStyle: "Studio Ghibli",
        prompt: "Obama dropping the mic in anime style, soft pastel colors, whimsical and expressive",
        promptType: "custom",
        version: "default",
      },
      name: "Anime Mic Drop",
    },
    {
      waitForCompletion: true,
      downloadOutputs: true,
      downloadDirectory: ".",
    }
  );

  if (result.status === "complete") {
    console.log(`✅ Video complete!`);
    console.log(`Downloaded to: ${result.downloadedPaths}`);
  } else {
    console.error(`Job ended with status: ${result.status}`);
    if (result.error) console.error(result.error.message);
  }
  ```
</CodeGroup>

## Pricing

Video to Video uses credits based on video duration and frame rate. Credits are only charged for the frames that actually render — you'll see an estimate when the job is queued and the final total after it's done (in the job's `credits_charged` field).

| Factor     | Impact                      |
| :--------- | :-------------------------- |
| Duration   | More seconds = more credits |
| Frame rate | Higher FPS = more credits   |

## Resolution Limits

Output resolution is managed by the service and your subscription limits. The `width` and `height` request fields are deprecated and no longer affect output resolution. See [Resolution Limits](/billing/resolution-limits).

<Tip>
  **Try this in our Google Colab Cookbook:** [Run this API with sample
  code](https://colab.research.google.com/drive/1NTHL_lr_s-qBJ-mSecSXPzRLi9_V5JiU?usp=sharing). Just
  add your API key.
</Tip>

## API Reference

<Card title="Video to Video API Reference" icon="webhook" href="/api-reference/video-projects/video-to-video">
  View full API specification
</Card>

## Related Tools

<CardGroup cols={2}>
  <Card title="AI Video Editor" icon="wand-magic-sparkles" href="/tools/video/video-editor">
    Add, remove, or change video content with a prompt
  </Card>

  <Card title="Animation" icon="film" href="/tools/video/animation">
    Create animated videos from scratch
  </Card>

  <Card title="Image to Video" icon="image" href="/tools/video/image-to-video">
    Animate static images into videos
  </Card>
</CardGroup>
