Ubuntu – How to cut audio file with avconv

avconvffmpeg

I have a hard time trying to figure out how to cut a file with avconv. Here's the command I use:

avconv -ss 52:13:49 -t 01:13:52 -i RR119Accessibility.wav RR119Accessibility-2.wav 

But it doesn't work. I get the whole file as a result. Well, almost the whole file. Somehow the resulting file has duration 1:16:31 instead of 1:17:23. Also I believe I executed this command in every possible way: with -ss and -t after -i, with -t specifying ending point, with mp3 files, with specifying audio codec, with ffmpeg. Am I doing it wrong?

UPD Thanks to bodhi.zazen this works (I corrected the offset and duration reported by mp3splt-gtk, they were wrong for some reason or other, and the goal was to cut mp3 file)

avconv -i RR119Accessibility.mp3 -ss 00:52:08 -t 00:01:08 RR119Accessibility-2.mp3

But this doesn't:

avconv -ss 00:52:08 -t 00:01:08 -i RR119Accessibility.mp3 RR119Accessibility-2.mp3

The resulting file start at 00:52:08 and goes until the end of the original file. I thought -ss and -t are related to input file if specified before -i. And to output file otherwise. Could someone explain this?

Best Answer

I think the original problem was with the formatting of your time stamp.

The format is HH:MM:SS

I am not sure I am understanding your question about the order of the options. I do not think it matters as long as -i is followed by the input file name and -ss HH:MM:SS followed my -t HH:MM:SS

The -ss HH:MM:SS is the starting point, and -t HH:MM:SS is the duration

so -ss 00:01:00 -t 00:05:00 would start at the one minute mark and run for 5 minutes.

On my system, using ffmpeg, order does not matter (you can specify time or input file in any order so long as -ss is followed by the duration (-t) )