Scott Hanselman

Batch Converting a Directory Tree of Videos Recursively with Handbrake for Streaming to an Xbox360

September 18, '09 Comments [22] Posted in PowerShell | Tools
Sponsored By

Babies! I've got many many gigs of 640x480 video of the kids and family taken on my Flip Ultra and then HiDef video taken with a Creative Vado HD, my current favorite pocket video camera. There's also a bunch of random videos taken with whatever video-capable digital camera I might have had with me at the moment.

These are fantastic video cameras (especially the Vado) but unfortunately the output they produce aren't easily streamed to any Game Console like a PS3 or Xbox360.

There's a glorious open-source multi-platform video transcoder out there called HandBrake. There's also the more sophisticated Expression Encoder. I usually use these applications (both can be called from the command-line) when I need to encode videos.

I figured I'd just drag the whole folder over and magically these apps would happily encode these hundreds of files and all subdirectories. Both apps are fantastic for doing one file at a time, but when you want to do a thousand, things break down. I googled with Bing for a while then decided that the batch files and MacGyver solutions I was finding were silly. Why not make my own ridiculous solution that at least worked for me?

Even better, why not do it as a one line PowerShell script and see if it's useful to you, Dear Reader? Even better, perhaps you'll re-write it in the comments and one day it won't suck as deeply as it does now.

Regardless, this script is currently, happily chewing away at all my videos and even better, these versions are streamable to my Xbox360 from my Windows Home Server. Woot. The Wife is happy.

Here it is:

