Docs
GB-Seconds

Understanding GB-Seconds

GB-Seconds is the unit of measurement used to calculate your usage and billing for the FFmpeg API. It combines both the size of your media files and the time it takes to process them into a single, easy-to-understand metric.

What are GB-Seconds?

GB-Seconds represent the total computational resources consumed during media processing. The calculation is straightforward:

GB-Seconds = (Input Size + Output Size in GB) × Processing Time in Seconds

ℹ️

Think of GB-Seconds as a way to measure both the "weight" of your files and how long they take to process. Larger files or longer processing times result in higher GB-Second usage.

How GB-Seconds are Calculated

Let's break down the formula with practical examples:

Example 1: Simple Video Conversion

  • Input file: 2 GB MP4 video
  • Output file: 1.5 GB MP4 video (compressed)
  • Processing time: 30 seconds

Calculation: (2 + 1.5) × 30 = 105 GB-Seconds

Example 2: Audio Extraction

  • Input file: 500 MB video file (0.5 GB)
  • Output file: 50 MB audio file (0.05 GB)
  • Processing time: 10 seconds

Calculation: (0.5 + 0.05) × 10 = 5.5 GB-Seconds

Example 3: Multiple Output Files

  • Input file: 1 GB video
  • Output files: 800 MB + 600 MB + 400 MB = 1.8 GB total
  • Processing time: 45 seconds

Calculation: (1 + 1.8) × 45 = 126 GB-Seconds

Factors That Affect GB-Second Usage

Understanding what influences your GB-Second consumption helps you optimize costs:

File Size Factors

  • Input file size: Larger source files increase GB-Second usage
  • Output file size: Multiple outputs or high-quality outputs add to the total
  • Compression efficiency: Better compression reduces output size

Processing Time Factors

  • Video complexity: High-resolution videos take longer to process
  • Audio channels: Multi-channel audio increases processing time
  • Encoding settings: Higher quality settings require more processing time
  • Filter complexity: Advanced filters and effects extend processing duration
⚠️

Processing time can vary based on system load and file complexity. The same operation might take different amounts of time on different occasions.

Optimizing Your GB-Second Usage

Here are strategies to minimize your GB-Second consumption:

1. Optimize Input Files

  • Pre-compress large files when possible
  • Remove unnecessary audio tracks or streams
  • Trim videos to only include needed segments

2. Choose Efficient Output Settings

  • Use appropriate quality settings - higher isn't always better
  • Select efficient codecs like H.264 or H.265
  • Avoid unnecessary high resolutions for your use case

3. Batch Process Efficiently

  • Combine multiple operations in a single API call when possible
  • Process similar files together to benefit from optimizations

Billing and Usage Tracking

Your GB-Second usage is tracked in real-time and displayed in your dashboard. You can:

  • Monitor current usage throughout the billing period
  • View detailed breakdowns of each API call
ℹ️

GB-Seconds are rounded to the nearest hundredth (0.01) for billing purposes. Very quick operations on small files typically result in minimal charges.

Common Questions

Why GB-Seconds Instead of Just Processing Time?

GB-Seconds provide a more accurate measure of computational resources. A 10-second process on a 100 MB file consumes far fewer resources than a 10-second process on a 10 GB file.

Are Failed Requests Charged?

No, only successful processing operations that produce output files are charged. Failed requests due to invalid input or API errors are not billed.

How Are Partial Seconds Handled?

Processing time is measured precisely and can include fractions of seconds. For example, a 2.3-second process is billed as 2.3 seconds, not rounded up to 3 seconds.

Getting Started

Ready to start using the FFmpeg API? Check out our authentication guide to get your API key and begin processing media files efficiently.

Understanding GB-Seconds helps you make informed decisions about your media processing needs and optimize your usage for cost-effectiveness.