Skip to content

Cut

# Video Cut API

Pricing

35 credits per request

Fixed cost regardless of video length or number of cuts.

Overview

The Video Cut API allows you to extract multiple segments from a media file (video or audio) and merge them into a single output file. Perfect for creating highlights, removing unwanted sections, or combining specific parts of your media files.

Domain: api.revidapi.com


Endpoint

POST https://revidapi.com/v1/video/cut

Authentication: Required - Header x-api-key


Request

Headers

  • x-api-key: Required. Your API key for authentication.
  • Content-Type: Required. Must be application/json.

Body Parameters

Required Parameters

Parameter Type Required Default Description
media_url string (URI) ✅ Yes - URL of the media file to be cut
cuts array ✅ Yes - Array of cut segments [{start, end}, ...]

Optional Parameters

Parameter Type Required Default Description
video_codec string ❌ No libx264 Video codec for encoding output
video_preset string ❌ No medium Video preset for encoding
video_crf number ❌ No 23 Constant Rate Factor (0-51, lower = better quality)
audio_codec string ❌ No aac Audio codec for encoding output
audio_bitrate string ❌ No 128k Audio bitrate for encoding
webhook_url string (URI) ❌ No - URL to receive the result when processing is complete
id string ❌ No - Custom identifier for tracking the request

cuts Format

Each cut segment must specify start and end times:

[
  {
    "start": "00:00:10.000",  // Start time (hh:mm:ss.ms)
    "end": "00:00:20.000"     // End time (hh:mm:ss.ms)
  },
  {
    "start": "00:00:30.000",
    "end": "00:00:40.000"
  }
]

Time Format: hh:mm:ss.ms (hours:minutes:seconds.milliseconds)

Video Cutting Illustration

Below is a visual representation of how multiple cuts are processed:


Response

Immediate Response (Task Created)

{
  "code": 200,
  "id": "unique-request-id",
  "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
  "response": {
    "file_url": "https://example.com/output.mp4"
  },
  "message": "success",
  "run_time": 5.234,
  "queue_time": 0.012,
  "total_time": 5.246,
  "pid": 12345,
  "queue_id": 1234567890,
  "queue_length": 0,
  "build_number": "1.0.0"
}

Error Responses

400 Bad Request

Returned when the request payload is missing or invalid.

{
  "code": 400,
  "message": "Invalid request payload"
}

401 Unauthorized

Returned when the x-api-key header is missing or invalid.

{
  "code": 401,
  "message": "Unauthorized"
}

500 Internal Server Error

Returned when an unexpected error occurs on the server.

{
  "code": 500,
  "message": "Internal Server Error"
}

Example Requests

Example 1: Basic Cut (Single Segment)

curl -X POST \
  https://revidapi.com/v1/video/cut \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "media_url": "https://example.com/video.mp4",
    "cuts": [
      {
        "start": "00:00:10.000",
        "end": "00:00:20.000"
      }
    ]
  }'

Example 2: Multiple Cuts with Custom Encoding

curl -X POST \
  https://revidapi.com/v1/video/cut \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "media_url": "https://example.com/video.mp4",
    "cuts": [
      {
        "start": "00:00:10.000",
        "end": "00:00:20.000"
      },
      {
        "start": "00:00:30.000",
        "end": "00:00:40.000"
      }
    ],
    "video_codec": "libx264",
    "video_preset": "medium",
    "video_crf": 23,
    "audio_codec": "aac",
    "audio_bitrate": "128k",
    "webhook_url": "https://example.com/webhook",
    "id": "unique-request-id"
  }'

Processing Time

Video Length Number of Cuts Processing Time
< 5 minutes 1-3 cuts ~10-30 seconds
5-15 minutes 3-5 cuts ~30-60 seconds
15-30 minutes 5-10 cuts ~1-3 minutes
> 30 minutes 10+ cuts ~3-10 minutes

Times may vary based on video resolution, number of cuts, encoding settings, and server load.


Use Cases

