starkdmi / media_tool_flutter

Flutter plugin for video, image and audio processing via native platform code
https://pub.dev/packages/media_tool_flutter
MIT License
10 stars 3 forks source link

FFMPEG KIT Incompatible #9

Closed jtkeyva closed 11 months ago

jtkeyva commented 11 months ago

Description

Adding FFMPEG KIT causes error on pod install. I tried the min version and all the others

Steps To Reproduce

add ffmpeg_kit_flutter_full: ^6.0.3 to pubspec.yaml flutter pub get pod install

[!] The 'Pods-Runner' target has frameworks with conflicting names: ffmpegkit.xcframework, libavcodec.xcframework, libavdevice.xcframework, libavfilter.xcframework, libavformat.xcframework, libavutil.xcframework, libswresample.xcframework, and libswscale.xcframework.

Expected Behavior

able to use ffmpeg alongside this pacakge

Screenshots

If applicable, add screenshots to help explain your problem.

Additional Context

or if you can add watermarking capability to this package then woudln't need ffmpeg at all https://pub.dev/packages/tapioca https://pub.dev/packages/video_manipulation

starkdmi commented 11 months ago

Watermark is a good feature. The Swift library MediaToolSwift already supports it, but not exposed to Flutter as API will look complicated.

starkdmi commented 11 months ago

@jtkeyva, The ffmpeg_kit_flutter_full_gpl is temporary used for Android and it seems it's not compatible with ffmpeg_kit_flutter_full.

You're able to use ffmpeg_kit_flutter_full_gpl: ">=6.0.0 <7.0.0" but not the ffmpeg_kit_flutter_full: ">=6.0.0 <7.0.0".

starkdmi commented 11 months ago

I'll not investigate there as primary purpose of this package is prevent usage of FFmpeg (due to big size and license) in projects.

jtkeyva commented 11 months ago

somewhere you are depending on ffmpeg even if it's not needed. there are features the non gpl version of ffmpeg can do that are useful like watermarking etc. i think what you have created is an essential tool for compression. since it's called media_tools, do you plan to implement other essential tools such as watermark, text and trim?

if not, i think it's important to not have conflicts with those who require such.

great job, this works quickly and solves a lot of ffmpeg problems

starkdmi commented 11 months ago

@jtkeyva, I use ffmpeg_kit_flutter_full_gpl because the Android native plugin is not implemented yet.

There is a BUG which includes this ffmpeg_kit_flutter_full_gpl CocoaPods library into iOS and macOS, while it is used for Android only. It should be possible to include ffmpeg_kit_flutter_full on iOS and macOS but it's not. I checked the resulting IPA file has no unused 60MB from ffmpeg, so it's included somewhere in Debug only.

Non-GPL versions have no H.264 and HEVC, so it's limited a lot.


Yeah, video overlay, trimming and many more are already implemented in MediaToolSwift and shouldn't be hard to add to Flutter.

Trimming is as simple as passing the first and last seconds. But overlays or filters are more complex: link. I can see adding watermark from file to specified corner, but somebody may require more than that.

jtkeyva commented 11 months ago

Got it. Is that a bug on your end or ffmpeg_kit? One of the biggest advantages to your package is avoiding GPL. Do you think it's doable?

I wish I could help but I don't have the experience. That would we awesome if you could get that overlay & trimming working!

Thank you for your awesome package and responsiveness

starkdmi commented 11 months ago

@jtkeyva, That bug comes from Flutter plugins architecture, can do nothing there.

The easiest thing you can do now is fork a repo and remove Android support from there and there, if you don't require it. Then there will be noFFmpeg dependency at all.

In future I will avoid using FFmpeg anyway as the Android will be natively implemented.

jtkeyva commented 11 months ago

@starkdmi ah got it. thanks. yeah i am staying away from gpl and your package could be exactly what lots of us need. thanks for your work!

audio compression (sound evening, not size compression) is another high value ffmpeg feature but that may be out of the scope of your package?

starkdmi commented 11 months ago

@jtkeyva, Any feature requests are welcome) Could you please describe the sound evening from FFmpeg or point to docs, as I didn't find any specific information.

jtkeyva commented 11 months ago

@starkdmi great to hear! i will do so :)

Here is the compressor: https://ffmpeg.org/ffmpeg-filters.html#acompressor

starkdmi commented 11 months ago

Android implementation based on ffmpeg_kit_flutter was removed in 0.1.4

jtkeyva commented 11 months ago

cool thanks for the update. look forward to what's next :)