WMClear

Description
Description from WMClear's homepage on Sourceforge.net:

wmclear utility is able to automatically remove Windows Media Video script commands from WMV files.

wmreader utility is also included, which is able to extract Windows Media script commands and their timings from WMV files into an ordinary text file."

Why Do We Need this Webpage?
I encountered a few critical bugs with wmreader, and found the WMClear code posted to SourceForge.net did not have support options or other options for submitting patches.  And as such, this page will host some patches required for wmreader to work properly.

Also for those using other operating systems, this page might help those trying to watch the Martin Dickey's CSE 142 Media Player WMV videos, which contain embedded ASF scripts for automatically changing the JPEG slides during his lectures.  The wmreader utility will print out these time markers.

Usage of WMReader for CSE142 video.wmv Videos
1) Apply the wmreader_fixbadcast-20131214.patch and build, or "make clean && make"
2) Run the utility on the video.wmv file, and you should now have a slides.txt file.  If it's still zero bytes in size, manually remove the slides.txt file and rerun wmreader.
3) Notice there are duplicate entries for loading the slide JPEG image.  I think the second is to ensure the image loaded.  Can omit the second redundant entry (containing a one second offset from the initial call to load the next image) using, "sed -n 'p;n' slides.txt".
4) You should now have a ASCII Text file containing the times to load the next image.  The next step is to figure out how to use an image viewer to load JPEG images at specified intervals, while playing the video within your favorite video player such as mplayer.  I was thinking, maybe start two mplayer processes, one to watch the video and the second mplayer process to process the JPEG slides using the slides.txt times.  A mencoder process should be able to process the JPEG files into a video file, but think simply piping the mencoder output to mplayer might be more easier for users.

Patches
wmreader_fixbadcast-20131214.patch - This doesn't completely fix the casting of the pointer to pointer integer, as now the STDOUT is treated as a binary file when piped to a file (ie. "wmreader video.wmv" > output.log) instead of an ASCII Text file.  As such, piping to grep (or "wmreader video.wmv|grep Slide") no longer works.  This needs additional work!  You should at least get a slides.txt file after running wmreader, or remove the old slides.txt and rerun wmreader.  (Now just need to fix why STDOUT and slides.txt file has double slide entries.  See TODO "STDOUT and slides.txt contain double ...")

TODO
1) Hard job.  Needs indent/reformatting?
2) STDOUT and slides.txt contain double start time entries, with an offset of one second for the duplicated slide.  The first initial slide start time is the correct start time.  The second time is incorrect, according to the same video rendered through "Windows Media Encoder Editor", which only shows the initial slides start time.  I still do not know why there's a second entry for every slide's start time with one second offset.  Likely to ensure the slide loaded the specified JPEG file, and can be discarded.  Use "sed -n 'p;n' slides.txt" to print every other line of the video.wmv.