Category Archives: Blog

Blog about teaching Postgraduate Dental Statistics at Barts & The London School of Medicine & Dentistry

Project Update – Week 3

I’ve now just completed my 3rd lecture in the iteachstats series, so I thought that now would be a good time to update the blog.

The wireless display technology via TightVNC seems to be working reasonably well and I’m getting used to waiting for screen updates when switching slide or switching to a browser.  The lag isn’t too long.  However, to keep it in check, what I have found helpful is to keep the laptop screen (wired to the VGA input of the projector) within view as a kind of monitor of what is happening on the over-head screen.  I’m also finding open-sankore to be an excellent tool.  It turns out that PDF documents can be directly imported into open-sankore and then pages can be annotated.  A minor drawback is that PowerPoint animations don’t work like this.  But, on balance, I think that annotation is much more useful.

Regarding live screen-capture, I’m using ffmpeg.  Initially I did have audio/video sync issues.  This has been resolved by setting the capture framerate to 8 fps.  This works well for presentations and I haven’t noticed any problems when it comes to editing.  My current ffmpeg capture command is:
ffmpeg –rtbufsize 2000M –r 8 –threads 1 –f dshow –i video=”screen-capture-recorder”:audio=”[my audio device]” –s 1280x720 –vcodec libx264 –crf 0 –preset ultrafast –acodec pcm_s161e output.mkv

You may also notice that I used the ‘-threads 1’ switch.  I’m not sure if this helps, but my thinking was to utilise a single thread on a single core for video and audio capture and leave the other CPU core available for SPSS and TightVNC.  It’s not clear whether this helps or not, but the setup works, so I’m happy.

Finally, I wasn’t prepared for how much time preparing screencasts would take!  It’s become pretty much a full-time job just to keep on top of editing/uploading the recorded lecture material, which leaves very little time for producing additional screencasts.  This week was slightly better than last week because there were no A/V sync issues requiring extensive editing.  Nonetheless, I believe that the activity is highly worthwhile from an educational point of view.

Advertisements

Screencasting with ffmpeg on the Surface Pro – Update…

In my previous post I mentioned a couple of issues that I encountered using ffmpeg to screencast on from the Surface Pro.  After a bit of playing around, I seem to have solved these, so I thought that I’d mention it here.

The first issue was that of Windows 8 desktop scaling tricking ffmpeg into reporting the wrong screen resolution.  It occurred to me that the good folk at Microsoft might have considered that this feature could have unforeseen consequences.  So, right clicking on the ffmpeg.exe executable and choosing the ‘properties’ option from the context menu a ‘compatibility’ tab exists.  Within the ‘Settings’ group there is a checkbox giving the option to “Disable display scaling on high DPI settings”.  Checking this box solved the resolution reporting problem!

The other problem that I mentioned was dropped frames and corresponding choppy audio.  I’ve worked around this by using a 2GB  real-time buffer by adding the -rtbufsize 2000M switch.  My ffmpeg command line now looks like…

ffmpeg –rtbufsize 2000M -f dshow –r 15 -i video=" screen-capture-recorder ":audio="Microphone (2- High Definition Audio Device)" -s 1280x720 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le output.mkv

You may notice that I’ve decided to scale the output to 720p during capture.  The Surface seemed to be able to handle this in real-time, and I can’t see the point in storing the larger 1080p files, given that I reduce them for upload to YouTube anyway.

Finally, whilst I’m thinking about it, I have a couple of reminders to self:

  1. When using the Surface Pro for live teaching, turn off screen auto-rotation.  This is annoying and it causes presentations running in Libre Office Impress to crash.
  2. Disable screen savers, screen auto-off and sleep features on both the Surface and the machine connected to the video projector.

Camtasia Studio vs. Open-Sankoré & ffmpeg & handbrake etc, etc…

During my lecture on Thursday, I forgot to switch on the screen recording function in Open-Sankoré, something that I had originally planned to do.  So, I decided to prepare a few mini screencasts to cover the essential material.  This is taking much longer than I was expecting!

