autly Posted February 20, 2009 Report Posted February 20, 2009 Man ir shaada funkcija, lai programa darbotos bacgrkounda: function execInBackgroundb($cmd, $file) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } } Tad man ir shaada rindinja, kas palaizh programu un taas darbiibu execInBackgroundb($ffmpeg." -i ".$upload_path.$filename." -s 480x234 -vcodec mjpeg -ss 5 -an -f rawvideo -vframes 1 ".$img, "$upload_path$filename"); Probleema ir taada, ka man vajag unlikot $upload_path.$filename , bet kameer ffmpeg konvertee sho failu nevar un nevajag izdzeest, ir iespeejams noteikt kad beidz konvertaacija, un tad likt unlikot? Quote
autly Posted December 14, 2010 Author Report Posted December 14, 2010 sen nebiju te iegriezies, bet skatos, ka uz jautaajumu, kuru uzdevu ljoti sen veel pats neesmu atradis atbildi.. varbuut tomeer kaads zin? Quote
Blitz Posted December 14, 2010 Report Posted December 14, 2010 emm, viens risinajums varetu but batch job. Batchjobam var padot arejaas references kas tava gadijumā būs $upload_path.$filename un $img, un batch jobā tad attiecīgi ieliec visu komandu ar referencēm, un aiz vinas faila dzesanu. Kad pirma komanda bus pabeigta batch izpildis nakamo. no php funkcijas savukart izsauc to batch ar parametriem. Sikāk skaties googlee. Par risinajumu neesmu drosh, nekad neesu meginajis, kur nu vel linux videe :( Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.