본문으로 건너뛰기
cccskills
무료GitHub에 공개

ffmpeg-kit-macos-codesign-crash

Fix Flutter macOS app crash at launch due to FFmpeg Kit library loading failure. Use when: (1) macOS app builds successfully but crashes immediately on launch, (2) Crash log shows "Library not loaded: libfontconfig.1.dylib" or similar homebrew library, (3) Error mentions "code signature not valid for use in process" with "different Team IDs", (4) Using ffmpeg_kit_flutter_new (Full GPL variant). The Full GPL variant has external dependencies on homebrew libraries that fail macOS code signing. Switch to ffmpeg_kit_flutter_new_min.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

FFmpeg Kit macOS Code Signing Crash

Problem

Flutter macOS app builds successfully but crashes immediately at launch with a library loading failure. The crash is caused by FFmpeg Kit's Full GPL variant having runtime dependencies on homebrew-installed libraries (like fontconfig) that fail macOS code signature validation.

Context / Trigger Conditions

  • Platform: macOS only (iOS and Android are not affected)
  • Package: Using ffmpeg_kit_flutter_new (Full GPL variant)
  • Symptom: App builds successfully but crashes on launch
  • Crash log shows:
    Library not loaded: /opt/homebrew/*/libfontconfig.1.dylib
    Referenced from: .../libswresample.framework/...
    Reason: code signature in (.../libfontconfig.1.dylib) not valid for use in process:
    mapping process and mapped file (non-platform) have different Team IDs
    

Root Cause

The ffmpeg_kit_flutter_new package is the "Full GPL" variant which includes many FFmpeg libraries for advanced features like text rendering (drawtext filter). These libraries have external dependencies on system fonts via libfontconfig.

On macOS, when the app tries to load libswresample.framework, it attempts to also load libfontconfig.1.dylib from homebrew. macOS code signing validation rejects this because the homebrew library has a different Team ID than your app.

Solution

Switch from ffmpeg_kit_flutter_new (Full GPL) to ffmpeg_kit_flutter_new_min (Minimal).

Step 1: Update pubspec.yaml

# Before
ffmpeg_kit_flutter_new: ^3.2.0

# After
ffmpeg_kit_flutter_new_min: ^3.1.0

Step 2: Update imports in all Dart files

// Before
import 'package:ffmpeg_kit_flutter_new/ffmpeg_kit.dart';
import 'package:ffmpeg_kit_flutter_new/ffprobe_kit.dart';
import 'package:ffmpeg_kit_flutter_new/return_code.dart';

// After
import 'package:ffmpeg_kit_flutter_new_min/ffmpeg_kit.dart';
import 'package:ffmpeg_kit_flutter_new_min/ffprobe_kit.dart';
import 'package:ffmpeg_kit_flutter_new_min/return_code.dart';

Step 3: Clean and rebuild

flutter clean
rm -f macos/Podfile.lock
flutter pub get
flutter run -d macos

What Features Are Preserved

The minimal variant includes everything needed for typical video apps:

  • h264/libx264 video encoding
  • AAC audio encoding
  • VideoToolbox hardware acceleration (Apple platforms)
  • Standard filters: overlay, crop, scale, concat, amix
  • FFprobe for media information

What Features Are Removed

The minimal variant does NOT include:

  • drawtext filter (font rendering) - use PNG overlays instead
  • Advanced codec libraries with external dependencies
  • Features requiring fontconfig, freetype, etc.

Verification

After the fix:

  1. flutter run -d macos should launch the app without crashing
  2. Video encoding/decoding operations should work normally
  3. iOS builds continue to work (they weren't affected)

Example

Find files needing import updates:

grep -r "ffmpeg_kit_flutter_new" lib/ --include="*.dart" -l

Update all imports (sed example):

find lib -name "*.dart" -exec sed -i '' \
  's/ffmpeg_kit_flutter_new/ffmpeg_kit_flutter_new_min/g' {} \;

Notes

  • This issue only affects macOS; iOS and Android don't have the same code signing restrictions
  • The error message is misleading - it mentions fontconfig but the fix is changing FFmpeg Kit variants
  • If you actually need drawtext filter on macOS, you'd need to bundle fontconfig with proper signing (complex)
  • Alternative: Use the official ffmpeg_kit_flutter from arthenica if you need more control over variants

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y". Use when: (1) ExternalSecret shows OutOfSync in ArgoCD but won't sync, (2) ArgoCD application status shows "namespace X is not permitted in project 'infrastructure'", (3) ExternalSecret targets a namespace managed by a different ArgoCD project, (4) Using apps-of-apps pattern with separate infrastructure and application projects.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language. After selection, generates AI image prompts and visual briefs section-by-section. Use when the user shares content and needs visual direction, image sourcing, or creative direction for any material.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

Fix "Null check operator used on a null value" errors when an object is set to null during an async await. Use when: (1) Object reference is nullified while awaiting, (2) Code accesses object with ! after await returns, (3) Cancel/dispose operations run concurrently with async operations on same object. Solution: capture local reference before await.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

Add custom metadata headers (x-amz-meta-*) to AWS v4 signed requests for GCS S3-compatible API. Use when: (1) Adding custom metadata to GCS uploads via S3 API, (2) Getting signature mismatch errors after adding new headers, (3) x-amz-meta-* headers being ignored or causing 403 errors. Custom headers MUST be included in canonical headers and signed headers list.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings. Use when: (1) Password authentication fails with correct password, (2) Secret created with `<<< "value"` syntax, (3) Error like "password authentication failed" or "invalid token" despite correct value. Bash here-strings (`<<<`) add a trailing newline that corrupts secrets.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp). Use when: (1) Media moderation, transcoding, or analysis silently skips files from Blossom or content-addressed storage servers, (2) URL extraction from Nostr event tags (imeta, r tags) drops URLs without recognized extensions, (3) CDN fallback URLs append .mp4 but the actual server uses extensionless content-addressed paths like /{sha256}. Common in Nostr video events (kind 34236) where different clients use different URL formats.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

divinevideo/divine-mobile2662026년 10월 19일 업데이트

divinevideo의 스킬 모두 보기

이 스킬의 문제 신고