Reputation: 2623
Hi am currently trying to retrieve 3 second clips of an audio file whilst it is recording in flutter. I am using the recording module flutter sound and flutter ffmpeg.
I record the audio file with default codec (.aac). The file is saved to the cache getTemporaryDirectory()
I then copy the file using this flutter ffmpeg code
List<String> arguments = ["-ss", start.toString(), "-i", inPath, "-to", end.toString(), "-c", "copy", outPath];
await flutterFFmpeg.executeWithArguments(arguments);
Start: start time (e.g. 0) and End: end time (e.g. 3)
It then returns this error
FFmpeg exited with rc: 1 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x748964ea00] moov atom not found
Helpful information:
I would be grateful for help, I have spent many days trying to fix this problem. If you need anymore info please leave a comment. Thanks
Upvotes: 0
Views: 1380
Reputation: 26
Default Codec is not guaranteed to be AAC/ADTS. It will depend of the Android version of your device.
You can do several things to understand better :
ffprobe
on your file to see what has been recorded by Flutter Sound.
Use a specific Codec instead of default : aac/adts
is a good choice because it can be streamed (you want to process the audio data during the recording and not after closing the file)
Verify that your file contains something and that the data are not still in internal buffers
Record to a dart PCM stream instead of a file. Working with a file and use FFmpeg to seek into it is complicated and perhaps does not fill your needs.
Upvotes: 1