Hi all! I have a vps that i use for converting videos (from divx to flv, or to h264) I have all the installed codecs and programs, but it is really tiring, for example, to start the second pass by my hand, while it is only a line of code, because for example pass1 with x264 needs a lot time, not to mention pass2, and it is just one video ... I have root access, so i can do "anything" on the vps: what is the easiest way for this? : I would like to convert all the videos in the same directory one after another without any human interaction, so for example i go to sleep, but before that i start the command line for the videos to convert them, and when i wake up and log in to my vps, all the videos are converted in two pass x264. How can i make something like a command after command thing, i mean: "if you finished the first command, do the next, and the next, and the next..." - so i just have to give a list of commands. My vps is a centos 5.3 32 bit. I'm looking forward for some ideas, thanks for them!
Presumably you want to do this in PHP, since you posted in this forum? If that's the case, you can do something like:
Thanks! As for php: i'm interested in any solution, i read that it can be done with bash script, just have to play with the input and output, so if someone can post a way, i'm erally interested in that too. For your script: Is it stepping from first to second etc... files, and converting them all in the directory? What if i would like to make the second pass too, and after that i would like to step on the next video? So it needs two exec, but how can i implement it? Thanks for your help!
If the commands are executed on the same file, then you'd just need to run a second 'exec' inside the loop: if($file != "." && $file != "..") { exec("some_command \"${file}\" > /dev/null"); //this will block while it runs #1 exec("some_other_command \"${file}\" > /dev/null"); //this will block while it runs #2 } Alternately, you can run the loop twice if you like, but that would only be necessary if you were waiting on the output of the *entire* previous codec run, which is unlikely. HTH