Take the 2-minute tour ×
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It's 100% free, no registration required.

I have a directory full of short video clips in .AVI format, and I want to remove the audio from all of them. I'm using Ubuntu 12.04.

I tried this command:

find -name '*.avi' -exec ffmpeg -i {} -an -vcodec copy {} \;

But while it did remove the audio, it also reduced each clip down to just a few frames. They are originally about 1 to 2 minutes long each, and should stay that way.

This might just be because ffmpeg can be buggy sometimes. Or maybe there's a better way of formatting the syntax.

In any case, whether it's with ffmpeg or a different command, is there a way I can reliably remove the audio from a bunch of clips without changing the video in any way?

share|improve this question

2 Answers 2

I'd suggest installing WinFF, which is a GUI for ffmpeg, and comes with a job manager.

Basically, perform the task for one video and verify it's ok, then populate the job queue with the remaining files, and it will adopt the last used encode parameters and process the queue.

share|improve this answer
    
Thanks for the suggestion. However, the interface for WinFF, as far as I can see, does not have any particularly easier options than just using the command line. Put another way, they have fields where you enter in the command line options, so I'm not even sure what the advantage of it is. At the very least, I can't see any option for removing the audio from a video file. –  Questioner May 2 '12 at 2:34
    
My apologies. My original answer was Avanti, which would do the job very simply. Then I saw that you were running linux, and Avanti is Win-only. I had used WinFF a long time ago and is cross-platform and has a job queue. However, you have to form a preset by manually inputting the command line (not the case in Avanti). The reason for suggesting a frontend is that you don't need to worry about quirky syntax issues such as parameter sequencing or flag overrides or the like. If you can do this on Win, Avanti will do the job easy. –  Mulvya May 2 '12 at 7:35

I suspect you are having problems because you are trying to overwrite the input file with the output, ffmpeg just doesn't work that way. For a single file:

ffmpeg -i input.avi -an -c:v copy output.mkv

To do every file in a directory, you can use a for loop. For every `file.avi``in the working directory, this command will create an output called file-v.mkv:

for f in *avi; do ffmpeg -i "$f" -an -c:v copy "${f/%.avi/-v.mkv}"; done

To do the same thing recursively, you can indeed use find like so:

find . -type f -name *.avi -exec bash -c 'ffmpeg -i "$0" -an -c:v copy "${0/%.avi/-v.mkv}"' {} \;
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.