Firstly, I have been looking into multiple screencasting solutions.  As an open-source fanatic, I’m always drawn in that direction.  Open-Sankoré is extremely promising and works well… except, it turns out, when trying to capture the desktop to file on the Surface Pro.  In the electronic whiteboard mode, it appears to work well.  However, difficulties appear when capturing the Surface’s desktop.  The problem is that visually, the pen lags and drawing is not smooth.  In the end, I thought that this might be tolerable if it worked overall.  So, I spent just shy of 20 minutes recording my first screencast.  I eagerly opened the resulting video to discover that the sound progressively degraded (speed changes, dropping in and out) until there was no sound at all!

Following this disheartening experience, I quickly fired up Camtasia Studio.  Camtasia is designed and optimised for this sort of thing and had no problem recording both screen and audio.  The result was trimmed and uploaded to YouTube pretty much without any problems.  This is what you might expect from a £200 piece of software.

However, I’m never satisfied with the commercial solution when I know that this can be accomplished using open-source software.  To do this, it seems, does require some determination.  For me, it also required switching software and computers, although I’m sure that this isn’t strictly necessary.

So, firstly, there are three main open-source options for screencasting.  The most powerful and general tool is ffmpeg.  This is a command line utility capable of doing almost anything with audio and video if you have the patience to learn all of the command line parameters and nuances of difference audio/video formats.  Another way of screencasting is via VideoLan VLC player.  I had no idea that it had this capability.  Finally, another piece of software that I have used in the past is VirtualDub.  A very powerful, yet simple, video editor.  On Windows, all of these pieces of software rely on a DirectShow device for desktop streaming.  There are several DirectShow device drivers available for download.  However, the only one that I found released under an open-source license was screen-capture-recorder.

Now, here is where I ran into some problems.  In VirtualDub and ffmpeg, the DirectShow device refused to recognise the Surface Pro’s full HD screen resolution, stubbornly reporting it to be 1280×720.  The consequence of this was only a partial screen capture.  VLC on the other hand did report the full screen resolution using the same device driver, but consistently crashed when halting the capture thus corrupting the video file.  After some messing about and much head scratching, I discovered that the Windows 8 desktop scaling feature was tricking the DirectShow driver into thinking the resolution was only half HD (i.e. 150% scaling).

scaling window

This feature is designed to make items display at a sensible size on a 10” 1920×1080 pixel display.  Setting the scale factor to 100% fixed the incorrectly reported resolution.  Hence, using ffmpeg with the command line;

ffmpeg -f dshow -i video=" screen-capture-recorder ":audio="Microphone (2- High Definition Audio Device)" -r 24 -s 1920x1080 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le output.mkv

I was able to capture my second screencast .  I’ve opted for capturing uncompressed video to ensure the highest frame-rate.  The files are then transcoded post-screencast.  This is where I encountered another difficulty with ffmpeg.  My transcoded files wouldn’t play in any of my usual media players!  I have no doubt that ffmpeg is more than capable of producing widely playable video, but not with my naïve settings.  This is where I employed another well known open-source video transcoder, Handbrake.  Handbrake was able to read in my raw .mkv video file and spit out an .mp4 file suitable for iPads, Android devices and PCs.

After all of this, it then occurred to me that I still needed to edit the video.  VirtualDub wasn’t playing nicely with my newly transcoded video (or the raw video), so I opened up the .mp4 file on my MacBook Pro.  One thing that I like about Apple OS X is that it includes iMovie, which is a pretty decent video editor without shelling out additional cash.  iMovie happily imported my .mp4 file, allowed me to edit it and then export an Apple QuickTime .mov video file.  I’m not entirely satisfied with the .mov file, so I used HandBrake one more time (on the Mac this time) to transcode the video back to a universally playable .mp4.  This was then uploaded to YouTube and shared with the students via facebook and twitter.

So, if you want an easy life, buy Camtasia.  However, with a little effort there is an alternative route via open-source software.  That said, the ffmpeg screen capture didn’t have perfect audio.  During capture, video frames were dropped and I suspect that this is where corresponding audio was also lost.  I’m sure that this can be fixed, possibly by adjusting some of ffmpeg’s many parameters.  Another culprit may be that I opted to stream my full HD display to disk.  Next time I may try a lower resolution display setting and see if this improves things.  So, I will work on finding a solution and post my findings here.

Nevertheless, the Surface Pro is proving itself to be a very capable little device.

Live Wireless Screencasting

So, I’ve just finished my first tutorial using the Surface Pro for teaching.  A few teething issues, but overall it actually worked – technologically at least!

