The Johnson Blog

Ramblings of a geek with a few hobbies…

Tag: video

  • 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.

  • Back to the Zoo

    On short notice, we decided to take a day trip to St. Louis today. When we first woke up this morning the weather didn’t look favorable, at 7am St. Louis was showing 94%+ humidity, so we figured we would just find something indoors. But on the way there the sky was overcast, the temperature wasn’t too bad, and the humidity had dropped – so to the zoo we went!

    David had a really good time, he really wanted to see the Lions more than anything. He also really enjoyed all of the fish in the tanks he got to gaze into.

    The cats are always a hit too.

    It was alot of fun watching David get so excited – his last visit was exactly 1 year ago when he couldn’t express himself so well.    Today he was sure to hop up for every exhibit, until he just got too tired near the end of the afternoon.  We knew he was tired when he told his “No, I don’t want to see more elephants…”

    And for the first time we can remember, we actually got to see the penguins outside. These went over very well 🙂

    http://vimeo.com/moogaloop.swf?clip_id=13793736&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=c9ff23&fullscreen=1

    More photos from the trip are in the gallery.

  • MotionBox Sold to Snapfish

    I’ve been a MotionBox Premium user for almost 2 years now, and this evening I received an email saying they sold themselves to Snapfish.  Lucky for us, we get to use Snapfish free for a year!  If only you could hear my voice, there’s plenty of sarcasm in it.

    Offering Snapfish for a year is a joke.  Why?  Because it in no way compares to what I’ve come to expect from MotionBox.  I quickly created a Snapfish account to try it out, but found:

    • No HD playback
    • No video embedding in other sites like this blog.
    • 500 MB video file limit
    • 10-minute video limit

    Anyone have any suggestions for a replacement?  My wishlist (all things I had with MotionBox) is:

    • Unlimited number of videos and storage
    • No video size limit
    • No video length limit
    • HD playback
    • SD quality fallback for those viewers not on a fast connection
    • Embeddable videos
    • Automatic transcoding between formats – including iPhone compatible.
    • Privacy and sharing features (easy to view by intended recipients)

    R.I.P. MotionBox, I think you’ve left plenty of disappointed customers behind.

  • Bowling and Batting Practice

    I’m doing a little photo and video editing as the weekend winds down and thought I’d post these for all 2 of you that follow this blog.  Here’s David during his two games of bowling, in which he scored a combined 46!  He gets emphatic about doing it himself, so those are 100% his.

    http://vimeo.com/moogaloop.swf?clip_id=13615811&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=c9ff23&fullscreen=1

    And to wrap up the weekend, he took a few swings off of the tee.

    Notice the goggles – apparently he forgot to take them off after his work in the lab.

    Updated: embedded video from Vimeo instead of MotionBox.

  • He’s All Over

    David is mastering his walker (or whatever you call these things) and is all over the place now in it.  Here are a few clips of him gliding through the kitchen.  You’ll notice this thing has a predisposition for turning left – I took a look at it and the front wheels are designed that way!  Quite stupid in my opinion, I might look around and see if I can find some replacements.

    http://www.motionbox.com/external/hd_player/type=hd,video_uid=a790d3b71e1ee12e

    And finally, some photos.