This script is a script that is run every 5 minutes via cron. This script selects all of the files marked as “pending” in the database, converts them to flash (using ffmpeg or menceoder), creates a thumbnail (via ffmpeg-php), enters the details (width, height, user, bitrate, title, desc, thumbnail, title, user) into a mysqldb, then moves the finished flv to another remote server for web output (via scp) . all logged so we can track errors, codec issues, avg conversion times, server load, etc. I have written this script once but it is sloppy and can be done much better and requires the inclusion of the logging features. The original is available for reference/ copy if it would help. I would like as much of this as functions as possible – so I can put in an external file and include and reuse throughout the site.