So, my wireless display solution was as follows.  I used VNC (virtual network computing), with a TightVNC server running on the Surface Pro and TightVNC Viewer running on my Dell Latitude E4310 (Windows 7).  The Dell was plugged into the VGA connector for the display projector.  The Dell was connected to a Wireless Router (LinkSys E900) via Ethernet cable and the Surface Pro was connected to the same network using WiFi.  This setup is depicted below.

wireless display HD

I had previously tried to do this by setting up a peer-to-peer WiFi link between the Dell and Surface.  Whilst this worked, I found the connection unreliable.  Using the router seemed to fix reliability issues.

Today I had TightVNC server and viewer setup as shown below.

vnc server

The viewer software on the Dell happily connected to the server running on the Surface and mirrored it’s screen (see settings below).

vnc client settings 2

I opted for full-screen mode, which was happily replicated on the video projector too.  Below I’ve posted an example of this, but using a flat-screen monitor instead of a projector.

VNC Live Screencasting

Whilst this setup worked, it isn’t perfect.  Latency can still creep in.  This is probably the biggest issue when I am using on-screen drawing tools (Open-Sankore) to annotate the screen.  Some of the feedback indicated that this was losing some students.  I’ll have a look at the VNC settings to see if this can be improved.  I used the ‘high speed network’ setup, but perhaps optimising for a lower-bandwidth connection might help.

MS Surface Pro as a Digital Whiteboard

Turning the surface pro into an interactive whiteboard

So, I’m still trying to work out the best way to wirelessly screencast live from the Surface Pro. But, I’ll write about that another time. However, part of the reason for buying the Surface Pro (as opposed to any other tablet) was because of its high resolution stylus input. This is a potentially amazing asset for teaching, turning the tablet into an interactive whiteboard.

However, to use the device in this way requires some software.

For starters, I visited the Wacom website and downloaded the latest stylus drivers to enable pressure sensitivity in all applications. Then I started looking for software options. There are the usual candidates, i.e. Camtasia Studio and Ink2Go. However, being a fan of open source software, I’ve also discovered Ardesia a simple, screen annotation program and a more fully featured digital whiteboard called Open-Sankoré. The latter of these looks very exciting, having the ability to record annotations and flip between a whiteboard and whatever is on the desktop.

I’m not entirely sure which one to use yet and will probably get Camtasia Studio anyway, simply because of its PowerPoint plug-in. Nevertheless, I’m now on the lookout for something similar from the open source community that plays nicely with either Libre Office or Open Office Impress. I also haven’t decided whether PowerPoint/Impress annotation is strictly necessary. Open-Sankoré looks like it fulfills many of my requirements and has the potential to become my go-to digital teaching aid. That said, it did crash earlier whilst saving a screen recording, and using its highest quality settings appeared to introduce lag between stylus motion and appearance of lines on-screen.

For now though, I have some exciting tools and look forward to finding out which ones work well in a real teaching environment and discovering how best to apply them.

Looks like I’m not the only one…

Just searching around the internet and discovered that I’m not the only person to be impressed by the MS Surface Pro for teaching and learning.

I’m currently trying to figure out the best way to use the device for wireless screen display. The Netgear Push2TV device that I bought looks like it won’t work with the Pro until Windows 8.1 is released next month. For now I’ll work through various options such as using VNC and screencasting with ffmpeg… Initial experiments suggest that latency is the big issue here.

The Microsoft Surface Pro Tablet PC

So, I’ve taken delivery of my new MS Surface Pro tablet PC… now what? And why?

To me, the surface pro seems like the perfect teaching tool. It is a full blown PC, with a high-resolution, pressure sensitive pen input device. All of this is built into a 10″ tablet format. Amazing!

I’m pretty excited about using this device to teach statistics. Stats is one of those subjects where being able to draw and annotate presentation slides is invaluable. This is where I expect the stylus input to come into its own. However, where I think the possibilities really open up are for providing follow-up explanations to small groups of students. The tablet form-factor will hopefully allow me to work with individuals in the class and project this up onto the lecture room screen and record the event for posting online. We’ll see how this works in practice!

I expect there will be a learning curve regarding what works and what does not, and I will report on the experience here.

That aside, the surface pro is fantastic, I’m really impressed with it already.