Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to cut the first and the last half-second of some audio files.

I need to use ffmpeg (because I know that it works well and I know the command for the right encoding and I have installed it on all my machines) and I need to use it on Ubuntu machine (with bash) and one Mac OSX machine (with zsh) and a window machine (with only ffmpeg and python).

For walking through directories I have a python script and I am ok with it, I have to create a string that is ffmpeg_command with the file names result from python os.walk and call it with python os.system call. And python is multi platform.

I need only an ffmpeg command for cut the first and the last half-second. I know of the super popular ffmpeg -t duration -ss position way to cut but I don't know the duration because all files have different length. I am aware about some quick solution like the one in this answer that uses mplayer command to know the length and calculate the duration, but I need to be multiplatform and I am sure that ffmpeg can do it, just didn't see it in the manual.

Some advice?

share|improve this question
    
Nope, ffmpeg can't do it. You need to do the math in Python, Bash, or any other scripting language, and then supply ffmpeg with the proper -ss and -to timestamps in hh:mm:ss.msec form. –  slhck May 8 '13 at 19:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.