Installing youtube-dl on a Mac to watch YouTube videos when working offline

My work pattern at the moment means that I’m spending a lot of time travelling on trains up and down the country (in fact, as this post is published, I’ll be somewhere between Bedford and Sheffield). A combination of fatigue and motion sickness means that this isn’t always a good opportunity to work on the train but it is potentially an opportunity to listen to podcasts or, unlike when I’m driving, to watch some videos. Unfortunately, travelling at 125 miles an hour with a varying quality of 4G data signal doesn’t always lend itself well to streaming from YouTube, etc.

That’s where youtube-dl comes in – I can download videos to my MacBook before I leave home, and watch at my leisure on the train. So, how do you get started?

Well, the Mac App Store website helped me. Following advice there, I issued two commands in Terminal to first install the HomeBrew package manager for MacOS, and then to install youtube-dl:

ruby -e "$(curl -fsSL" < /dev/null 2> /dev/null

brew install youtube-dl

So, with youtube-dl installed, how do I use it? The youtube-dl file has lots of information but it’s not exactly easy to digest.

I found that:

youtube-dl -F youtubeurl

would give me a list of available video formats for a given URL and reading about YouTube media types led me to the very important number 22 for MP4 video at 720p with H.264 encoding and AAC audio. That should play on a wide variety of devices (including Quicktime on my Mac).

Next, to download:

youtube-dl -f 22

(this URL is the CloudTechTV channel).

That command brought down all of the videos in the channel but I can also download individual episodes, for example:

youtube-dl -f 22
I can do something similar for other YouTube videos/channels (and even for some other video services) and build a library of videos to watch on my journeys, without needing to worry about an Internet connection.

Short takes: cyber security; stock images; PowerPoint presenter view; smart TVs, iPads and YouTube

Lots of ideas for blog posts this week but limited time to commit pen to paper, or fingers to keyboard for that matter. Here are the highlights of what might have been…

Cyber security

Last year, I assisted one of the lecturers at University College London (UCL) with some “expert” opinion on the bring your own device phenomenon, for a module as part of the MSc course in Human Computer Interaction. It seemed to go reasonably well and I was invited back to speak on this year’s topic – cyber security.  I can’t claim to be an expert, but I could present some supplier-side views on the UK Government’s “10 steps to cyber security” advice which seems very sensible but is also based on aspirational and tactical solutions which could be costly to implement in full, so need to be considered with an understanding of the relative risks and an eye to the future.

For anyone who’s interested, my presentation is available for viewing/download on SlideShare, although it’s very visual – full narrative is available in the notes.


Searching for good images

I’m a fan of full-page images on slides and limited text. I find it keeps the audience engaged and listening to the presenter, rather than reading pages of bullet points.  The down side is that it can be very time consuming to find the right images, especially without access to an account at a good stock library.

As my presentation to UCL was as in individual, not representing my employer, I was able to use images licensed for non-commercial use under Creative Commons and Compfight is a great tool for searching Flickr for these.  I’ve attributed all of the photographers used in the deck above, and if you don’t have access to iStockPhoto, Fotolia, etc. then this can be a good way to find images.

PowerPoint Presenter View

I’ve blogged before about PowerPoint’s presenter view and I’m amazed that more people don’t use it (although, the people who don’t are generally fans of dull corporate decks with lots of bullet points – yawn!). Somehow though, my PC had reverted to not using it, and I needed to Google to find where the option is in the PowerPoint 2007/2010 ribbon!  In the end, it was this Cybernet New post that showed me the important option: on the Slide Show tab, in the Monitors section.

YouTube smart TV and mobile apps

I wanted to re-watch a presentation that I’d missed last year and that I knew was on YouTube. Given that it was nearly an hour long, I thought the comfort of my living room would be a good place to do this, using the YouTube app on my smart TV. It was. At least until I lost the stream part way through and the Samsung YouTube app refused to play ball with the fast forward control. Another annoyance was that the “Watch Later” functionality in YouTube isn’t recognised by the a-little-bit-dumb app on the “smart” TV, so I needed to add the video to another playlist first.

Eventually, I finished up watching the second half of the video on my iPad. Here, again, it’s useful to know that the built-in iOS YouTube app is feature light and that there is a newer version available from Google in Apple’s AppStore.

The benefits of IP TV in my living room

Our living rooms have become a battlefield: Microsoft, Apple and Google each want to control our entertainment experiences, integrating TV, PC, smartphone (and games consoles); then consider Samsung, Sony and the other consumer electronics giants – all of whom want a slice of the digital media consumption cake – there’s certainly a lot at stake as existing media consumption models start to crumble and new business models are established.

Until fairly recently, I was resisting any temptation to bring more technology into the living room, especially as my “black loud crap” (19″ hi-fi separates to you and I) was banished when Mrs W and I became an item all those years ago. I’m not much of a gamer but I do have an Xbox 360, which also doubles as quite a decent DVD player/media hub (especially since the BBC released iPlayer on Xbox). We don’t have a BlueRay player, I think 3D TV is a gimmick and music is on an old iPod, hooked up to some speakers in our garden room, served up from Spotify on my phone/PC/iPad, or streamed from a iTunes/Spotify on a Mac using an Apple Airport Express. All very 2005.

