-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate class import error with ffmpeg package #8
Comments
Hi, Example: Instead of import 'package:flutter/services.dart'; do: import 'package:flutter/services.dart' as service;
service.yourMethod();
|
The error I get is |
Ok got it. Have you tried changing the imports, like i have shown? In case this resolves this, i will adjust the import line in Could you prepare a quick example for debugging, if this doesnt work? I will be on it right away! |
Should I be changing them in your package or in the code I write because I don't directly use the services import |
No the import in your code. Sorry, the |
Sorry trying that now |
I am using flutter 3.7 if that makes a difference. I also tried removing video_trimmer and then it will build. Tried adding video_trimmer and removing the render packager and it builds.
|
Thanks for the issue. Could you provide me with a quick and dirty example with video_trimmer import so i can run it and debug it? |
Sure Ill get started on that right now |
Also, can you check if this solution helps? This might be a multi dex issue and not related to this plugin. |
Yup I tried it and it still doesn't work. I will leave that in the example also. |
Okay the quick example is just a fork of your example and I added the video_trimmer package without using it in the code and get the errors still: |
Alright, I am on it, it might take some time! |
I also just did a test with the fork without deploying it back to github were I switched the FFMPEG to use the same one in video_trimmer and its working without an issue. |
I was not able to find a satisfying solution for this error. It appears this is a problem happens always if there are multiple FFmpeg instances within one project. This can either be by multiple plugins imports that use Ffmpeg or a plugin with FFmpeg usage and own FFmpeg import. This error will happen with any plugin, when you use multiple instances like this. What needs to be done?As far as my research goes so far, there is no current appropriate resolution to this problem. As this is a double import problem of two different versions, a possible solution is to sync the Ffmpeg version number (which is not always easy, as some operations require different ffmpeg version). In this specific issue we have both a
As Dirty solution
Do the the following procedure for all sub import plugins
Note that you will archive the current version of this package to a local directory. This is a dirty solution as updating needs to be done manually like the described solution, and therefore can only be maintained with very few packages (aka Using
|
I am gonna close this issue for now, as there is a temporary solution. Please be sure to notify me if you think this issue is ongoing and update this issue if there is a better alternative!!! |
@polarby is there a reason why you don't use the same exact package of ffmpeg as video_trimmer? |
Yes, in order to work with the audio conversion the render/lib/src/formats/abstract.dart Lines 128 to 131 in e110fce
I am sorry that there currently isn't a better way to do this (or I couldn't find it yet), but I hope that you still decide to take advantage of the great functions of FFmpeg. |
@polarby thanks good to know. I am keeping the package and looking for alternatives for video_trimmer that will work. |
Hi is is possible to use the ffmpeg_kit_flutter instead of the one used in this package?
It causes issues with other packages that all use ffmpeg_kit_flutter.
The text was updated successfully, but these errors were encountered: