2Phone.vbs Released to Public Domain Eric Phelps July 2008 Converts any video file (or a folder full of files) to baseline MP4 H264 AAC 320x240 15FPS. If a file or folder is not specfied, the script will toggle a right-click setting for itself on any desired file type. If you don't have an INI file, the script will try to allow you to confirm or change all default settings with a pop-up Internet Explorer window. If you have a (in this case) pernicious pop-up blocker, you'll either have to edit the script default settings or create an INI file. PLEASE review the constants declarations in the beginning of the script (or in the INI file or as one of the items in the pop-up IE window) before running the script! You might want to pay special attention to the line: Const DELETE_SOURCE_FILES = True ... and set it to FALSE until you trust the script. The script will "Recycle" files rather than permanently delete them. The script was designed for converting "dvr-ms" and "wmv" files into small "mp4" files, but it will handle pretty much anything. The script was designed for US "NTSC" frame rates and has not been tested on "PAL" movies. The script has not been tested on DVD "VOB" files. The script tries really hard not to run multiple instances! It does this be creating a ".flag" file in the destination folder and will declare it is "waiting for other process" for as long as that flag file exists. If the script crashes, you may need to manually delete the .flag file. The script will also pause itself if it sees another instance of "ffmpeg" or "ExtractClosedCaptions" running. I have bad experiences with multiple instances of these programs running at the same time! If the input file has a UNC path, the file will be copied to the destination folder before being processed. It runs faster that way! The script will store converted files in a "My Movies" or "Movies" subfolder of your "My Documents" folder or in any other specified folder. REQUIRES "ffmpeg.exe" (and "pthreadGC2.dll") best obtained by installing Videora iPod converter from: http://www.videora.com/ then copying files. Ffmpeg needs H264 option compiled in, which is fairly rare. See also: http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632 http://ffdshow.faireal.net/mirror/ffmpeg/ http://www.videohelp.com/tools/ffmpeg Uses the ActiveX or command-line version of "MediaInfo" to get movie or show data. See http://mediainfo.sourceforge.net. Uses "ExtractClosedCaptions.exe" to get captions from ms-dvr files. See: http://www.ericphelps.com/scripting/samples/2Phone/ExtractClosedCaptions.exe http://www.ericphelps.com/scripting/samples/2Phone/Toub.MediaCenter.Dvrms.dll This is (these are) a modified version of Stephen Toub's "ClosedCaptions" used to extract closed caption text from "dvr-ms" files. You can get Toub's original code here: http://blogs.msdn.com/toub/archive/2005/09/17/470491.aspx The files I present here have been modified to run without user interaction and to generate SRT files. Versions of these binaries were located here: http://www.showanalyser.com/forums/attachment.php?s=cfbfdaa49a8d8af0abf477698eacf7bc&attachmentid=149&d=1186915917 http://www.showanalyser.com/forums/attachment.php?s=eced095cf4f0c97b892f6b4d4c049828&attachmentid=149&d=1186915917 http://www.dragonglobal.org/forums/attachment.php?s=cfbfdaa49a8d8af0abf477698eacf7bc&attachmentid=143&d=1185003733 Unfortunately, the above links are no longer valid. Uses "MP4Box.exe" to add subtitles directly to the MP4 file. See: http://kurtnoise.free.fr/mp4tools/ Uses "AtomicParsley.exe" to add metadata to the MP4 file. See: http://sourceforge.net/projects/atomicparsley If FFDSHOW and AVISynth are installed, you'll be able to permanently embed subtitles. See: http://sourceforge.net/projects/ffdshow-tryout/ http://avisynth.org/ If an Internet connection is available, will parse information from http://www.imdb.com/ to get movie plot and release year data. MP4 files will play on Windows Mobile using TCPMP from: http://picard.exceed.hu/tcpmp/test/ MP4 files will play on Windows. Try these players: http://www.videolan.org/ http://mpui.sourceforge.net/ ################################################################# ################################################################# ################################################################# All three "2Phone" files contain the same code. Download the most convenient one. Downloading Notes: VBS FILE IE may try to run the VBS file instead of downloading it! You'll have to right-click and select "Save Link" or "Save Target" to save the file to your hard drive. TXT FILE Be sure to save the downloaded file with a VBS file extension. If your Windows has the default behavior of hiding file extensions, you will have to quote the file name. For example, don't save it as test.vbs, but as "test.vbs". Using quotes forces Windows to honor your file extension. ZIP FILE No problems. The zip file may (or may not) contain other information or directions.