I have a set of MP3 files that I would like to remove the last 4 seconds. I know that if I know the time duration of each file I can do:
ffmpeg -t ${1} -i inputfilename -acodec copy -vcodec copy outputfilename
Where $1 is the duration of the file minus the 4 seconds.
I'd really like something that would just chop the last 4 seconds off regardless of the length of the file. A "stop 4 seconds before the EOF".
Note: I struggled to figure this command line out, if there's an easier version, I love to see it.
sox input.mp3 output.mp3 trim 0 -4. I can write this up if you are interested in using Sox in this way... – andrew.46 Jul 20 '21 at 09:04But I'd also like to trim 2 seconds from the start odf some other files. I tried: sox input.mp3 output.mp3 trim =2 (and other variations) but that doesn't seem to do it. Suggestions?
– LarryM Jul 20 '21 at 14:05