The Johnson Blog

Ramblings of a geek with a few hobbies…

Tag: Tech

  • Copy File Path in Windows Explorer

    Update: I’ve been notified by Mark that this is completely useless.  Please disregard 🙂   In Win7 and 2008 you get the same option by just holding down Shift as you right-click.  Thanks Mark!

    Ever find yourself in Windows, browing through files and needing to copy a file’s full path?  As a developer, this seems to happen often, and I today I got tired of not having a quick way of doing this.

    A little registry tweak later, I now have a Copy Path command on my right-click menus in Windows Explorer.

    This puts the path to the selected file (or folder) in the clipboard.  Quite handy for quickly opening that file in an application without having to navigate folders or type the path.

    Download and run the Regedit file here.

    That menu option is just conigured to run the following PowerShell command:

    c:windowssystem32WindowsPowerShellv1.0PowerShell.exe -Command “‘%1’ | clip”

    Simple, yet very effective.

  • Corel VideoStudio Pro and QuickTime, a Followup

    A couple days ago I posted about problems I’ve run into trying to use the QuickTime files created by my new Canon 7D.

    Last night, someone from Corel contacted me with a few questions about the issue.  After some back and forth, it became quite clear that there really shouldn’t be a problem – he was, in fact, running the exact same versions of VideoStudio and QuickTime as I, without issue.

    This got me very curious, so I began poking around more.  I ran ProcessMonitor in hopes of finding something out of the ordinary.  With that software running, I went to open a .MOV file, got the error I was looking for, and checked the ProcessMonitor events captured:

    That looked curious – the app is presumably calling LoadLibrary on QTCF.dll and Windows is doing its best to locate it and finally gives up.

    The Fix

    Grasping at straws, I located that QTCF.dll down in C:Program Files (x86)quicktimeqtsystem and copied it into c:Windows.  When I restarted VideoStudio, all of my QuickTime functionality was restored!

    So, if you’re one of the people out there that has run into problems getting VideoStudio to view/edit QuickTime .MOV files, you may want to give that a shot.  Hopefully it’ll work for you too.

    On a side note, now that I can edit my MOV files directly I’m not sure if I’m comfortable having my videos archived in this format.  .MP4 seems like it might be more durable, years from now.  No?

  • Corel VideoStudio Pro and QuickTime, a Workaround

    I really like Corel VideoStudio Pro for video editing, and I’ve been using it for 4 years now.  Unfortunately it really falls down when it comes to QuickTime videos.  Now that I own a Canon 7D that records in QuickTime format, this is a problem.

    The underlying issue is that the software seems to lose all knowledge of its QuickTime capabilities when QuickTime has been upgraded on the machine.  Since I use iTunes on this computer for my iPhone and iPad, there’s no possibility for me to downgrade QuickTime for VideoStudio.

    So tonight I set out to find a solution.

    QuickTime Pro and some C#

    I purchased QuickTime Pro ($30) and found that I could take a .mov file and perform a Pass Through MP4 conversion which essentially just strips the embedded mp4 data from the .mov file without doing any real transcoding.  This is exactly what I want – I don’t want to lose any video quality just because I want the raw mp4.

    The problem now is that this is a completely manual process that I would need to do on each and every video file.  File -> Export -> MPEG-4 -> Pass Through -> blah blah.

    There’s just no way that was going to work, so I decided to write some code against the QuickTime COM api to automate the process.

    The following code is for a command-line executable that will do this mov to mp4 conversion to a batch of mov files:

    using System;
    using System.IO;
    using System.Reflection;
    using System.Threading;
    using QTOControlLib;
    using QTOLibrary;
    using QuickTimePlayerLib;
    
    namespace QTExtractor
    {
        class Program
        {
            static void Main(string[] args)
            {
                // get the player, and the "control"
                QuickTimePlayerApp qtApp = new QuickTimePlayerApp();
    
                // have to wait for QT to open up.
                Thread.Sleep(5000);
    
                // get a Player instance
                QuickTimePlayer qtPlayer = qtApp.Players[1];
    
                // the exporter we will configure once and re-use
                QTExporter exporter = null;
                foreach (string movFile in args)
                {
                    // open the movie
                    qtPlayer.OpenURL(movFile);
    
                    // get the QTControl
                    QTControl control = qtPlayer.QTControl;
    
                    // configure the exporter
                    if (exporter == null)
                    {
                        if (control.QuickTime.Exporters.Count == 0)
                        {
                            control.QuickTime.Exporters.Add();
                        }
    
                        exporter = control.QuickTime.Exporters[1];
                        exporter.TypeName = "MPEG-4";
                        exporter.ShowProgressDialog = true;
    
                        // load our embedded settings
                        string settingsXml = "";
                        using (Stream resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("QTExtractor.Settings.Settings.xml"))
                        {
                            if (resourceStream == null)
                            {
                                throw new InvalidOperationException("Unable to locate the embedded settings.xml file for use with QuickTime Pro.");
                            }
    
                            using (StreamReader reader = new StreamReader(resourceStream))
                            {
                                settingsXml = reader.ReadToEnd();
                            }
                        }
    
                        // set the settings xml
                        CFObject newSettings = new CFObject();
                        newSettings.XML = settingsXml;
                        exporter.Settings = newSettings;
                    }
    
                    // set the datasource to the new movie
                    exporter.SetDataSource(control.Movie);
    
                    // uncomment to obtain new settings xml for use in exports
                    //exporter.ShowSettingsDialog();
                    //string settings = exporter.Settings.XML;
                    //File.WriteAllText(@"C:tempsettings.xml", settings);
    
                    // just place the mp4 alongside the mov
                    string targetFile = Path.Combine(Path.GetDirectoryName(movFile), Path.GetFileNameWithoutExtension(movFile) + ".mp4");
                    exporter.DestinationFileName = targetFile;
    
                    // Go!
                    exporter.BeginExport();
                }
    
                // close the player
                qtPlayer.Close();
            }
        }
    }

    After building this, I added a shortcut to my Windows 7 SendTo folder.

    Now, in my video folder I’m able to multi-select as many .mov files as necessary, righ-click and select Send To -> QTExtractor.  An .mp4 file will be created for each .mov!

    The only downside is that the QT UI pops up as it is working – I haven’t looked but I suspect I can’t get around this.  Oh well, this should suffice until Corel gets their act together.

  • Sharing iPhone Wallpapers

    I have created a page here where I will be sharing images I’ve cropped and re-sized to be used as iPhone wallpapers.  Navigate to Wallpapers -> iPhone Wallpapers on the menu above (or go directly to the page here).

    I won’t be noting new uploads here, so you’ll need to just check back periodically.

  • How I Use Lightroom: Collect and Share

    This post is part of an ongoing series related to how I use Adobe Photoshop Lightroom.  If you haven’t read them yet, check out How I use Lightroom: Getting Photos In, How I use Lightroom: Taking Out the Trash, and How I use Lightroom: Getting Photos Out.

    Collections, Quick Collections and Smart Collections

    In the first post in this series I discussed importing your photos into Lightroom and explained how I have Lightroom configured to import into a nicely organized, folder structure based on the import date.  So you’d think I’d use this all the time, right?

    Not as much as you may think.   And the reason is becuase the primary organizational unit in Lightroom is the Collection.

    (more…)

  • How I Use Lightroom: Getting Photos Out

    How I Use Lightroom: Getting Photos Out

    This post is part of an ongoing series related to how I use Adobe Photoshop Lightroom.  If you haven’t read them yet, check out How I use Lightroom: Getting Photos In and How I use Lightroom: Taking Out the Trash.

    First Some Background

    One of the first hurdles users new to Lightroom run into is how to get to the images they have edited.  It’s common to think I imported them to the My Pictures folder, so I’ll just use Windows Explorer to grab a copy.

    Wrong.

    (more…)

  • Google+, Circles, and Cognitive Dissonance

    I’ve been on Google+ for two weeks now, and overall I really like it.  The system feels like a good combination of Facebook and Twitter.  However, from the first circles I created to the first notifications I receive about being added to others’ circles, I’ve had cognitive dissonance about how to setup my circles.

    I have circles for friends, family, tech, photography, etc..  Everything seemed clean.  But then two things happened: 1) I started following some popular (read, geek famous) people and 2) complete strangers started to add me to their circles.

    So what’s the problem, you ask?

    (more…)

  • How I Use Lightroom: Taking Out the Trash

    This post is part of an ongoing series related to how I use Adobe Photoshop Lightroom.  If you haven’t read it yet, check out How I use Lightroom: Getting Photos In

    In the previous post I described how I use the Import window.  As I mentioned, I don’t exclude any photos at that stage.  I bring everything in and then quickly make a pass where I figure out which need to be deleted.

    (more…)

  • How I Use Lightroom: Getting Photos In

    Adobe Photoshop Lightroom is an excellent piece of software I’ve recommended to many of my friends who have been bitten by the photography bug.  It catalogs and organizes all of my photos, allows me to quickly and efficiently edit them, and assists in pushing the end results for others to see. While on the surface it is targeted to professionals, I’m no professional and wouldn’t enjoy photography nearly as much without it.

    Because it is so configurable, it is often very helpful to get a look at how others use its many features.  So that’s what I’m going to do with this series of posts titled How I Use Lightroom.  I won’t go to mind-numbing depth into every feature it has to offer, but instead will show you what I think is a very approachable and practical method for getting your money’s worth out of it.

    So let’s get started with the first thing you need to do with it – get photos INTO lightroom.

    (more…)

  • Lightroom 3, the iPhone, and Crashing on Import

    A few weeks ago I imported photos from my iPhone into Lightroom 3.  Ever since, I’ve had Lightroom crash on several occasions when I’ve gone to import photos off of a Compact Flash card.  I’m running Windows 7, 64-bit. I was resorting to a reboot to clear it up, but tonight I had too much other stuff running that I didn’t want to stop for a reboot.  So I started looking around.

    I noticed that in Windows Explorer, there was a “phantom” iPhone appearing when my phone was definitely not plugged in.  Here’s how it looked:

     

    My theory is that Lightroom was trying to enumerate devices and was getting to this one and failing.  Unfortunately there isn’t an option to Eject the device from here, so I turned to Devices and Printers in the Control Panel.  In the list of devices, sitting down in the Unspecified section was one called Apple Mobile Device USB Driver.  If you right-click and select Troubleshoot, Windows does a decent job at figuring out that there is no longer a device attached and removes it from the system.  No more phantom iPhone.

    I opened Lightroom back up, clicked Import… and Voila!  Fixed!