ffmpeg clip audio interval with starting and end time

Solution 1:

For me both

ffmpeg -ss 10 -t 6 -i input.mp3 output.mp3

or

ffmpeg -ss 10 -i input.mp3 -t 6 output.mp3

work OK, just 6 seconds of audio. Here's the mplayer output (last line):

A:   5.8 (05.7) of 6.0 (06.0)  0.5%

Also

ffmpeg -ss 10 -to 16 -i input.mp3 output.mp3

work the same way. I use ffmpeg version 1.2.4. I guess your ffmpeg is somehow "broken" or the input file is somehow (report a bug in either case).

You may try the other answer with mp3cut from portforwardpodcast or

sox input.mp3 output.mp3 trim 10 6

Solution 2:

ffmpeg - Trim audio file without re-encoding

Use ffmpeg to trim an audio file without re-encoding it.

Trim starting from 10 seconds and end at 16 seconds (total time 6 seconds)

ffmpeg -i input.mp3 -ss 10 -t 6 -acodec copy output.mp3

Trim from 00:02:54.583 to the end of the file

ffmpeg -i input.mp3 -ss 00:02:54.583 -acodec copy output.mp3

Trim from 00:02:54.583 for 5 minutes (300 seconds)

ffmpeg -i input.mp3 -ss 00:02:54.583 -t 300 -acodec copy output.mp3

Solution 3:

I've had great success with both CBR and VBR mp3 files using mp3cut.

mp3cut -o output.mp3 -t 00:10-00:16 input.mp3

http://manpages.ubuntu.com/manpages/lucid/man1/mp3cut.1.html