gci . *.avi -R | foreach-object { $newfile = $_.Path + $_.DirectoryName + "\" + $_.BaseName + "-convert" + $_.Extension; &"C:\Program Files (x86)\HandBrake\HandBrakeCLI.exe" -i "$_.FullName" -o "$newfile" --preset "Xbox 360" }

Eek! But what price my immortal soul?

You need PowerShell for this, if you don't already have it. If you have Windows 7, it's already installed!

This poorly written script takes every *.avi file in the current (.) folder, and all folders underneath it (-R), and for each of this files, creates a new filename with the word "-convert" inside. It then calls the HandBrake command line (yours may be in "C:\Program Files" so you might need to change that. It uses the Xbox360 preset.

After this runs, you'll end up with a whole pile of foo-convert.avi files that should/will stream from your machine to your Xbox360 if you are using the free Windows Media Sharing Services. You can also change that profile and convert all your phone for your phone, or whatever you like.

Here's a snapshot of a classic baby video shown on the big screen. Don't you want to come over for dinner now? You can watch slideshows of all our still videos and now hours of family movies. Woot! Works For Me.

PowerShell experts? I'm quite rusty, and I was just interested in the "Getterdone" version. How can we make it better? How about making it so it only updates files that haven't already been encoded?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 179 - Hanselminutes Live: Open Source and the Codeplex Foundation

September 14, '09 Comments [6] Posted in Microsoft | Open Source | Podcast
Sponsored By

image My one-hundred-and-seventy-ninth podcast is up. In this unusual episode of Hanselminutes, organized late at night over Twitter, and recorded as a community conference call, Scott moderates a discussion on open source and the new CodePlex Foundation.

I thought that a discussion around a new Open Source Foundation should be produced as an "Open Source Conference Call." We had nearly 100 people call in and dozens had their voices heard. If you like this format, let me know! Also, follow me on Twitter as that's where these kinds of things are organized!

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Download: MP3 Full Show

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 178 - Inside a Visual Studio Plugin - CodeRush with Mark Miller

September 14, '09 Comments [0] Posted in Podcast
Sponsored By

MarkMiller_FaceColor My one-hundred-and-seventy-eighth podcast is up. Mark Miller thinks and talks fast. Fortunately he codes fast also. He works on CodeRush for DevExpress, a very intense Visual Studio plugin that helps you visualize and refactor code. How is it built? How does it break the rules? Scott digs in.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Download: MP3 Full Show

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 177 - Hanselminutiae-seven with Richard Campbell

September 14, '09 Comments [1] Posted in Podcast
Sponsored By

My one-hundred-and-seventy-seventh podcast is up. Too much? Too soon? We like Richard so darn much that we had to keep talking on this show. Scott and Richard talk about personal PBXs, multi-core PDAs, iPads and more.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Download: MP3 Full Show

Do also remember the complete archives are always up and they havePDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Microsoft creates the CodePlex foundation

September 10, '09 Comments [28] Posted in Microsoft | Open Source | Programming
Sponsored By

imageVery cool news. Today Microsoft announce the creation of the CodePlex foundation. That's CodePlex.org.

It's amazing the amount of work that goes into something like this. I was in on a lot of very boring (but important) legal conference calls with a lot of folks from within Microsoft but it was fascinating in its own legal way. There's a lot of people who want to see this work and really be something special.

CodePlex.org is different from CodePlex.com, of course. The CodePlex foundation is a 501(c)(6) organization, separate from Microsoft. It's created to help commercial software developers use Open Source software.

Here's the best part:

"The Foundation has no pre-suppositions about particular projects, platforms, or open source licenses."

This isn't the "Visual Studio Foundation" or the ".NET Foundation" or the "MS-PL Foundation." This is on purpose. Over the next few months we'll start hearing about how Projects can get involved and align themselves with the CodePlex foundation.

When I was working with Corillian/CheckFree, it was a challenge to get Open Source software used on big proprietary projects. There was fear and confusion at all levels. We eventually got it done, and there's open source software from then-Corillian running at large banks and small credit unions all over the world. in my opinion, if CodePlex.org succeeds, open source software will be used by more professional software developers.

Here's the interim board of directors and board of advisors. You can see it skews Microsoft initially, but that'll change in the first 100 days when we find permanent members. If you want to get involved, do!

Board of Directors

From the site:

Sam Ramji will serve as interim President of the Foundation. He will be supported by an interim Board of Directors, whose other members are Bill Staples, Stephanie Boesch, Miguel de Icaza, Britt Johnston, and Shaun Walker. Mr. Ramji and the interim Board will immediately begin a search for a permanent Executive Director, who will manage the day-today operations of the Foundation, as well as a permanent Board of Directors and a Board of Advisors.

For the policy wonks, here's the foundation's bylaws (PDF) for you to peruse. This is important also, from the FAQ:

Q: What is the difference between the CodePlex Foundation and CodePlex.com?

CodePlex Foundation is an extension of the CodePlex brand established by Codplex.com. Codeplex.com has not only built a strong community, with more than 10,000 projects now hosted on the site, but has steadily built a recognized brand. CodePlex.com launched in June of 2006 out of a need for a project hosting site that operated in a way that other forges didn't – with features and structures that appealed to commercial software developers. The next chapter in solving for this challenge is the CodePlex Foundation (Codeplex.org). The Foundation is solving similar challenges; ultimately aiming to bring open source and commercial software developers together in a place where they can collaborate. This is absolutely independent from the project hosting site, but it is essentially trying to support the same mission. It is just solving a different part of the challenge, a part that Codeplex.com isn't designed to solve.

I'm on the Advisory board, which is cool, along with other folks whose names I hope you recognize and respect as non-evil. If you're not familiar with the names, I've added my own mini-bio for each. Any errors are mine.

Advisory Board

  • Larry Augustin, SugarCRM - Larry was the chairman of VA Software now called SourceForge, Inc.
  • Sara Ford, Microsoft - Sara runs CodePlex.com and has been an advocate of .NET open source for years.
  • Aaron Fulkerson, MindTouch - Fulkerson is currently Founder and CEO at Open Source and collaborative network company MindTouch.
  • Robert Gobeille, Hewlett-Packard - Bob is the lead architect of the FOSSology project, tools to facilitate the study and analysis of free and open source software.
  • Phil Haack, Microsoft - Phil runs SubText, a .NET open source blogging engine, and he succeeded in releasing Microsoft's ASP.NET MVC under the MS-PL Open Source license.
  • Scott Hanselman, Microsoft - This is me. I've worked on DasBlog as well as a number of smaller open source projects. I used to be the Chief Architect at Corillian, a leading retail online financial service firm, where we used a great deal of open source .NET software in our systems.
  • John Lam, Microsoft - John is known for a lot of things, not the least of which his work on IronRuby, an Open Source .NET implementation of Ruby on the CLR.
  • Jim Newkirk, Microsoft - Jim is one of the co-authors of NUnit and also XUnit.NET, both unit-testing frameworks for .NET.
  • Monty O'Kelley, Microsoft - Monty has worked on partnerships between Microsoft and Novell as well as advocating to make Linux virtualize better on Hyper-V
  • Stephen Walli - Stephen consults on software and open source strategy. He worked on the Interix environment to re-host UNIX apps on Windows NT, utilizing lots of open source software across a number of licenses.
  • Monty Widenius, Monty Program AB - Monty is the main author of the original MySQL database and a founder of the MySQL AB Company.

As a long time Open Source guy myself, I promise that I'll fight the good fight and continue to nudge things in the right direction.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.