Skip to content
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

File conversion to mp3 returning failure everytime. #974

Open
Sanath-Balthar opened this issue May 7, 2024 · 1 comment
Open

File conversion to mp3 returning failure everytime. #974

Sanath-Balthar opened this issue May 7, 2024 · 1 comment

Comments

@Sanath-Balthar
Copy link

Sanath-Balthar commented May 7, 2024

I am trying to convert an audio file generated from flutter "text to speech" package to mp3 file but it is failing everytime.
I have written the below code for file conversion. The conversion fails everytime. I have imported the package ffmpeg_kit_flutter. It doesnt even show why the conversion is failing. I have looked up in stackoverflow and other sites but could not find any relevant solutions. Could anyone please guide me? Let me know if you need more information. I am using vscode as editor. I have attached flutter doctor output below as well.

List<String> command = [
              '-i', audiofilepath,
              '-c:a', 'libmp3lame',
              '$filePath/999.mp3'
            ];

` await FFmpegKitConfig.enableLogs();
            FFmpegKitConfig.enableLogCallback((log) =>print('FFmpeg log: $log'));        
          FFmpegSession result = await FFmpegKit.executeWithArguments(command);
          dynamic resultcode = await result.getReturnCode();
          dynamic resultlogs = await result.getLogsAsString();
          // FFmpegKitConfig.setLogLevel(logLevel)
          if(ReturnCode.isSuccess(resultcode)){
          print("file saved after conversion at $filePath/999.mp3 and result : Success and logs : $resultlogs");
          }
          else{
            print("file saved after conversion at $filePath/999.mp3 and result : failure and logs : $resultlogs");
          }`

Flutter doctor output:
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.22631.3296], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.5)
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++"
workload, and include these components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[√] Android Studio (version 2023.2)
[√] VS Code (version 1.89.0)
[√] Connected device (3 available)
[√] Network resources

! Doctor found issues in 1 category.

Edit: attaching error logs:

D/ffmpeg-kit-flutter(29014): FFmpegKitFlutterPlugin stopped listening to events.
D/ffmpeg-kit-flutter(29014): FFmpegKitFlutterPlugin com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin@a5d9788 started listening to events on io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation@187019f.
I/flutter (29014): Loaded ffmpeg-kit-flutter-android-audio-arm64-v8a-6.0.3.
I/flutter (29014): Result : failure and logs : ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
    I/flutter (29014):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (29014):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/sue/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile
@gongwangjie
Copy link

  • 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants