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
[BUG]: flutterSoundHelper.convertFile crash on release app #710
Comments
I have no idea :( Have you any possibility to check if your AAC file is correct before trying to convert it on your release version ? |
my device is not rooted, so i think i can't check manualy, but ill try with File.exist() |
I am not an expert, but maybe you can try "adb pull ..." |
adb pull with device connected or no need? i've tried to play the recorded (tmp file)on release and it work, make a dialog to show if file exit or not and it exist |
ok. If you can play your AAC temporary file, it is certainly correct. Actually I have no idea. |
Try to do a |
you mean opus extension? |
yes |
😄 |
The extension really must be ".opus" instead of ".mp3" for your test. FFmpeg uses the extension to select the correct output |
so tried to convert to obus using Codec.obusCAF and Codec.obusOGG, tried with aac to aac, all crash :( |
:( Did you try to connect your device to your computer and do a "flutter run --release" ? |
Interesting. Can you try to replace the special char "#" in your filename to something else ? |
I must study your log now. |
The sequence seems incorrect : The player is paused and not stopped during the convert. |
But this does not explain why a crash |
The sequence is correct in your last logs. I am stuck. No idea. |
|
Of course you use the full flavor of flutter sound, and not the lite ? don't you ? |
honestly i don't know . |
What is the result of : flutter pub deps | grep flutter_sound ? |
i'm using vscode, so i just copy the dependence on pubspec and it pub automaticly ^^" |
Just check the command flutter pub deps | grep flutter_sound We will know which version flutter had selected |
Or just : if you do not have a regular shell |
i removed the dependence from pubspec and added it manually with flutter pub add flutter_sound |
I insist you do a "flutter pub deps" to be sure which flutter_sound version is selected |
This is correct. I am sorry, Necro, I am stuck. Someone else can help ? |
just a question , have you already use the converter on a little project? :) |
Might be better off using flutter sound lite and including ffmpeg as a separate dependency and running the commands directly. Flutter_ffmpeg likes to crash or output weird things when multiple jobs are run concurrently. I had to create a queue system for ffmpeg calls to work around this. I'm sure there are other quirks and something like that could be causing this issue. Best way forward is probably to run ffmpeg directly so you have full control over the process |
I agree with @mhstoller. If you use Flutter Sound Lite and put a dependency on "Flutter FFmpeg Audio" (or maybe even a lighter library), |
I am not surprised that you got some concurrency issues using Flutter Ffmpeg. Someone (me?) should add a few lines of code to achieve that. |
Yes. Definitely. I began to write several few very simple test app. The purpose of those little tests are to show and test only one or two Flutter Sound feature at a time. @Necrometal : |
Not problem dude :) for moment i used to record the sound directly on perment file xD |
Have you please any tutorial for doing the FFmpeg separately? |
Yes. Android and iOS does not allow us to record mp3. I am writing a little test for Convert. I will tell you when done. |
The documentation is on the Flutter FFmpeg site. |
Wait until tomorrow. I will have a new Flutter Sound with an example of Convert AAC to MP3. |
ok thanks :) |
Is there any reason you try to convert during a PausePlayer() ? |
Not at all, i just use my app like guest user xD, i just paused the audio for no reason and save (convert) like nothing happen |
OK. I will keep my example very simple :
|
so the sound must be stopped to be converted? |
No. |
okay, i'll wait for your up tomorrow |
Necro, The problem is a problem in Mobile FFmpeg : Here Then I will post more informations in this thread. |
Hi Necro, Flutter Sound 8.1.9 is released. You must also check your build.gradle :
I wrote a very simple example here that record an AAC audio, convert it to MP3 and playback it. Thank you for your patience |
Thanks :) i'll test it and give you a feedback |
it work on flutter run --release, i think it'll work on build release too :) thanks. i have another thing to ask if you can check this one please ^^ |
good job. |
Flutter Sound Version :
FULL flavor ?
Important: Result of the command :
flutter pub deps | grep flutter_sound
Severity
Platforms you faced the error
Android
Real device
Describe the bug
On debug mode, i used flutterSoundHelper.convertFile to convert the temp file created by the recorder to permanent file; i record on aac as temp and convert to premanent mp3; this work well on debug, but when i build a release app, record work well, but when on convert , the app crash,
i said that is the convert the problem cause i put a specifi button to convert aac to mp3, and when the button clicked, the app crash,
Logs!!!!
i put some try catch on my code to see the output, this is the log on debug
I/flutter (14966): ----------------------------------------
I/flutter (14966): convert start
I/flutter (14966): ----------------------------------------
D/flutter-ffmpeg(14966): Running FFmpeg with arguments: [-loglevel, error, -y, -i, /data/user/0/com.example.topos/cache/300621-19#58-Bornage-Immatriculation.aac, /storage/emulated/0/Topos/300621-19#58-Bornage-Immatriculation.mp3].
I/mobile-ffmpeg(14966): Loading mobile-ffmpeg.
I/mobile-ffmpeg(14966): Loaded mobile-ffmpeg-full-arm64-v8a-4.4-lts-20200724.
D/mobile-ffmpeg(14966): Callback thread started.
D/flutter-ffmpeg(14966): FFmpeg exited with rc: 0
I/flutter (14966): ----------------------------------------
I/flutter (14966): convert end
I/flutter (14966): ----------------------------------------
the aac file is the temp file, and the mp3 is the result of convert, the file is successfuly converted and it appear in the path where it would be. i don't know if this line "D/flutter-ffmpeg(14966): Running FFmpeg with arguments: [-loglevel, error, -y, -i, " mean something important or not cause this error text.
But on release this convert make the app crash.
Below screenshot of my full code to save the record
The text was updated successfully, but these errors were encountered: