Showing posts with label record. Show all posts
Showing posts with label record. Show all posts

Sunday, February 26, 2012

Windows 7: Windows Media Encoder: No Specified Device Driver Is Present

I had downloaded Microsoft Windows Media Encoder (WME) 9.0.  I was aware that it was unsupported and otherwise limited in comparison against Microsoft Expression Encoder 4 Pro ($199).  I was trying to use it to do video screen capture in 64-bit Windows 7.  I went into New Session > Capture Screen > Specific Window and Capture Audio from the Default Audio Device > designate the window > name the output file > high quality > diplay information (blank) > Finish.  At that point, I got this error:

Windows Media Encoder

No specified device driver is present.(0xC00D0072)
A search led to a Microsoft webpage that said this occurred because DirectX Media 6.0 was not installed.  Unfortunately, the page to which they directed me for the appropriate download was defunct.  Wikipedia said that DirectX 6.0 was released in August 1998, that the current version was DirectX 11, and that DirectX had been included in Windows ever since Windows 95 SR2.  (I also saw an indication that this problem might arise only when trying to record audio along with the video.  I didn't investigate that; I was only interested in video plus sound at this point.)

My theory was that DirectX had grown and that WME had not been maintained to keep up with it, and therefore I needed to install an older version of DirectX for that purpose.  I was not sure that this would work without screwing up the more recent DirectX.  I made a System Restore point and then downloaded DirectX 8.1 Runtime for Windows 2000, released in November 2001.  I wasn't sure whether that was the right thing; I also downloaded the DirectX Media Platform SDK Redistributable (June 2001).  Both were around 6-8MB.

Before installing them, I looked at a few more posts.  One post said that what was missing was actually a WDM (Windows Driver Model?) driver for the microphone.  The plausible theory in this case was that I would gain nothing by installing a retrograde version of DirectX; instead, I just needed a current driver.  But I was using onboard audio; I had only installed the motherboard recently; and I had made sure to get the latest drivers at that point.  I guessed that the motherboard drivers were no longer attempting compatibility with WME.

There was always the option of using a handheld audio recorder to record sound from the speakers.  Or if I didn't mind risking blowing up my handheld recorder, I could try running a cable directly from the computer's headphone output to the recorder's microphone input.  I would still have the hassle of synchronizing audio with video in a video editor.  That would be more difficult if the video showed lip motion or other things that would become bothersome if they weren't closely aligned.

There was also the possibility of doing further research into who was using WME on Win7 successfully at this point, and what hardware they were using, and buying the appropriate sound card.  I was out of time for this project, but it could also develop that further research would turn up a solution I had overlooked.  But good video capture had been elusive.  I had bought Debut and had been using it with good results; the question only arose because there was a hopefully temporary licensing snafu where Debut didn't work for me in the middle of the night.  Debut was now working again, so I shelved this question for the time being.

Wednesday, November 9, 2011

Documenting Computer Work with Screenshots and Duplicate Detectors

I was doing some work in Windows 7.  I wanted to log the changes periodically as I went along.  I had already developed a batch file, which I called Shotshooter.bat, to take screenshots and save them as .png files periodically.  (I think this will work in all versions of Windows.)

Having already done the NirCmd setup required to make that batch file work, I slightly revised it to read as follows.  (If the print is too small, use Ctrl-+ or copy and paste into Notepad.  Batch files are best not edited in a word processor like Word, since they change characters sometimes.)

:: Shotshooter.bat

:: Captures a series of screenshots.

:: See
http://www.nirsoft.net/utils/nircmd.html for info on NirCmd.exe.

:: Takes two arguments:  how many shots, and how many milliseconds between shots.

:: Sample usage:  shotshooter 3600 1000
:: That example would take screenshots every second for an hour,
::   assuming the computer could work that fast.

:: To kill the program sooner, use Task Manager (Ctrl-Alt-Del) > Processses > nircmd.exe.
:: IrfanView provides a fast way to play back results.

:: Create Screenshots folder on drive D

D:
md \Screenshots
:: Go to the drive and folder where you put NirCmd.exe

W:

cd "\Start Menu\Programs\Tools\Programming and Scripting\NirCmd"
:: Run NirCmd with the desired settings

nircmd.exe loop %1 %2 savescreenshot D:\Screenshots\scr~$currdate.yyyy-MM-dd$-~$currtime.HH_mm_ss$.png

:: Go see what you've created in D:\Screenshots

start explorer.exe /e,"D:\Personal Projects\View These Weekly"

Having created Shotshooter.bat, now I wanted to run it.  I had already used Ultimate Windows Tweaker (UWT) to install a right-click option to open a command window in any folder I would select in Windows Explorer, so all I had to do was open a CMD window where I had saved Shotshooter.bat, and just type "shotshooter 1200 30000" and hit Enter.

(If I hadn't installed that option with UWT, I could also have gone to Start > Run > cmd and then navigated manually to the proper folder with change-drive (e.g., D:) and change-folder (e.g., cd "folder name") commands like those used in Shotshooter.bat, above.  Note that quotation marks are necessary if folder names contain spaces or possibly if they are too long.)

Those parameters of 1200 and 30000 meant that Shotshooter.bat would use NirCmd to take a screenshot every 30000 milliseconds (i.e., every 30 seconds), and would take a total of 1200 screenshots (i.e., would run for 10 hours).  It would save them in D:\Screenshots, and now I would have to decide what to do with them.

When I was writing up these notes, I didn't recall whether NirCmd could also produce JPGs or other image formats.  It probably could.  But after getting used to IrfanView, it probably would have been easier to just use IrfanView (File > Batch Conversion/Rename) to do a mass conversion of PNGs into JPGs if necessary.

The problem with a straightforward slideshow was that, if I allowed a few seconds for each screenshot, I could easily wind up with an hourlong show that would feature extended periods of no change.  On this particular day, I had gone to the store and out to lunch, so presumably nothing was happening during those periods.  The changes that I would want to see might pop up for only a few seconds in that hourlong show.

It seemed I had better get rid of the PNGs that merely repeated the same unchanging screenshot for long periods of time.  To do this, I tried a couple of approaches.  After making a backup of my Screenshots folder, I started with Awesome Duplicate Photo Finder (ADPF).  I adjusted its settings to examine PNGs and told it to search only the D:\Screenshots folder.  It felt that, out of my 1,200 screenshots, 1,160 were potential duplicates.  Closer examination revealed that, while many of those files were not what ADPF considered 100% identical, hundreds were.  Unfortunately, ADPF did not offer a way to bulk-delete the 100% matches.  I did not take the time-consuming approach of just letting ADPF guide me through the 580 pairs of images comprising those 1,160 alleged duplicates, making manual choices as to whether I should delete one of the two images it showed me.

I tried another approach.  Among the many free duplicate file finders, I had long used DoubleKiller.  (Exact Duplicate Finder gave the same results as one type of DoubleKiller comparison, but offered fewer comparison options.)  For some reason, a CRC and size comparison in DoubleKiller gave me only 161 duplicates.  I suspected DoubleKiller was being too precise.  Doing an unreliable size-only comparison, it still found only 340 duplicates.

Following the advice on a page that recommended five duplicate file detectors, I downloaded and installed Dup Detector.  It was not easy to understand, but some tinkering I was able to get it to work.  The first time I ran it, I told it to search only for 100% matches.  (By default, it was set to search for "Dup if within 98.5% to 100% match.")  The thing that made it work was to go into its Options > "Automatic and Semi-auto delete setup," highlight the "Delete left image" criterion (the only criterion I needed to use in this case) and use the "Swap up" and "Swap down" buttons to make "No delete" come after "Delete left image."  Then, to make it run, I had to start with Get data > Build.  Also, because of the number of files, I thought I had better start with Find > "Find dups setup (method and restrictions)" set to find 9999 pairs.  I still wasn't sure, at the time when I was writing these remarks, whether that was a good number to put there.

When I ran Dup Detector to search for only 100% matches, it found that about half of the PNGs were duplicates.  I eyeballed some of them, using IrfanView to flip through them quickly with just a right-arrow keypress.  There did appear to be a lot of exact duplicates.  I ran an automatic delete to get rid of those dups.  Then I ran a DoubleKiller search for matches that had both identical sizes and identical CRC checksums.  DoubleKiller still turned up 79 pairs of duplicates.  Apparently there had been more than 9999 pairs, first time around.  (If there were more than 100 exact duplicates, then there would be more than 9999 possible pairs.)  To check this, I ran another Dup Detector search for 100% matches.  It found a bunch more.

It seemed, then, that the best strategy would have been to run DoubleKiller first, so as to get rid of one item in each exact pair.  I did that now.  Then I ran Dup Detector, looking again only for 100% matches.  It found none.  I tried again, this time with a search for 99.9% to 100% matches.  Again, it found 9999 pairs.  Some looked identical, in the program's necessarily reduced and imperfect matchup screen, but the differences in others were visible -- more than 0.1% different, I would have thought.  I tried another search, this time adding a decimal point -- looking, that is, for 99.99% to 100.00% matches.

While that was underway, I ran another of the simple comparisons available in ADPF.  It said that, of the 851 pictures remaining (out of the original 1,200), it found 811 similar pictures.  In the bottom pane, I clicked twice on the Similarity column heading, so as to see what it considered the 100% matches first.  I couldn't tell any difference between the ones that I looked at.  I wasn't sure why ADPF had not considered them identical.

Before doing anything with that ADPF comparison, I went back to Dup Detector.  It had completed its 99.99% search.  It was still finding 9,999 pairs.  I had already noticed that, unlike ADPF, Dup Detector was not able to show the right portion (maybe one-sixth) of my widescreen screenshots.  I also noticed that the first line of the Dup Detector report, in the top left corner of the screen, said that it was comparing 99.9% (not 99.99%) matches.  So unless there was a bug in that report, apparently one decimal place was as precise as it got.

I preferred ADPF's visual comparison, so I went back to it.  In the bottom pane, it looked like about two-thirds of its similar pictures were at the 100% level.  That would apparently mean I would have to do hundreds of manual comparisons:  Picture 1 might match Picture 2, and also Pictures 3, 4, 5 . . . I went down to the 99% matches.  These, too, were identical, as far as I could tell.  I had noticed, in IrfanView, that the only thing that had changed since the previous screenshot, among some screenshots, was that the system clock, in the bottom right-hand corner of the screen, had moved ahead by one minute, so maybe that sort of thing kept ADPF from catching them at the 100% level.  ADPF wasn't showing the taskbar or other outer edges of the screenshots, so I couldn't tell for sure.

With hardly any exceptions, I found that even the 95% matches in ADPF were virtually identical.  The only differences that I could detect, in the 50% of less of matches where I did see a difference, was that a different window might be foregrounded -- that, in other words, its title bar would be a different color in one screenshot than in the other.  In other words, the ADPF matching levels seemed more realistic than those in Dup Detector:  this was the kind of difference that I would expect to be detected at the 96% level, well before the 99.9% level.  A 99.9% match, I felt, should involve no more than the tiniest flyspeck of difference.

For my purposes, I did not get regular, visible differences in matches, in ADPF, until I was down at the 91% level.  There were few matches at that level, so I decided to err on the safe side, manually deleting duplicates down to the 95% level.  But in the process, I stopped along the way to re-run Dup Detector.  It seemed I might be able to calibrate it against ADPF.  In other words, I first deleted all of the 100% matches in ADPF, and then ran Dup Detector.  There were about 360 of those, or about 45% of the 811 similar pictures detected by ADPF.  Deleting them was pretty fast, once I got the keystroke combination worked out; it probably took 6-7 minutes.

Rerunning Dup Detector at the 99.9% setting, after deleting ADPF's 100% matches, still produced 9999 matches from the 482 screenshots remaining.  I expected it to produce matches that were extremely difficult to tell apart.  This was not the outcome I got.  There were a number of rather obvious (although still very minor) differences.  It seemed, at this point, that Dup Detector's supposed 99.9% match was not realistic and, for my purposes, not meaningful.  In general, it seemed that Dup Detector had been useful only for purposes of automated deletion of 100% matches, though possibly that function would have been served equally well by an easier DoubleKiller comparison in terms of file size and CRC.  It didn't look like Dup Detector had anything more to offer me at this point.

In the interests of automating future comparisons, I looked around for a free bulk CRC calculator, but ultimately got better results searching for an MD5sum program in CNET.  I thought about FSUM but finally went with the somewhat higher-ranked MD5summer.  Both would do batch work and yield text-file output, but FSUM was command-line.  MD5summer did give me the option of saving its calculated sums as a text file, which I then imported into Microsoft Excel.  Using text parsing functions (e.g., MID, LEFT, TRIM), I extracted the 32-character checksum, sorted, and used a formula to compare cells.  MD5summer had evidently identified only 322 duplicates in 161 pairs.  Possibly the reason the duplicates were found only in pairs was that I had run Shotshooter (above) in 30-second intervals:  there would be only two screenshots per minute, before the system clock changed, producing a screenshot with a different checksum.  That had probably been the case with the DoubleKiller CRC checksum results as well.

One workaround would have been to see if I could conceal the system clock before starting, or I could batch-trim the PNGs in IrfanView (File > Batch Conversion/Rename > Advanced > Crop) before running the checksum, but in this case I wanted the clock to be visible on the output.  (I could also have used cropping, or could have drawn circles and arrows on my PNGs, using something like Photoshop, to narrow the focus to particularly interesting changes on the screen, so as to reduce the percentage match that ADPF or other duplicate detectors would calculate.)  I could have done the batch-trim with a copy of the snapshots backup folder, so as to produce a list of files to be deleted without harming the originals (or, in this case, the copies).  But what if the only thing that changed (in some future application) was a small item in the center (i.e., not at the edge) of the screenshot?  I could use the spreadsheet to identify not only the duplicate pairs but also the time periods during which every minute had a matching pair, so as to lead me toward large stretches of time when nothing would change, and then maybe a manual comparison in ADPF would be manageable for the rest.

So those were possibilities for future projects.  At present, having deleted the ADPF matches down to the 95% level (leaving a few near-duplicates where I could quickly see a difference), I continued on a bit further in ADPF, deleting some additional near-duplicates.  At the 91% level, almost every pair of near-duplicates contained visible differences, so I stopped there.  So I was done with ADPF.

I now had 442 fairly distinct screenshots, out of the original 1,200.  I would have had more if I hadn't abandoned the computer for several hours while Shotshooter was running.  I viewed a bunch of them in IrfanView, again using the right-arrow key to move quickly to the next.  I had already set IrfanView (Options > Properties > Browsing/Editing) to go to the next file after I deleted one -- or maybe it did that anyway, by default.  It now occurred to me that some of my ADPF work might have been faster, and that differences might have been easier to see, if I had just paged through the screenshots (or at least some of them) in IrfanView, using the Delete key (alternately, the X button, up by the menu bar) to delete apparent duplicates.  When I ran into a stretch where there seemed to be many duplicates, I stopped hitting Delete (in case, by deleting too fast, I would accidentally delete one after the screen did change) and instead just selected and deleted many at once in Windows Explorer.

Holding down the right-arrow key in IrfanView allowed me to page quickly through obviously similar or dissimiliar screenshots.  There were still quite a few, requiring as many as 90 virtually duplicate screenshots to be deleted in one case.  It seemed that ADPF may have been fooled, not only by the system clock (which still seemed to be the only thing that was changing, in many cases), but also by relatively complex screenshots (e.g., showing photographic or Google Earth images rather than just text documents, spreadsheets, and Windows Explorer sessions).  That is, to my way of thinking, many of these images were 99% similar, but ADPF hadn't even considered them 91% similar, so possibly its comparison engine was miscalculating similarities in some conditions.

After these other steps, I took a final trip through the snapshots, in IrfanView, and deleted a few more that were very similar to the ones immediately preceding them.  I wound up with 207 snapshots, out of the original 1,200, that seemed to represent fairly well what I had been doing over a 10-hour period.  Again, the number could have been substantially larger -- maybe around 300-350 -- if I hadn't spent a few hours away from the computer.

Now I wanted to put these snapshots into some kind of slideshow.  I rarely made slideshows.  On a few of the screenshots, I decided to use Adobe Photoshop Elements to draw circles and lines to draw attention to changes, from one slide to the next, that might otherwise escape attention.  Then I figured I would use IrfanView (File > Slideshow > Save slideshow as EXE/SCR) to create a slideshow.  (I could also have used something like PowerPoint, except that apparently that would have required me to create 207 slides and then import a photo into each.)  But IrfanView wouldn't let me add circles and arrows or, as seemed increasingly appropriate, a voiceover, to explain what was going on.

I tried using both Adobe Premiere Elements and CyberLink PowerDirector, but neither of them wanted to let me export to a full widescreen format.  Saving it in a reduced format (e.g., 720x480) lost so much detail that it was hard to read what was being displayed.  They also created huge files.  These programs -- especially Premiere Elements -- were also pretty terrible at giving me a simple way of arranging slides.  I wound up just creating an IrfanView EXE slideshow in full-screen mode -- and you know what?  It was beautiful.  Visually, it was perfect.  It looked exactly like the regular computer screen from which I had created all those screenshots.  And it was only 91KB.  Tiny!  The only drawback was that it couldn't incorporate a voiceover and lines and arrows.  So the output side of this project was still in development.

Tuesday, August 16, 2011

Windows 7: Recording Streaming Audio

I had previously tried, but failed, to get my system to record streaming audio.  The concept, in this mission, was that I wanted to be able to capture, in a file, the sound that I was hearing in my headphones.  Seemed like a simple expectation, and as I recalled it had been almost automatic on my previous system.  But it wasn't happening on my current motherboard, a Gigabyte GA-MA785GM-US2H, so I searched for solutions.

The first requirement seemed to be to use the right software.  Not every audio program is capable of recording streaming video.  The free Audacity program could, so I was using that.  I found a video and a webpage that were supposedly going to help me, and probably I did incorporate some of their suggestions into the approach that eventually worked for me.  The only suggestion that I recall making a difference was that, as recommended, I was using the version 1.3.13 beta of Audacity, not an older one, though at this point I'm not absolutely certain that was necessary either.

Ultimately, I found two ways to record streaming audio.  One was to use a video capture program and convert the resulting file to audio.  I'd had tried a number of video capture programs, with very mixed results.  The only one that seemed to work reliably was Debut, and it cost money after its free trial period.  Ultimately, I did buy a copy of that.  For the conversion, I used Oxelon.

The other approach was to use an audio cable to connect the computer's headphone jack directly to its microphone jack.  Basically, I would be recording what the headphones were supposed to be hearing.  Sadly, this didn't work as advertised, when I used the actual jacks on the computer itself.  But I was able to make it work in a different way.  I bought a Syba SD-CM-UAUD USB-to-audio adapter.  No software required.  I just plugged it into a USB port, plugged both ends of the patch cable into it, and it worked.  Actually, to make that work, I had to set Audacity as follows: the audio host was Windows DirectSound; the output device was Primary Sound Driver; the input device was Microphone.

The Syba device gave me really loud volume.  Later, I had to fiddle with Control Panel > Sound to get all my devices back the way they were before.  But so far, it seemed worth it.

Sunday, July 25, 2010

Using XQDC X-Setup Pro in Windows XP

According to Tex and Eric, the bankruptcy of WUG has ended that organization's sponsorship of X-Setup Pro, a Windows tweaking utility.  Their message ends as follows:

You can still download the last version from MajorGeeks or BetaNews. The portable edition and the U3 version are available from MajorGeeks as well.

In case you lost your serial number use this one instead: XSA092-11TA9R-8K12YT
I had used this program years earlier.  I now installed and tried to run it in a Windows XP virtual machine (VM) in VMware Workstation 7.1 on an Ubuntu 10.04 host.  When I clicked on the "Classic" button, it immediately presented me with this error message:
C:\Program Files\X-Setup Pro\bin\xqdcXSPUI.exe (/START): Access is denied. (Win32 Error Code 5)
A search for precisely that error turned up nothing.  In a modified search, I saw an indication that "Access is denied" and "Win32 Error Code 5" mean the same thing.  Before researching that further with a refined search, it occurred to me to see whether it would happen again.  This time, clicking on Classic raised a Comodo Defense+ (firewall) dialog asking me if it was OK to proceed.  Allowing that, and another two or three after it, solved the problem:  the X-Setup windows opened.

I wondered whether X-Setup superseded Tweak UI.  Laptop (magazine?) rated X-Setup more highly than Tweak UI; but they observed that novices can get lost in X-Setup and may find Tweak UI more suitable for their needs.  My recollection, circa 2001, was that I had hosed my system with X-Setup once or twice.  I decided to use both for a while.  Following the tip from Tex and Eric, and consistent with a current effort to make Windows XP perform better in VMware Workstation, I decided to try using the portable versions of X-Setup and Tweak UI.

The most interesting feature of X-Setup, for me, was its Record function.  This feature made it possible to create distinct .reg files for each registry tweak.  So I could pick and choose the registry edits I wanted to use this time, and could run their "undo" counterparts if I didn't like the effects.

The explanations of various options in X-Setup were surprisingly articulate and lucid.  Those explanations did not conceal some degree of confusion in the structure of X-Setup tweaks, however.  There was redundancy; there were instances when I thought I had changed something and then came across something that looked very similar but yet had not been changed.

While there was no denying that X-Setup had a large number of tweaks, I found that they did not cover some registry edits I would have liked to see.  The authors readily acknowledged, as well, that some of the tweaks performed by some X-Setup plug-ins would not be captured in .reg files.  I found, in addition, that many of the tweaks I generated from within X-Setup were already set out on the Kellys-Korner and Elder Geek websites, among others.

After running X-Setup and making system adjustments, I found that the new Windows XP installation I had used it on was performing very slowly -- even though I had made sure not to make any changes that X-Setup had flagged as potentially dangerous.  Ultimately, this slowness and other problems led me to wipe my new Windows installation and start over.  I was not sure whether X-Setup was directly to blame for such problems, but I did make sure, the second time around, to proceed with caution.

Despite those caveats, X-Setup Pro did generate a number of useful scripts for me, and when used with suitable caution, it provided very helpful ways of improving my Windows XP installation.