1

I am developing an app for Android that converts video to mp3 audio using ffmpeg. Found too many commands to convert. The problem is that all commands work slowly on long videos. That is 40 minutes in length.

What I want is commands that converts video to mp3 quickly.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • 1
    Nothing can be done about FFmpeg's _" work slowly on long videos"_. Encoding takes time to calculate and compress. Even my desktop sound editors take some time to generate a 30 minute MP3 so 40 will be longer. The fastest way in FFmpeg is to keep same codec (directly extract audio track). If the video file is MP4 then the codec is likely to be AAC which is just MP3 version two. Usually you'll see AAC codec stored as `.m4a` or `.aac` files. **Try** using `ffmpeg -i yourvideo.mp4 -c:a copy outfile.m4a` and see if faster to extract existing codec? – VC.One May 10 '20 at 06:38
  • Alternatively try using Android own API. – VC.One May 10 '20 at 06:40
  • If you **must** re-encode to MP3, then libshine may be faster than libmp3lame on android. – llogan May 10 '20 at 16:36
  • the command is slowly too i will lkeep searching – Abdull Rahman Adnan May 10 '20 at 20:40

1 Answers1

1

After searching and researching, I found that the fastest command is :

"-i" ,video path , "-map"  , "0:a" ,  "-c"  , "copy" , output path + ".m4a"
llogan
  • 121,796
  • 28
  • 232
  • 243
  • Note that this will only be reliable if the audio format is compatible with M4A container. Such as AAC. You can check first with `ffprobe`: [Is there a way to use ffmpeg to determine the encoding of a file before transcoding?](https://stackoverflow.com/a/35280871/) – llogan May 11 '20 at 17:59