1. Video Highlights

Extract the best moments from a longer video to create highlight reels.

2. Remove Unwanted Sections

Cut out commercials, pauses, or unwanted content from videos.

3. Create Montages

Combine multiple segments from different parts of a video into a single montage.

4. Audio Editing

Extract specific audio segments from podcasts or music files.

5. Content Repurposing

Create shorter versions of long-form content for social media.


Best Practices

  1. Time Format:
  2. Always use hh:mm:ss.ms format for start and end times
  3. Ensure end time is after start time for each cut
  4. Avoid overlapping cuts if you want clean segments

  5. Encoding Settings:

  6. Use video_crf values between 18-28 (lower = better quality)
  7. medium preset provides good balance between speed and quality
  8. Default settings are optimized for most use cases

  9. Multiple Cuts:

  10. Cuts are extracted and merged in the order specified
  11. Segments can come from any part of the original video
  12. Total output length = sum of all cut durations

  13. Webhooks:

  14. Use webhook_url for async processing
  15. Monitor queue_length to manage API load
  16. Use id parameter for request tracking

  17. File URLs:

  18. Ensure media_url is accessible and points to valid media file
  19. Supported formats: MP4, AVI, MOV, MKV, MP3, WAV, etc.

Limitations

  • Max file size: Typically 500 MB (check server limits)
  • Supported formats: Any format supported by FFmpeg (MP4, AVI, MOV, MKV, MP3, WAV, etc.)
  • Time format: Must use hh:mm:ss.ms format exactly
  • Processing timeout: 10 minutes per request
  • Maximum cuts: No hard limit, but more cuts = longer processing time

Troubleshooting

Error: Invalid request payload

Cause: Missing required parameters or invalid format
Solution: Ensure media_url and cuts array are provided with correct format

Error: Invalid time format

Cause: Time format not in hh:mm:ss.ms
Solution: Use exact format: 00:00:10.000 (hours:minutes:seconds.milliseconds)

Error: End time before start time

Cause: End time is earlier than start time in a cut segment
Solution: Ensure end time is after start time for each cut

Error: File not accessible

Cause: media_url is invalid or not accessible
Solution: Verify URL is valid and file is publicly accessible (or use signed URLs)

Processing timeout

Cause: Video too long or too many cuts
Solution: - Split into smaller batches - Reduce video resolution before cutting - Reduce number of cuts per request


Get Job Status

After submitting a job, you can check its status using the job_id returned in the response.

Endpoint

URL Path: https://revidapi.com/v1/job/status
HTTP Method: POST

Request

Headers

  • x-api-key (required): API key for authentication.
  • Content-Type: application/json

Body Parameters

{
  "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
}

Example Request

curl -X POST \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"}' \
  https://revidapi.com/v1/job/status

Response

Success Response

{
  "endpoint": "/v1/job/status",
  "code": 200,
  "id": null,
  "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
  "response": {
    "job_status": "done",
    "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "queue_id": 140368864456064,
    "process_id": 123456,
    "response": {
      "endpoint": "/v1/endpoint/name",
      "code": 200,
      "id": "request-123",
      "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
      "response": "https://cloud-storage.example.com/output.mp4",
      "message": "success",
      "pid": 123456,
      "queue_id": 140368864456064,
      "run_time": 2.345,
      "queue_time": 0.123,
      "total_time": 2.468,
      "queue_length": 0,
      "build_number": "1.0.0"
    }
  },
  "message": "success",
  "pid": 123456,
  "queue_id": 140368864456064,
  "run_time": 0.001,
  "queue_time": 0.0,
  "total_time": 0.001,
  "queue_length": 0,
  "build_number": "1.0.0"
}

Error Responses

  • 404 Not Found: If the job with the provided job_id is not found:
{
  "error": "Job not found",
  "job_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
}
  • 500 Internal Server Error: If an unexpected error occurs:
{
  "error": "Failed to retrieve job status: <error_message>",
  "code": 500
}