ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

How to use my custom building?

Open guivr opened this issue 3 years ago • 7 comments

Hi, sorry for being a noob.

I've managed to build my own "ios" FFmpeg Building by following the documentation.

What I couldn't find was how do I use the "prebuit" files and folders now? I'm using ffmpeg-kit in Flutter and couldn't find where to paste folders such as "apple-ios-arm64" etc that were generated by the building script.

Thanks for the help!

guivr avatar Aug 19 '22 07:08 guivr

These steps should work:

  1. Clone ffmpeg-kit project repository
  2. Go inside the flutter/flutter folder and edit the ffmpeg_kit_flutter.podspec file
  3. What you must do in ffmpeg_kit_flutter.podspec is to tell cocoapods not to download ffmpeg-kit-ios packages and use your local copy. There are different ways to do that
  • You can create a new subspec and change the default subspec to do that new one
  • Or modify the entries in the default subspec, delete the ffmpeg-kit-ios dependency and add your local dependency there
  • Or delete all subspecs and add your local dependency to the file
  1. Project Layout wiki lists the type of outputs we have under the prebuilt directory. Files (frameworks) you need to use are under the bundle-apple-xcframework-ios folder. You must give full paths of them when defining the dependency or put into a place where cocoapods can access them
  2. I'm not exactly sure about the latest Podspec syntax to define a local dependency. There are posts like this on Stackoverflow. Try the suggestions given there please
  3. Update your pubspec.yaml to load ffmpeg_kit_flutter from the local ffmpeg-kit repository you just modified.

tanersener avatar Aug 19 '22 09:08 tanersener

Thanks a lot, @tanersener

By the way, my main goal is to use the "rubberband" effect only. Is there an easy way to get it with the flutter package on pub etc with "rubberband" enabled (GPL) instead of making custom buildings?

I've tried using the full_gpl but still throws No such filter: 'rubberband'

guivr avatar Aug 21 '22 03:08 guivr

No, none of the ffmpeg-kit packages include rubberband inside. See Packages.

tanersener avatar Aug 21 '22 21:08 tanersener

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 21 '22 03:10 github-actions[bot]

These steps should work:

  1. Clone ffmpeg-kit project repository
  2. Go inside the flutter/flutter folder and edit the ffmpeg_kit_flutter.podspec file
  3. What you must do in ffmpeg_kit_flutter.podspec is to tell cocoapods not to download ffmpeg-kit-ios packages and use your local copy. There are different ways to do that
  • You can create a new subspec and change the default subspec to do that new one
  • Or modify the entries in the default subspec, delete the ffmpeg-kit-ios dependency and add your local dependency there
  • Or delete all subspecs and add your local dependency to the file
  1. Project Layout wiki lists the type of outputs we have under the prebuilt directory. Files (frameworks) you need to use are under the bundle-apple-xcframework-ios folder. You must give full paths of them when defining the dependency or put into a place where cocoapods can access them
  2. I'm not exactly sure about the latest Podspec syntax to define a local dependency. There are posts like this on Stackoverflow. Try the suggestions given there please
  3. Update your pubspec.yaml to load ffmpeg_kit_flutter from the local ffmpeg-kit repository you just modified.

Can you please explain steps to do so for flutter android?

mhbdev avatar Jul 19 '23 22:07 mhbdev

@tanersener have you gotten custom builds working with flutter or react-native before?

I am able to do the build but can't figure out how to add the local frameworks in bundle-apple-xcframework-ios as dependencies to ffmpeg-kit-react-native.podspec.

I tried the link in your step 5 above but couldn't get it to pick up the xcframework files.

superandrew213 avatar Jan 01 '24 10:01 superandrew213

I managed to get it to work using this:

  s.subspec 'ffmpeg-kit-ios-custom' do |ss|
    ss.source_files      = '**/FFmpegKitReactNativeModule.m',
                             '**/FFmpegKitReactNativeModule.h', 'bundle-apple-xcframework-ios/**/*.{h,m,swift}'
    ss.vendored_frameworks = 'bundle-apple-xcframework-ios/ffmpegkit.xcframework',
                            'bundle-apple-xcframework-ios/libavcodec.xcframework',
                            'bundle-apple-xcframework-ios/libavdevice.xcframework',
                            'bundle-apple-xcframework-ios/libavfilter.xcframework',
                            'bundle-apple-xcframework-ios/libavformat.xcframework',
                            'bundle-apple-xcframework-ios/libavutil.xcframework',
                            'bundle-apple-xcframework-ios/libswresample.xcframework',
                            'bundle-apple-xcframework-ios/libswscale.xcframework'    
    ss.ios.deployment_target = '12.1'
  end

You must copy/symlink bundle-apple-xcframework-ios to the same dir as the podspec.

superandrew213 avatar Jan 02 '24 03:01 superandrew213

@superandrew213 Your vendored_frameworks solution is more local compared to what we do. We zip the frameworks and put them under a web server. Then reference them in a separate podspec file.

tanersener avatar Apr 12 '24 20:04 tanersener