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

Automatic encoder selection failed Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually. #1048

Open
arex0207 opened this issue Sep 26, 2024 · 2 comments
Labels
all-platforms question Further information is requested

Comments

@arex0207
Copy link

There is no mp3 encoding enabled any encoder, hope to be able to support, this application is very common

@matvuric
Copy link

matvuric commented Sep 30, 2024

Same when I try to concatenate few audios

Future<File> concatenate(
  List<String> assetPaths, {
  String output = "new.mp3",
}) async {
  final directory = await getTemporaryDirectory();
  final file = File("${directory.path}/$output");

  final cmd = <String>[];
  for (final path in assetPaths) {
    cmd.add("-i");
    cmd.add('${directory.path}/$path');
  }

  cmd.addAll([
    "-filter_complex",
    "${[
      for (var i = 0; i < assetPaths.length; i++) '[$i:a]',
    ].join()}concat=n=${assetPaths.length}:v=0:a=1",
    file.path,
  ]);

  FFmpegKitConfig.enableLogs();
  FFmpegKitConfig.enableLogCallback((value) => print(value.getMessage()));
  await FFmpegKit.executeWithArguments(cmd);
  return file;
}

Got such logs:

I/flutter ( 8299): libavutil 58. 2.100 / 58. 2.100 I/flutter ( 8299): libavcodec 60. 3.100 / 60. 3.100 I/flutter ( 8299): libavformat 60. 3.100 / 60. 3.100 I/flutter ( 8299): libavdevice 60. 1.100 / 60. 1.100 I/flutter ( 8299): libavfilter 9. 3.100 / 9. 3.100 I/flutter ( 8299): libswscale 7. 1.100 / 7. 1.100 I/flutter ( 8299): libswresample 4. 10.100 / 4. 10.100 I/flutter ( 8299): Input #0, mp3, from '/data/user/0/com.example.ps3/cache/waterfall.mp3': I/flutter ( 8299): Metadata: I/flutter ( 8299): genre : I/flutter ( 8299): Other I/flutter ( 8299): I/flutter ( 8299): comment : I/flutter ( 8299): I/flutter ( 8299): encoder : I/flutter ( 8299): Lavf58.20.100 I/flutter ( 8299): I/flutter ( 8299): Duration: I/flutter ( 8299): 00:00:10.06 I/flutter ( 8299): , start: I/flutter ( 8299): 0.011995 I/flutter ( 8299): , bitrate: I/flutter ( 8299): 128 kb/s I/flutter ( 8299): I/flutter ( 8299): Stream #0:0 I/flutter ( 8299): : Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s I/flutter ( 8299): I/flutter ( 8299): Metadata: I/flutter ( 8299): encoder : I/flutter ( 8299): Lavf I/flutter ( 8299): I/flutter ( 8299): Input #1, mp3, from '/data/user/0/com.example.ps3/cache/rain.mp3': I/flutter ( 8299): Metadata: I/flutter ( 8299): encoder : I/flutter ( 8299): Lavf58.20.100 I/flutter ( 8299): I/flutter ( 8299): Duration: I/flutter ( 8299): 00:00:10.03 I/flutter ( 8299): , start: I/flutter ( 8299): 0.025057 I/flutter ( 8299): , bitrate: I/flutter ( 8299): 64 kb/s I/flutter ( 8299): I/flutter ( 8299): Stream #1:0 I/flutter ( 8299): : Audio: mp3, 44100 Hz, mono, fltp, 64 kb/s I/flutter ( 8299): I/flutter ( 8299): [aost#0:0 @ 0x765f0b59c2c0] Automatic encoder selection failed Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually. I/flutter ( 8299): [aost#0:0 @ 0x765f0b59c2c0] Error selecting an encoder

@tanersener
Copy link
Collaborator

tanersener commented Oct 27, 2024

mp3 encoding is provided by lame or shine libraries. Install an ffmpeg-kit package that includes one of those two if you want to encode mp3s.

@tanersener tanersener added question Further information is requested all-platforms labels Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all-platforms question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants