I have a folder that contains audio files, files are in sequence named from 1 to 150 but none of the files have file extension. What I want is to convert them to aac or.mp3 and If I can join them as a one audio file that I will be fantastic.

Can some one help me out with this??

Thank you in advanced

  • 1
    What format are the files? Are they all the same format? Please show the complete ffmpeg console output of: ffmpeg -i one_of_the_input_files
    – llogan
    Feb 13, 2014 at 18:51
  • thank you for the reply no there are a lot of different formats There are lossy and lossless formats
    – Levan
    Feb 13, 2014 at 18:57

2 Answers 2


get a recent, real ffmpeg build

The fake version in the repository from the Libav fork can not do this. You can download a Linux build of ffmpeg or follow a step-by-step guide to compile ffmpeg.

concatenate/join/combine the audio

Generally the concat demuxer or the concat filter can be used if all of the inputs are similar, but that may be difficult with so many inputs of various formats and properties. Usually I tend to avoid creating temporary files since the concat demuxer or the concat filter alone usually work, but perhaps you can encode them to PCM in WAV and then use the concat demuxer. Assuming there are only audio files in the directory, and your audio files are in ~/Desktop/test:

$ cd ~/Desktop/test
$ mkdir audio
$ for f in *; do ffmpeg -i "$f" -acodec pcm_s16le -ar 44100 -ac 2 audio/"$f".wav; done
$ for f in audio/*.wav; do echo "file '$f'" >> mylist.txt; done
$ ffmpeg -loglevel error -f concat -i mylist.txt -acodec libmp3lame -aq 4 -metadata title="Your Title" -metadata author="Levan" output.mp3
  • Thank you very much for the reply if it is not too much trouble can you help me out a bit more. I am having trouble understanding what to do with all of this Ok the first step make directory sure next step is to encode but where should I put my folder in for example if my folder is '/home/levan/Desktop/test' were should I put it ?? in the first commend ?? Thank you
    – Levan
    Feb 13, 2014 at 20:33
  • 1
    @Levan My examples assume that you start in the directory that contains your files that you want to convert. I'll update it to make it more clear.
    – llogan
    Feb 13, 2014 at 22:35

find *.mp4 -exec ffmpeg -i {} {}.mp3 \;

To strip the audio from a batch of mp4 files into mp3 files, retaining the file name, open the directory to the files and enter the above command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.