i have in /var/www/ many avi and folders with avi and srt any sh script to encode every avi with srt automatically ? or in php ? is there any way of encoding every avi inside /var/www ? right now it only encodes 1 file " flv_convert_get_thumb('input.avi', " is there a way to encode it like this flv_convert_get_thumb('*.avi', the *.avi will look for any avi and start encoding ? <?php flv_convert_get_thumb('input.avi', 'output.jpg', 'output.ogm'); // code provided and updated by steve of phpsnaps ! thanks // accepts: // 1: the input video file // 2: path to thumb jpg // 3: path to transcoded mpeg? function flv_convert_get_thumb($in, $out_thumb, $out_vid) { // get thumbnail $cmd = 'ffmpeg -v 0 -y -i '.$in.' -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 '.$out_thumb; $res = shell_exec($cmd); // $res is the output of the command // transcode video $cmd = 'mencoder '.$in.' -o '.$out_vid.' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame'; $res = shell_exec($cmd); } ?> Code (markup):
I have 4+ years experience in this field. Please look at my site www.softyram.com . I have strong knowledge in PHP, Mysql, Smarty, CSS, JavaScript, AJAX, Google API and all open sources(ECommerce, CMS, etc) Please look at my ratings and reviews as freelance programmer and you will understand that. I have been doing a lot of works outside script lance for last few months now. https://www.scriptlance.com/cgi-bin/...cgi?p=softyram You can also refer some of my works including joomla : www.promotofan.com www.boredofthehighstreet.com www.unitedoneplatinummembers.com www.thiscity.com www.calgary.toplogic.org/ www.myfreshwhips.com I am available 40 hours per week. I can be contacted at Mail & Google Talk – Skype – dreamajax Looking forward to hearing from you.
First you have to write code to iterate files inside the folder and call your code within the loop for each iteration. You can use the method at http://www.expertcore.org/viewtopic.php?f=67&t=1066 to iterate files inside a folder.