# Fastest Audio & Image to Video Converter (MP4 Generator) (`erraja/fastest-audio-image-to-video`) Actor

Blazing-fast API to combine any cover image and audio track into a high-quality 1080p MP4 video in seconds.

- **URL**: https://apify.com/erraja/fastest-audio-image-to-video.md
- **Developed by:** [Mustapha er-raja](https://apify.com/erraja) (community)
- **Categories:** Videos, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 generated video mp4s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ⚡ Ultra-Fast Audio & Image to MP4 Video Converter API

The fastest, most reliable API for turning **audio tracks and cover artwork** into high-quality **1080p & 4K MP4 videos** in seconds.

Designed for content creators, developers, podcasters, music producers, and automated YouTube/TikTok channel workflows.

***

### 🚀 Why Choose This API?

- ⚡ **Blazing-Fast Render Engine**: Uses ultra-optimized stream copying to convert 1-hour audio files into MP4 videos in **seconds**, saving CPU time and money.
- 📁 **Flexible File Input**: Pass direct HTTP/HTTPS URLs (MP3, WAV, AAC, JPG, PNG) OR upload files directly from your computer using the UI form.
- 📐 **Smart Aspect Ratio Scaling**: Automatically scales and centers any image (square, portrait, landscape) with black pillar/letterboxing—**never distorts or stretches your art**.
- 🎥 **Multiple Resolutions**: Choose between `720p HD`, `1080p Full HD`, or `4K UHD`.
- 🏷️ **Optional Watermarking**: Add custom branded text banners to your videos automatically.
- ⏱️ **Duration Capping**: Cap output video duration to any length in seconds (great for teasers, Shorts, or fast testing).

***

### 🎯 Ideal Use Cases

- 📺 **YouTube Automation Channels**: Automatically convert lo-fi beats, ambient music, podcasts, or audiobook tracks into ready-to-upload YouTube videos.
- 🎙️ **Podcasters**: Generate full-episode videos or short audio teaser clips with podcast cover art.
- 🎵 **Music Labels & Producers**: Convert single releases, beat tapes, or album tracks into promo videos.
- 📱 **Social Media Shorts / Reels**: Trim short 30-second audio previews with custom artwork for social platforms.

***

### 📥 Input Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `imageUrl` | String | Yes\* | Direct HTTP/HTTPS link to cover image (JPG, PNG, WEBP). |
| `imageFile` | File / Key | Yes\* | Direct file upload from your PC (Overrides `imageUrl` if provided). |
| `audioUrl` | String | Yes\* | Direct HTTP/HTTPS link to audio track (MP3, WAV, AAC, M4A, OGG). |
| `audioFile` | File / Key | Yes\* | Direct file upload from your PC (Overrides `audioUrl` if provided). |
| `resolution` | String | No | Output dimensions: `"720p"`, `"1080p"` (default), or `"4k"`. |
| `watermarkText` | String | No | Custom text overlay banner (e.g. `"Uploaded via My Brand"`). |
| `maxDurationSeconds` | Integer | No | Cap video duration in seconds (`0` = full audio duration). |

*\* Either URL or PC File upload is required for both image and audio.*

***

### 💻 API Code Examples

#### 1. JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('mustapharajaa/fastest-audio-image-to-video').call({
    imageUrl: 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80',
    audioUrl: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
    resolution: '1080p',
    watermarkText: 'My Channel Name'
});

console.log('Video Output URL:', run.defaultDatasetId);
```

#### 2. Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')

run_input = {
    "imageUrl": "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80",
    "audioUrl": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
    "resolution": "1080p"
}

run = client.actor('mustapharajaa/fastest-audio-image-to-video').call(run_input=run_input)
print("Video Dataset ID:", run["defaultDatasetId"])
```

#### 3. cURL (REST API)

```bash
curl -X POST "https://api.apify.com/v2/acts/mustapharajaa~fastest-audio-image-to-video/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/cover.jpg",
    "audioUrl": "https://example.com/track.mp3",
    "resolution": "1080p"
  }'
```

***

### 📤 Output Dataset Format

Every successful API run returns a clean JSON response containing the public MP4 download link:

```json
{
  "success": true,
  "videoUrl": "https://api.apify.com/v2/key-value-stores/STORE_ID/records/video_1786162547.mp4",
  "durationSeconds": 372.4,
  "resolution": "1920x1080",
  "renderTimeSeconds": 3.82
}
```

***

### 🛡️ Support & Maintenance

This Actor is actively maintained with 99.9% uptime guarantees. If you need custom resolution presets or bulk automation integration, feel free to open an issue or contact support via the Apify Console.

# Actor input Schema

## `imageUrl` (type: `string`):

Paste direct image URL (JPG, PNG, WEBP). Leave empty if uploading a file below.

## `imageFile` (type: `string`):

Upload a cover image directly from your PC (Overrides URL above if uploaded).

## `audioUrl` (type: `string`):

Paste direct audio URL (MP3, WAV, AAC). Leave empty if uploading a file below.

## `audioFile` (type: `string`):

Upload an audio file directly from your PC (Overrides URL above if uploaded).

## `resolution` (type: `string`):

Target video output dimensions.

## `watermarkText` (type: `string`):

Optional text watermark banner overlay.

## `maxDurationSeconds` (type: `integer`):

Cap output video duration in seconds (0 = full audio length).

## Actor input object example

```json
{
  "imageUrl": "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80",
  "audioUrl": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
  "resolution": "1080p",
  "maxDurationSeconds": 0
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrl": "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80",
    "audioUrl": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
};

// Run the Actor and wait for it to finish
const run = await client.actor("erraja/fastest-audio-image-to-video").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrl": "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80",
    "audioUrl": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
}

# Run the Actor and wait for it to finish
run = client.actor("erraja/fastest-audio-image-to-video").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrl": "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=1280&q=80",
  "audioUrl": "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
}' |
apify call erraja/fastest-audio-image-to-video --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,erraja/fastest-audio-image-to-video"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/XP4skb11DqM64XuCX/builds/yRr7ferqW4lVYAkst/openapi.json
