Langsung ke konten
Skillpedia
Edit video7.8k · #12886

ffmpeg-encoder-check

Fungsinya

Skill ini menunjukkan cara mencantumkan encoder H.264 FFmpeg dan memilih yang terbaik untuk komputer tersebut. Skill ini cocok untuk orang yang melakukan encoding video dan ingin menghindari masalah codec.

Kapan dipakai

  • ✓Saat saya perlu mengonversi atau mengenkode video dengan FFmpeg.
  • ✓Saat pekerjaan video gagal karena ketidakcocokan versi pustaka.
  • ✓Saat video sumber saya sudah sesuai dengan format yang saya inginkan dan tidak perlu di-encode ulang.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/ffmpeg-encoder-check/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/ffmpeg-encoder-check/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Konversi video saya dengan FFmpeg. Periksa dulu encoder H.264 apa saja yang terpasang, supaya pekerjaannya tidak gagal.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI mencantumkan encoder yang ada di sistem, membandingkannya dengan tabel pilihan, dan memilih penyalinan stream, libx264, encoder perangkat keras, atau pilihan lain yang tersedia.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

FFmpeg Encoder Availability Check

Purpose

Before writing video encoding scripts, always verify which H.264 encoders are available in your FFmpeg installation. This prevents failures from library version mismatches, particularly with libopenh264.

Instructions

Step 1: Probe Available Encoders

Run the following command to check available H.264 encoders:

ffmpeg -encoders 2>/dev/null | grep h264

This shows which H.264 encoders are compiled into your FFmpeg build.

Step 2: Interpret Results

Common encoder options you may see:

Encoder Description Recommendation
libx264 Software H.264 encoder Preferred - widely compatible
libopenh264 OpenH264 software encoder Use with caution - often has library version mismatches
h264_nvenc NVIDIA hardware encoder Good if NVIDIA GPU available
h264_videotoolbox macOS hardware encoder Good on macOS
h264_vaapi Intel VAAPI hardware encoder Good on Linux with Intel GPU
h264_qsv Intel QuickSync encoder Good on Windows/Linux with Intel GPU

Step 3: Choose Encoding Strategy

For same-resolution sources (no re-encoding needed):

# Best option - pass-through without quality loss
ffmpeg -i input.mp4 -c:v copy -c:a copy output.mp4

If libx264 is available:

# Reliable software encoding
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -c:a aac output.mp4

If only libopenh264 is available:

# Use with caution - may have library issues
ffmpeg -i input.mp4 -c:v libopenh264 -c:a aac output.mp4

Step 4: Validate Before Batch Processing

Always test your encoding command on a small sample file before processing multiple videos or long footage.

Best Practices

  1. Default to -c:v copy when source and target resolutions match - no quality loss, fastest processing
  2. Prefer libx264 over libopenh264 for software encoding - more stable, better compatibility
  3. Check encoder availability at script startup, not during execution - fail fast with clear error
  4. Cache encoder check results if running multiple encoding operations in the same session
  5. Provide fallback options in automated scripts - try copy first, then libx264, then fail gracefully

Example Script Template

#!/bin/bash

# Check available encoders at startup
ENCODERS=$(ffmpeg -encoders 2>/dev/null | grep h264)

if echo "$ENCODERS" | grep -q "libx264"; then
    VIDEO_CODEC="libx264"
    echo "Using libx264 encoder"
elif echo "$ENCODERS" | grep -q "libopenh264"; then
    VIDEO_CODEC="libopenh264"
    echo "Warning: Using libopenh264 (may have compatibility issues)"
else
    echo "Error: No H.264 encoder available"
    echo "Available encoders:"
    echo "$ENCODERS"
    exit 1
fi

# For same-resolution sources, prefer copy
if [ "$SOURCE_RESOLUTION" = "$TARGET_RESOLUTION" ]; then
    VIDEO_CODEC="copy"
    echo "Same resolution detected - using stream copy"
fi

# Encode
ffmpeg -i "$INPUT" -c:v "$VIDEO_CODEC" -c:a aac "$OUTPUT"

Common Errors to Avoid

  • Do not assume libx264 is available - FFmpeg builds vary by system
  • Do not use libopenh264 without checking - frequent library version mismatch errors
  • Do not re-encode unnecessarily - use -c:v copy when resolution matches
  • Do not skip the encoder check - always probe before writing encoding logic
Pertanyaan umum

Encoder mana yang paling luas kompatibilitasnya?

Panduan ini menyatakan bahwa libx264 lebih disukai dan luas kompatibilitasnya.

Bergantung pada apa encoder perangkat keras?

Encoder perangkat keras bergantung pada perangkat grafis di komputer, seperti chip NVIDIA, Apple, atau Intel.

Mengapa libopenh264 dihindari?

Panduan ini menyatakan bahwa libopenh264 sering mengalami ketidakcocokan versi pustaka.

Detail

Deskripsi asli dari pembuat

Check FFmpeg encoder availability before video encoding to avoid library mismatches

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#12886
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa