Coder Social home page Coder Social logo

ffmpeg-ios's Introduction

FFmpeg-iOS

This Swift package enables you to use FFmpeg libraries in your iOS, Mac Catalyst and tvOS apps.

Installation

.package(url: "https://github.com/kewlbear/FFmpeg-iOS.git", from: "0.0.6-b")

Usage

import FFmpegSupport

ffmpeg(["ffmpeg", "-i", "in.webm", "out.mp4"])

See https://github.com/kewlbear/YoutubeDL-iOS.

Building Libraries

You can install build tool

$ mint install kewlbear/FFmpeg-iOS

or run from source.

Swift Package Manager

git clone https://github.com/kewlbear/FFmpeg-iOS.git
cd FFmpeg-iOS

You should omit "swift run" from following commands if you installed build tool.

To download FFmpeg source and build .xcframeworks:

$ swift run ffmpeg-ios

To build fat libraries:

$ swift run ffmpeg-ios --disable-xcframework 

To download x264 source and build fat libraries:

$ swift run ffmpeg-ios x264 --disable-xcframework

For other usages:

$ swift run ffmpeg-ios -h
OVERVIEW: Build FFmpeg libraries for iOS as xcframeworks

USAGE: ffmpeg-ios <subcommand>

OPTIONS:
 -h, --help              Show help information.

SUBCOMMANDS:
 build (default)         Build framework module
 framework               Create .xcframework
 module                  Enable modules to allow import from Swift
 fat                     Create fat library
 dep                     Install build dependency
 source                  Download library source code

 See 'ffmpeg-ios help <subcommand>' for detailed help.
 $ swift run ffmpeg-ios build -h
 OVERVIEW: Build framework module

 USAGE: ffmpeg-ios build <options>

 ARGUMENTS:
   <lib>                   ffmpeg, fdk-aac, lame or x264 (default: ffmpeg)

 OPTIONS:
   --enable-libfdk-aac     enable AAC de/encoding via libfdk-aac 
   --enable-libx264        enable H.264 encoding via x264 
   --enable-libmp3lame     enable MP3 encoding via libmp3lame 
   --disable-xcframework   Create fat library instead of .xcframework 
   --disable-module
   --source-directory <source-directory>
                           Library source directory (default: ./<lib>) 
   --build-directory <build-directory>
                           directory to contain build artifacts (default: ./build)
   --arch <arch>           architectures to include (default: arm64, x86_64)
   --library <library>     libraries to include (default: avcodec, avdevice, avfilter, avformat, avutil, swresample, swscale)
   --deployment-target <deployment-target>
                           (default: 12.0)
   --extra-options <extra-options>
                           additional options for configure script 
   --release <release>     FFmpeg release (default: snapshot)
   --url <url>
   --frameworks <frameworks>
                           (default: ./Frameworks)
   --output <output>       default: <lib>-fat 
   --fdk-aac-source <fdk-aac-source>
                           (default: ./fdk-aac-2.0.1)
   --x264-source <x264-source>
                           (default: ./x264-master)
   --lame-source <lame-source>
                           (default: ./lame-3.100)
   -h, --help              Show help information.

$

License

LGPL v2.1+

ffmpeg-ios's People

Contributors

kewlbear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ffmpeg-ios's Issues

No such module 'avformat'

Hi man, great work. Thanks for your time.

I have some issue when I tray to import avformat I get this error "No such module 'avformat'".
Do I missed some steps?

"Assertion failed: Expected 1 archs in otool output" at distribution stage

In an open source project, we have this example app that depends on FFmpeg-iOS (see here). First, thanks a lot for that ๐Ÿ™‚.

When going into the "distribution" stage of the app, the following error occurs:

2021-04-13 19:54:30 +0000  Assertion failed: Expected 1 archs in otool output:
Archive : /var/folders/fk/9kh981v9165g2t1yh3lbrkcst96_15/T/IDEDistributionOptionThinning.~~~iSjBnA/Payload/MAVSDK_Swift_Example.app/Frameworks/libavcodec.a (architecture arm64)
/var/folders/fk/9kh981v9165g2t1yh3lbrkcst96_15/T/IDEDistributionOptionThinning.~~~iSjBnA/Payload/MAVSDK_Swift_Example.app/Frameworks/libavcodec.a(012v.o) (architecture arm64):
Mach header
      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64    ARM64        ALL  0x00      OBJECT     5        856 SUBSECTIONS_VIA_SYMBOLS
Load command 0
.....

Would you have an idea what that means? We thought that there were maybe non-arm64 symbols in libavcodec.a, but we only found arm64 symbols there...

Automatic encoder selection failed Default encoder for format mp3

let result = ffmpeg(["ffmpeg", "-i", source.path, destination])

encountered an error while I was converting .m4a to .mp3:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/private/var/mobile/Containers/Shared/AppGroup/1ECB4F4A-3F79-4E52-A290-78F4F12BAFF9/File Provider Storage/test.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A isommp42
creation_time : 2020-06-03T13:20:08.000000Z
iTunSMPB : 00000000 00000840 0000039D 00000000005B3423 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
voice-memo-uuid : 3A3C853F-58D9-41C9-992B-106FD926A185
encoder : com.apple.VoiceMemos (iOS 13.4.1)
Duration: 00:02:04.59, start: 0.044000, bitrate: 68 kb/s
Stream #0:00x1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 64 kb/s (default)
Metadata:
creation_time : 2020-06-03T13:20:08.000000Z
handler_name : Core Media Audio
vendor_id : [0][0][0][0]
[aost#0:0 @ 0x10b83ab90] Automatic encoder selection failed Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually.
[aost#0:0 @ 0x10b83ab90] Error selecting an encoder

Build error

After installing via SPM I get the following error upon the first build:

'sortedKeys' is only available in iOS 11.0 or newer

in the file DumpHelpGenerator.swift in line 30.

Installation/Build Error

error: target at '..../SourcePackages/checkouts/FFmpeg-iOS/Sources/Tool' contains mixed language source files; feature not supported

Running into a mixed language in target error, any idea how to fix? At least locally?

This occurs after a certain stage when I run swift run ffmpeg-ios

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.