Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using FFMPEG for converting from MOV to FLV on Ubuntu.

My problem is I have 10 folders and sub folders that contains those videos, I want a command line or a way in WinFF GUI to convert them all at ONCE not one by one and put them back in there folders so each conversion destination is the same as the video being converted.

Additionally I have a problem with the answer I have got is that it cannot convert videos not written in English or even if the path is not written in English such as Arabic.

share|improve this question

migrated from Jun 14 '11 at 11:35

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

In bash (ie ubuntu) you would do

for file in $(cat filelist.txt)
    ffmpeg -i $file $(echo $file|sed 's/\.[^.]*$//').flv

Or if the subdirectories are in the same tree

find . -type f -name \*mov|
while read file
    ffmpeg -i $file $(echo $file|sed 's/\.[^.]*$//').flv

Hmmm, only saw you are on Ubuntu after writing up the windows part :-) On windows, you can use the for command:


set file=%1
for %%f in (%file%) do (
  set name=%%~nf
  set directory=%%~pf
  ffmpeg -i %file% %directory%%name%.flv

Then call it for each file you want to convert, ie makeflv If you have the list in a file it would be

for /f %f in ('type filelist.txt') do makeflv %f
share|improve this answer
i feel that your answer is what i want but i am very new on the bash and command lines can you please explain to me more or give me just more details on which command is the appropriate – haider Jun 14 '11 at 8:55
if my subdirectories are in the same tree where should put the parent file name – haider Jun 14 '11 at 9:04
the easiest is to change directories to the parent, then do the find, or do find /parent/directory -name \*mov etc – Alftheo Jun 14 '11 at 9:50
thank you very helpful – haider Jun 14 '11 at 10:16

You must log in to answer this question.