패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.3.0

ffmpeg_cli

Dart에서 FFMPEG CLI 명령을 실행합니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
657
좋아요
49
Pub 점수
135

패키지 설치

flutter pub add ffmpeg_cli

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Dart 코드에서 직접 FFMPEG 명령줄 인터페이스(CLI) 명령을 실행할 수 있도록 해주는 Flutter/Dart 패키지입니다. 동영상 인코딩, 오디오 추출, 포맷 변환 등 다양한 멀티미디어 처리 작업을 여러 플랫폼에서 간단하고 효율적으로 수행할 수 있도록 도와줍니다. 원격 FFMPEG 바이너리와의 상호작용의 복잡성을 추상화하여 Flutter 애플리케이션 내에서 쉽게 사용할 수 있게 합니다. 플랫폼별로 특수한 코드를 작성하지 않고도 강력한 미디어 조작 기능이 필요한 개발자에게 이상적입니다.

사용 사례

  • 비디오 형식 변환
  • 비디오에서 오디오 추출
  • 미디어 파일 압축
  • 다중미디어 파일의 배치 처리
  • 실시간 비디오 인코딩

주요 기능

  • 크로스 플랫폼 지원
  • 간단한 CLI 명령 실행
  • Flutter 앱과의 통합
  • 모든 주요 OS 플랫폼 지원
  • 경량이고 사용하기 쉬움

적합한 대상

  • 미디어 중심 앱을 개발하는 개발자
  • 비디오/오디오 처리가 필요한 앱
  • 콘텐츠 제작자용 도구
  • 다중미디어를 포함하는 교육 프로젝트
  • Flutter를 사용한 백엔드 서비스

고려 사항

  • 대상 장치에 FFMPEG 바이너리가 필요합니다
  • 플랫폼별 설정이 필요할 수 있습니다
  • FFMPEG 종속성으로 인한 큰 바이너리 크기
  • 기본 사용에서의 오류 처리 제한
  • 성능은 장치 하드웨어에 따라 달라집니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

FFMPEG CLI - Run FFMPEG CLI commands from Dart

Built by the Flutter Bounty Hunters



Check out our Usage Guide


What is FFMPEG?

FFMPEG is a very popular, longstanding tool for reading, writing, and streaming audio and video content. Most developers use FFMPEG through its command-line interface (CLI), because that's much easier than interfacing with the C code upon which FFMPEG is built.

What is ffmpeg_cli

This package allows you to configure FFMPEG CLI commands with Dart code.

ffmpeg_cli purposefully retains the complexity of FFMPEG commands so that anything the FFMPEG CLI can do, the ffmpeg_cli package can do.

Quickstart

First, make sure that ffmpeg is installed on your device, and is available on your system path.

Compose an FFMPEG command with Dart:

// Define an output stream, which will map the filter
// graph to the video file. The ID names can be whatever
// you'd like.
const outputStream = FfmpegStream(
  videoId: "[final_v]", 
  audioId: "[final_a]",
);

// Compose your desired FFMPEG command, with inputs, filters, arguments,
// and an output location.
final command = FfmpegCommand(
  inputs: [
    FfmpegInput.asset("assets/intro.mp4"),
    FfmpegInput.asset("assets/content.mp4"),
    FfmpegInput.asset("assets/outro.mov"),
  ],
  args: [
    // Map the filter graph to the video file output.
    CliArg(name: 'map', value: outputStream.videoId!),
    CliArg(name: 'map', value: outputStream.audioId!),
    const CliArg(name: 'vsync', value: '2'),
  ],
  filterGraph: FilterGraph(
    chains: [
      FilterChain(
        inputs: [
          // Send all 3 video assets into the concat filter.
          const FfmpegStream(videoId: "[0:v]", audioId: "[0:a]"),
          const FfmpegStream(videoId: "[1:v]", audioId: "[1:a]"),
          const FfmpegStream(videoId: "[2:v]", audioId: "[2:a]"),
        ],
        filters: [
          // Concatenate 3 segments.
          ConcatFilter(
            segmentCount: 3, 
            outputVideoStreamCount: 1, 
            outputAudioStreamCount: 1,
          ),
        ],
        outputs: [
          // Give the output stream the given audio/video IDs
          outputStream,
        ],
      ),
    ],
  ),
  outputFilepath: "/my/output/file.mp4",
);

// Execute command
final process = await Ffmpeg().run(command: command);

How ffprobe support is managed

There are a lot of properties in ffprobe. Many of these properties can present in varying formats, which are not effectively documented.

The approach to ffprobe is to add missing result parameters as they are discovered and to add parsing functionality per property as the various possible formats are discovered. In other words, only do what is necessary in the given moment because the overall scope is too large and difficult to discover.

카테고리

의존성

의존성 목록 3 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.