Skip to main content

A blazing fast video editing library wrapping FFmpeg native filters.

Project description

core-flux (Concisely Optimized Render Engine - FFmpeg Linear User Xtension)

A high-performance video editing library built entirely on top of native FFmpeg filters. By bypassing Python-level pixel manipulation and compiling operations directly into a single native filter graph, core-flux runs at maximum speed with a beautiful, chainable API.


Installation

pip install core-flux

Quick Start

from fastvideo import FastVideo

# Trim, resize, adjust colors, and render instantly
video = FastVideo("input.mp4")
video.trim(2, 12).resize(1280, 720).adjust_colors(contrast=1.2, saturation=1.5).render("output.mp4")

Features

  • Chainable API — Compose operations fluently in a single, readable expression.
  • FFmpeg-Native Speed — Zero Python processing bottleneck; your timeline is compiled into a native C-level graph.
  • Audio Control — Easily scale, replace, or remove audio streams.
  • Silent-File Safe — Audio filters are automatically skipped when no audio stream is detected.

API Reference

FastVideo(input_path: str)

Load a media file for editing. Automatically detects whether the file contains an audio stream.

video = FastVideo("input.mp4")

Video Operations

.resize(width: int, height: int)

Scale the video to the given dimensions in pixels.

video.resize(1920, 1080)

.crop(x1: int, y1: int, width: int, height: int)

Crop a rectangular region of the video, starting from the top-left corner (x1, y1).

video.crop(100, 50, 1280, 720)

.rotate(angle: int)

Rotate the video. Supported angles are 90, 180, and 270 degrees.

video.rotate(90)

.trim(start_time: float, end_time: float)

Cut the video (and audio, if present) between two timestamps in seconds.

video.trim(0, 10)

.fade_out(start_fade: float, duration: float = 1.0)

Add a smooth fade-to-black effect starting at start_fade seconds.

video.fade_out(start_fade=8.0, duration=2.0)

.adjust_colors(contrast: float = 1.0, brightness: float = 0.0, saturation: float = 1.0)

Adjust contrast, brightness, and saturation. Values above 1.0 increase the effect; below 1.0 decrease it.

video.adjust_colors(contrast=1.2, saturation=1.5)

.blackwhite()

Convert the video to black and white.

video.blackwhite()

.speedx(factor: float)

Speed up or slow down both video and audio by a multiplier. 2.0 is double speed; 0.5 is half speed.

video.speedx(1.5)

Audio Operations

.with_volume_scaled_to(factor: float)

Scale the audio volume. 0.5 halves it; 2.0 doubles it. No-op if the source has no audio.

video.with_volume_scaled_to(0.5)

.without_audio()

Remove the audio stream entirely from the output.

video.without_audio()

.replace_audio(new_audio_path: str)

Swap the current audio track with an external audio file.

video.replace_audio("soundtrack.mp3")

Rendering

.render(output_path: str, format_type: str = 'video')

Compile the filter graph and write the result to disk.

The format_type parameter controls the output mode:

Value Description
'video' Standard video with audio (default). Encodes with H.264 + AAC.
'gif' Animated GIF with palette optimization for clean output.
'audio' Extracts the audio stream only. Outputs MP3 or AAC based on file extension.
# Standard video
video.render("output.mp4")

# Animated GIF
video.render("output.gif", format_type='gif')

# Audio only
video.render("output.mp3", format_type='audio')

Note: Passing format_type='audio' on a source file with no audio stream raises a ValueError.


Requirements

  • Python 3.8+
  • FFmpeg installed and available on your PATH

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

core_flux-0.3.0b1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

core_flux-0.3.0b1-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file core_flux-0.3.0b1.tar.gz.

File metadata

  • Download URL: core_flux-0.3.0b1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.33.0

File hashes

Hashes for core_flux-0.3.0b1.tar.gz
Algorithm Hash digest
SHA256 48c33d0590c2527c2bfd9e6e8829a9bdc7be4fd17d0e03d5541016340427dbcf
MD5 6298850897e1115ebf62e48d4eee5227
BLAKE2b-256 77da8eb92750dec53e7283deb27e4c9732887af4749d8a8590cffdec78ffcc09

See more details on using hashes here.

File details

Details for the file core_flux-0.3.0b1-py2.py3-none-any.whl.

File metadata

  • Download URL: core_flux-0.3.0b1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.33.0

File hashes

Hashes for core_flux-0.3.0b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 156dd0f38aee5d278f8cb19275746c2dfa7b2577d1b3c26df34391829e7ebaac
MD5 2bf207f9673d1c329d13a5e0d95e534c
BLAKE2b-256 ae09cf15c78e4f51f16aca165b1a993cdbb269fed516f82a9a61cdc3a25cec77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page