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 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 stackoverflow.com Jun 14 '11 at 11:35

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

1 Answer 1

up vote 2 down vote accepted

In bash (ie ubuntu) you would do

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

Or if the subdirectories are in the same tree

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

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

makeflv.bat:

setlocal
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 test.mov 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

Your Answer

 
discard

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