split an audio file using ffmpeg

To split an audio (.mp3 in my case) into subcomponents (to extract portions of the file), you can do it very easily:

  1. ensure ffmpeg is installed with appropriate codecs (see convert .flv file into .mp3 file (ie. extract sound from .flv file)
  2. open a terminal and run :
     ffmpeg -f mp3 -i /path/to/file.mp3 -t  hh:mm:ss[.xxx] -ss hh:mm:ss[.xxx] -o /path/to/save.mp3


    • “-t” option is for the duration of your split
    • “-ss” option is where you want your split to start (optional if you want to start at beginning of the file)
    • “hh:mm:ss[.xxx]” is a time format where you replace hh, mm, ss, xxx with corresponding hours, minutes, seconds, milliseconds respectively. Milliseconds are in squared brackets to highlight that they are optionals and when specified, must be prepended by a dot.


  • man ffmpeg

5 Comments: Trackback URL | Comments RSS

  1. Yemi Says:

    Hi Just a small correction to the code example above. “-o” will throw an error in ffmpeg as its not a valid option. Should be “-y /path/to/output_filename.mp3”.

    So updated code should read:

    ffmpeg -f mp3 -i /path/to/file.mp3 -t hh:mm:ss[.xxx] -ss hh:mm:ss[.xxx] -y /path/to/save.mp3

    Hope it helps

  2. Amjo Says:

    True, Yemi… the “-o” parameter is for Mencoder

  3. Diarrhio Says:

    I would recommend using an -acodec copy to retain all of the original mp3 settings like bitrate, etc.

  4. ubuntuuser Says:

    ffmpeg -i file.m4b file.mp3
    mpgtx -10 file.mp3 -b newfiles

  5. grownbetterwe Says:

    You may also use iDealshare VideoGo to split MP3, AIFF, Apple Lossless ALAC, FLAC, APE, M4A, WAV, AAC, WMA, M4B etc.

Post a Comment

Your email is never published nor shared. You're allow to say what you want...

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

Warning: fsockopen() [function.fsockopen]: unable to connect to www.sweetcaptcha.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81