module Fluorite::Docs::D_PRESETS::CONVERSION_PRESETS

Overview

Smart Conversion Presets

Fluorite includes pre-calculated, battle-tested presets for frequent media conversion tasks. These presets encapsulate the complex mathematical calculations and multi-pass filtergraphs required for professional-grade video encoding.

Executive Summary & Key Topics

Topic Method / Anchor Description
Discord File Size Optimization .topic_01_discord_budgeting Guaranteeing uploads fit under Discord limits without rejection.
2-Pass Palette GIF Generation .topic_02_crisp_gif Generating high-definition GIFs with custom color palettes.
Instant Lossless Trimming .topic_03_lossless_cut Cutting clips in milliseconds with stream copy (-c copy).

Related Guides & Source References

Defined in:

fluorite/docs/d_presets/conversion_presets.cr

Class Method Summary

Class Method Detail

def self.topic_01_discord_budgeting : Nil #

Discord File Size Optimization: Guaranteeing uploads fit under Discord limits without rejection.

Discord rejects attachments exceeding upload limits (10MB, 25MB, or 50MB). Fluorite's Discord preset queries duration via ffprobe, allocates total bits across video and audio, and transcodes the video to guarantee it fits under the limit with maximal visual fidelity:

Fluorite::Presets::Discord.convert("long_recording.mp4", "discord_upload.mp4", target_mb: 25.0)

def self.topic_02_crisp_gif : Nil #

2-Pass Palette GIF Generation: Generating high-definition GIFs with custom color palettes.

Standard GIF converters generate blurry, dithered artifacts. Fluorite uses a 2-pass filtergraph generating a full 256-color palette with Lanczos scaling:

Fluorite::Presets::Gif.convert("screen_record.mov", "demo.gif", fps: 15, width: 480)

def self.topic_03_lossless_cut : Nil #

Instant Lossless Trimming: Cutting clips in milliseconds with stream copy (-c copy).

Cut any section of video without re-encoding:

Fluorite::Presets::Trim.cut("movie.mp4", "clip.mp4", from: "00:01:30", to: "00:02:15")