Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungChrome Already Has The Eyedropper You're Building(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungFor VS Code lovers, you can have a colored border and more from now...(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungNuxt Hydration Mismatch: Why It Happens and How to Fix It(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungYour Browser Is Rejecting Every Drop On Purpose(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungReact Derived State: Why That useState Is Probably a Bug(20.09.2026 um 18:27 Uhr)
Sichere ProgrammierungI tried OpenProject and Vikunja. Then I built Agila.(20.09.2026 um 18:37 Uhr)
Sichere ProgrammierungSkill Recorder keeps your screen local until you press Analyze(20.09.2026 um 18:38 Uhr)
Sichere ProgrammierungChrome Already Has The Eyedropper You're Building(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungFor VS Code lovers, you can have a colored border and more from now...(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungNuxt Hydration Mismatch: Why It Happens and How to Fix It(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungYour Browser Is Rejecting Every Drop On Purpose(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungReact Derived State: Why That useState Is Probably a Bug(20.09.2026 um 18:27 Uhr)
Sichere ProgrammierungI tried OpenProject and Vikunja. Then I built Agila.(20.09.2026 um 18:37 Uhr)
Sichere ProgrammierungSkill Recorder keeps your screen local until you press Analyze(20.09.2026 um 18:38 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Hardware Video Compression in Rust on macOS — ffmpeg with VideoToolbox

Reagiere als Erste:r — dein Feedback zählt!

All tests run on an 8-year-old MacBook Air. All results from shipping 7 Mac apps as a solo developer. No sponsored opinion.

HiyokoAutoSync optionally compresses videos during sync. Software compression on an 8-year-old MacBook Air is slow. Hardware compression via VideoToolbox is fast. Here's how to use ffmpeg's hardware acceleration from Rust.

VideoToolbox basics

VideoToolbox is Apple's hardware video encoding framework. ffmpeg supports it via the h264_videotoolbox encoder. The difference on Intel MacBook Air:

  • Software (libx264): 2-3 minutes for a 1-minute 4K video
  • Hardware (h264_videotoolbox): 15-30 seconds for the same video

For a sync app where users want to not think about it, this matters.

The ffmpeg command

ffmpeg -i input.mp4 \
  -c:v h264_videotoolbox \
  -b:v 5M \
  -c:a aac \
  -b:a 128k \
  output.mp4

h264_videotoolbox uses the hardware encoder. -b:v 5M sets video bitrate — adjust based on your quality/size tradeoff.

From Rust

use std::process::Command;

pub async fn compress_video(
    input: &Path,
    output: &Path,
    bitrate_mbps: u32,
) -> Result<(), AppError> {
    let bitrate = format!("{}M", bitrate_mbps);

    let status = tokio::task::spawn_blocking({
        let input = input.to_owned();
        let output = output.to_owned();
        move || {
            Command::new("ffmpeg")
                .args([
                    "-i", input.to_str().unwrap(),
                    "-c:v", "h264_videotoolbox",
                    "-b:v", &bitrate,
                    "-c:a", "aac",
                    "-b:a", "128k",
                    "-y", // overwrite output
                    output.to_str().unwrap(),
                ])
                .status()
        }
    }).await??;

    if !status.success() {
        return Err(AppError::Compression("ffmpeg failed".into()));
    }

    Ok(())
}

Fallback to software

VideoToolbox isn't available on all systems. Fallback gracefully:

async fn compress_with_fallback(input: &Path, output: &Path) -> Result<(), AppError> {
    // Try hardware first
    match compress_video_hw(input, output).await {
        Ok(()) => Ok(()),
        Err(_) => {
            log::warn!("Hardware encoding failed, falling back to software");
            compress_video_sw(input, output).await
        }
    }
}

Software fallback with libx264 is slower but reliable on any system.

Bundling ffmpeg

ffmpeg needs to be bundled with your Tauri app or assumed to be installed. I bundle a universal binary ffmpeg in the app resources. In tauri.conf.json:

{
  "bundle": {
    "resources": ["bin/ffmpeg"]
  }
}

Then access it via the resource directory at runtime.

TL;DR: Use ffmpeg's h264_videotoolbox encoder for hardware-accelerated video compression on macOS — 5-10x faster than libx264 on Intel Macs. Call via spawn_blocking in Rust, add a software fallback for systems where VideoToolbox isn't available, and bundle ffmpeg as a Tauri resource.

If this was useful, a ❤️ helps more than you'd think — thanks!

HiyokoAutoSync | X → @hiyoyok

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Hardware Video Compression in Rust on macOS — ffmpeg with VideoToolbox

Thematisch verwandte Begriffe: Hardware, Video, Compression, Rust · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick