shage Posted December 16, 2007 Share Posted December 16, 2007 ffmpeg -i /var/videos/incoming/video.avi -s 320x240 -ar 44100 -r 12 /var/videos/flv/video.flv is command line to convert video, how could i get it to process all files in a dir thank you Link to comment https://forums.phpfreaks.com/topic/81928-batch-file-ffmpeg/ Share on other sites More sharing options...
trq Posted December 16, 2007 Share Posted December 16, 2007 In bash.. for f in *.avi ; do ffmpeg -i /var/videos/incoming/$f -s 320x240 -ar 44100 -r 12 /var/videos/flv/${f%.*}.flv done and php... <?php foreach(glob(*.avi) as $f) { exec("ffmpeg -i /var/videos/incoming/$f -s 320x240 -ar 44100 -r 12 /var/videos/flv/" . substr($f,0,strpos($f,'.')-1) . ".flv"); } ?> Link to comment https://forums.phpfreaks.com/topic/81928-batch-file-ffmpeg/#findComment-416270 Share on other sites More sharing options...
paul2463 Posted December 16, 2007 Share Posted December 16, 2007 HI Thorpe just a quick one with your post, should it be substr() instead of sustr(), I realise you dont have time to test all your code and it could be a simple typo, but I thought I would check anyway Paul Merry Christmas Link to comment https://forums.phpfreaks.com/topic/81928-batch-file-ffmpeg/#findComment-416273 Share on other sites More sharing options...
trq Posted December 16, 2007 Share Posted December 16, 2007 Yeah, its a typo (edited). I don't test any of my code I post here usually. Link to comment https://forums.phpfreaks.com/topic/81928-batch-file-ffmpeg/#findComment-416274 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.