But then I bought a new television.

Much to my surprise, the SmartTV capabilities on the new telly impressed my wife (who saw the potential for the kids accessing the CBeebies website, etc. from the TV, still under our control) as the Samsung rep took us through the motions in a local Currys/PC World store (by co-incidence, the same rep was working in John Lewis, where we actually bought the TV, a week or so later). I wasn’t sure how much we’d use other apps, but having BBC iPlayer, and to a lesser extent ITV Player (hopefully to soon be joined by 4oD and Demand5), running directly from the TV has real benefit.

Since finding that the Wi-Fi connection in my living room wasn’t up to the task, and putting in a HomePlug Ethernet solution from PowerEthernet, I’ve become more and more convinced that IP TV is the way forward. Catching up with the latest BBC natural history series, Africa, with my kids a couple of evenings ago I was streaming BBC iPlayer content in high definition without a hiccup. When the PVR failed to record a critical episode from Masterchef: The Professionals, our TV’s YouTube app came to the rescue. And, over the weekend, I decided that watching Vimeo on my computer screen was too restrictive, so I connected the Vimeo app on the TV to my account and started to surf through my “Watch Later” list. That’s more like it! New apps seem to be coming all the time – Spotify was a recent addition, as was TED (only a few days ago).

Of course, I can access the same content on a tablet, or a smartphone, or a PC – but the television is still the focal point of our living room and, by integrating my online video consumption into the broadcast mix, it’s suddenly a lot more convenient. I haven’t even started to consider the possibilities of streaming music, photos and video from the computers in the house although a neighbour did drop by to test his XBMC configuration on my TV before he commits to purchasing, and plugging a USB flash drive into the TV to look at some photos/home videos is certainly very convenient.

In less than two months I’ve gone from “there’s nothing wrong with my old Sony Trinitron” to “what, no high definition?” and “I’m sure we can stream from the Internet”.  Something else has changed too: whilst the majority of our TV content still comes from the BBC, or Channel 4, I’m watching more stuff from the ‘net – whether it’s Vimeo, YouTube, TED, the Red Bull Channel, or the BBC Sport app (which, incidentally, showed a great video of [Sir] Bradley Wiggins performing The Jam’s That’s Entertainment at the BBC Sports Personality of the Year after-show party).

For a long time I’ve heard talk of IP (Internet Protocol) taking over from broadcast TV. Now, it seems, this may actually have become a reality…

Embedding streaming video content (e.g. YouTube and BBC iPlayer) in a PowerPoint presentation

One of the reasons for the huge gap in posts here is that I’ve lost most of the last week to creating a presentation for an event where I’m speaking next week. The event is for The Society for Computers and Law, and I’m taking a look inside the black box of technology.  I was briefed not to expect much technical knowledge as the audience are junior lawyers but I figure they probably know quite a lot already as they do work in IT law, so it’s been pretty difficult to work out what level to pitch things at.  In the end, all I can do is take the event organisers’ advice and hope it works out on the night… we’ll see…

Anyway, I wanted to mix things up a bit and avoid death by PowerPoint.  My slides are pretty pictorial (at least they are if the brand police don’t make me change them to something bland and corporate…) but I wanted to mix in some video too. PowerPoint is quite happy to embed video from a file but it’s a bit harder if you want to embed video that’s streamed from the web, for example from YouTube.

There is a way though (without resorting to installing an add-in)…

I found a post from iSpring Software that goes through the process of manually inserting Flash into PowerPoint 2007 (the version I’m using). There’s more detail in the original post, so I recommend that you read it, but these are the basic steps:

  1. Make sure the Developer tab is visible in the ribbon – if not then turn it on in the Popular tab inside the PowerPoint Options.
  2. On the Developer tab in the ribbon, click the More Controls button (looks like a hammer and screwdriver, crossed over).
  3. Select a Shockwave Flash object and drag a rectangle on the current slide. Don’t worry about the size.
  4. Right click on the control and select Properties.
  5. Go down to the Movie attribute and add the path to the Flash movie. This could be a local file… but it also works with  YouYube URLs (e.g.

A couple of points to note:

  • You’ll need to save the Presentation as a PowerPoint Macro-Enabled Presentation (which is a .pptm file).
  • The video content may not actually show in the PowerPoint editor, but it’s there if you start the slide show.

So that’s YouTube… but what about other Flash content? Well, you may find that you can extract an appropriate URL from the embed code – and that’s what I did for BBC iPlayer content.  Note that this works for videos embedded on the BBC website, it’s not for videos downloaded to the iPlayer Desktop client.

I don’t normally rate Yahoo Answers but it did turn up a 2 year-old post from someone called wm1995 that gave me the answer.  Get the embed code for the video that you want to embed and look for the FlashVars parameter:

Add that FlashVars code to the end of and you can view the video in a browser (without the rest of the webpage). Similarly, you can take the same URL and use it inside PowerPoint so, the Movie attribute in the Shockwave Flash object will look something like:”&config_plugin_fmtjLiveStats_pageType=eav1&playlist=”