WME file creation script done
Friday, September 21st, 2007By: Andrew
Finally! I have been saying that I would write this script, and now it is done. The problem that I have been having is that I want to batch convert a LOT (4,500+) files from various formats to WMV. Not hard at all, but freakin’ time consuming to use the Microsoft Windows Media Encoder tool to create every file and update the meta data. This PHP script creates and returns the properly formed WME file data, if you send it the parameters in a get string. Super easy and fast. It will also fill in the blanks for many of the settings if you skip them. For example: if you don’t put a title in, it extracts the filename, title cases the words, and remove underscores and the extention turning that into the “Title” string. So “c:\a_great_file_i_have.mpeg” would become “A Great File I Have”.
Furthermore if you omit an output file, no worries. (the Microsoft tool annoys me by asking every-stinking-time.) If you skip it, I use the “title” field + “.wmv” and put it in the folder where the original was: “c:\A Great File I Have.wmv”. Now that just makes sense.
I preset a lot of the default data, resolution, frame rate, bitrate, depth etc. It is easy to override these defaults, just provide a value for that parameter.
To clarify, this program doesn’t encode anything, it just returns the raw data for the WME file that you feed to the Windows Media Encoder to convert the file you specify. You have to save it somewhere. Your browser may interperate the WME XML data as a webpage. View source of the output if it looks blank.
I also have a batch encoding script, I wrote in perl as a super fast way to process all the WME files in a folder. It even allows for many computers working on the same list of files for some degree of server farming. Create an “at” task and you have a hands off WME processor. It shouldn’t take too much more to make another PHP script that can automate the first step in the process. I will throw that in the bin.
Test it out:
www.AndrewWills.net/wc/wme_make.php?
Comment on this thread if you have bugs or feature requests.
This entry was posted on Friday, September 21st, 2007 at 4:52 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply
You must be logged in to post a comment.