You have specified that you are interested in working on a huge number of videos, if you have a multicore machine and you will use a normal for
loop provided by your shell, you will have one of your cores running hot, while others are doing absolutely nothing. This is not ideal.
What you should be doing for such a job is using parallel
, a tool that allows you to start several jobs at once, and it can do everything that a for-loop can, but better.
I will not write about all the features of this tool, but will concentrate on your specific task.
One way to start all these jobs would be:
parallel avconv -i "{}" -vf transpose=2 "{.}[rotated].mp4" ::: *.mp4
In here {}
replaces each filename, and {.}
replaces filename without an extension.
I will suggest that you will start as many jobs as you have cores, take away one. The reason for that is so your operating system will still remain useable, and also this will save you in case if you are using harddisk encryption (which will be using processing power to read/write data). To do this simply add --jobs -1
to your command line, and you will limit the number of jobs.
parallel --jobs -1 avconv -i "{}" -vf transpose=2 "{.}[rotated].mp4" ::: *.mp4
Please keep in mind that no output will be given until each encoding completes. So you will not see just how much of each of your video is done.