James O'Neill's Blog

January 6, 2011

Making DVDs on Windows 7

Filed under: Music and Media,Windows 7 — jamesone111 @ 2:53 pm

Since I acquired my Windows 7 phone and the Zune software the proportion of my music which has been acquired by download has more than doubled, from almost none to hardly any. It’s probably a generational thing but I like to own the artefacts : CDs and DVDs (and before them I liked to own Albums and VHS tapes).  If one just wants to save money it is easy to record a complete series of a show with Windows Media Center, adding disk space as needed, I can defend bootlegging something that can’t be bought – it preserves something without depriving anyone of income.  But I prefer to have the DVDs if they’re available: as the world shifts to downloading content without artefacts I wonder if one will feel obliged to contribute to the income of others.  I have replaced whole series recordings of  “Doctor Who” with the six-DVD box set – since it can be had for as little as £12.99 it’s not worth making bootlegs into DVDs. I was reminded of this recently…

Just before Christmas I recorded BBC4’s showing of  “Macbeth” with Patrick Stewart in the title role; it runs for just over for 2 1/2 hours and produced a 6.2GB .wtv file. Enough people have looked for it that Amazon UK  suggests “Macbeth Patrick Stewart” in the search box but there isn’t even a pre-announced disk, so I decided to copy it off my hard disk.  My stock of blank DVDs are the 4.7GB single layer variety. This file called for a 8.5GB Dual Layer disk – my new Dell laptop has a PLDS DS-8a4s drive which the maker’s site says supports dual layer, The blank disks are hard to find: Ryman was the only place in central Oxford where I could find them – at £12.99 for a pack of five Imation disks. That’s the same price as the set of Six Doctor Who disks, printed boxed and so on, and it isn’t just high street mark-up, Amazon’s price is the same. Imation’s dual layer disks are more than seven times the price of their single layer cousins. .

I’m left asking Why put myself through the frustration of converting Media Center files to DVD movies? I could have transcoded the file to something smaller than 4.7GB. But instead I bought a pack of disks and set off down the path of making a “proper” DVD. And some of lessons might be worth sharing.

Media Center records a couple of minutes preamble and five of over-run, to cope with transmission times being slightly off. Doing a nice job for a “proper” DVD with nice menus and so on demands that the .WTV files are trimmed (there were no commercials in Macbeth – this being the BBC, but you’d want to cut those out too)- the “Burn CD/DVD” option in Media center can’t trim files, and few editors work with .WTV. The choice is either use Windows Live Movie maker or spend time transcoding into another format before editing. I’ve known sound to go out of sync in transcoding and that’s not the only complication…

image

On the left is part of file properties displayed by Windows Explorer: 704×480 x 60 fps is “NTSC format”. Since the recording was made in the UK it should be 576 line “PAL format”, and this is not the only place NTSC turns up where it should not. 
On the right is Windows media player showing the same file really is in “PAL format”. I put PAL and NTSC in quotes because they really define analogue colour encoding, but they double as shorthand for 576i/25 fps and 480i/30 fps respectively. Note the aspect ratio on the right says 16:9 but if you multiply 576 by 16/ 9 the image should be 1024 Pixels wide. This is because widescreen video is stored and transmitted anamorphically  – it is compressed horizontally and expanded during playback.

DVD video is MPEG encoded and stored in files less than 1GB in size with .VOB extensions. Windows Live Movie Maker can read .VOB files and in an ideal world it would create them and take care of DVD menus. It doesn’t. It passes a .WMV file to Windows DVD Maker which re-encodes it. That intermediate file is in NTSC format DVD maker can write PAL format, but there’s no benefit scaling back to 576 lines when video has been scaled down to 480.

To get round this I tried creating 720×576 custom output format in Movie Maker, but there is no anamorphic encoding option: square pixels yield a letterbox picture, 720 wide x 405 tall with 171 lines of black border. I had to create a format of 1024×576 – which DVD maker would convert back to Anamorphic. I found a better way here: Movie Maker’s pre-defined video profiles can be adjusted: I had Media Encoder and its tools installed, so I made a copy of the existing profile with a .BAK extension (if you change the name, Movie Maker can still read the file, and may ignore the modified version). I fired up Windows Media Profile Editor as administrator and changed the settings from NTSC to PAL, 3MBs to 6 and enabled non-square Pixel output. That was one problem solved. I wanted to output the sound track of another recording, but Movie Maker ignores audio-only profiles created in Profile Editor

My recording of Macbeth lasted 157 minutes and Windows Live Movie Maker warned me:

image

DVDs can use different levels of MPEG compression, even within a single disk but Windows DVD Maker’s compression is fixed. It also seems determined that single or dual layer disks always hold 150 minutes of video.  Live Movie Maker spent over an hour outputting a 151 minute version of Macbeth, DVD Maker spent a similar time re-encoding it, copied it the DVD and failed at the end of the burning process. The same thing happened with a shorter edit. Having wasted an afternoon and two disks, I swore at DVD Maker (and myself for trying to make the DVD which the BBC should be selling) and decided to just copy the .WTV file using Windows Explorer. This failed too, with Windows suggesting I check the drive’s firmware; it is available from Dell, but I already had the current version. Roxio Burn, which Dell supplied with the laptop, gave me error  0x80041024 and a fourth coaster. A quick search revealed Roxio had an update to fix this error with other PLDS drives, but I already had that update thanks to Dell’s update system.

I have a Samsung USB drive for the 3 DVD-less machines I have at home, I plugged that in and explorer copied the .WTV file to my fifth and last Dual Layer disk without problems. For the moment I’m blaming the PLDS DS-8a4s for the burning problems.  My first contact with Dell support got a response that the machine doesn’t have a Dual Layer drive – which is odd considering LiteOn say it is Dual Layer and Roxio and Explorer both see the disk as 8.5GB and try to write to it. I have to see where that ends up.

Keeping .WTV format avoids transcoding issues and saves HOURS, and it will  preserve subtitles transmitted with the programme. Along the way I right clicked the file and chose “Convert to .DVR-MS format”, I couldn’t distinguish between the images in the resulting 3.7GB file, and the 6.2GB original and the conversion was fast (and nearly the same time is saved copying a smaller file to DVD) : I could have avoided the whole business with Dual Layer disks. And I’m more convinced than ever that if I want a nice DVD of something the right thing all round is to buy one.

Advertisements

December 15, 2010

My review of Windows Phone 7 on the HTC trophy

Filed under: Exchange,Mobility,Music and Media,Office,Windows Phone 7 — jamesone111 @ 7:51 pm

I have already looked the move from Windows Mobile 6.5 to Windows phone 7, from the point of view of what’s gone. Now I want to look at what’s better.

The Trophy is the thinnest phone I have ever had, at 12mm. Its frontal area is fractionally larger than the Touch pro 2 I had before, but without the need to accommodate a keyboard, overall volume is down about 20% and weight down about 25%. By way of comparison it 3 grams heavier than the Iphone 4, and a whisker bigger in all dimension. It’s my sixth HTC device and the tidiest design, the finish feels nice in the hand, and the ergonomics are good; held in two hands – like a camera – the camera button is under right index finger, as it should be.  The camera has a 5MP sensor I remain to be convinced that the lens justifies even 5MP and an LED flash, so it is usable under more circumstances than its predecessors. The Touch Pro 2 had a second, front-facing, camera for video chat, but I never used it and so it won’t be missed..

Holding the device in the left hand to work with the right, puts the volume controls are under my thumb and (like the camera button and Power button) they work when the phone is locked.  When the phone is unlocked these buttons bring up a mini menu with Music player controls and access to the ring/vibrate settings; if the phone locks with music playing this menu appears when you tap the power switch – which is naturally under the index finger – so you can pause or skip tracks without needing to unlock the device.
By contrast, Mobile 6.5 devices locked out all the buttons  – even power – so the only way to silence one left on a desk to ring was to remove the battery. Now colleagues can turn a phone off or set it to silent and add a photo to remind you not to leave it on your desk when you go to meetings. You can enable Voice dialling while locked, on Mobile 6.5 you needed to add Voice command, now a subset of it is built in.

Music shows the change from previous Windows Mobile devices: Firstly Microsoft’s hardware spec demands a Micro-USB connector (which is becoming the standard for all phones), with a standard 3.5mm headphone jack: that means the end of HTC’s combination audio / Mini-USB connector which required an adapter to connect headphones. Pulling out the headphone connector pauses music (instead of blaring out to a carriage full of tutting commuters). And secondly the old devices tried to shoe horn Windows-Media-player into a mobile device:  sound quality was fine but the experience was way behind that of proper music player (which I never wanted to carry).  The new phone is a Zune:  Zune isn’t the market leader people who have them really like them, and I can see why.

Over the years I had grown used to the mobile mail/messaging, contacts and calendar applications being the round pegs of their Outlook equivalents hammered into the small square hole which is a mobile display. The same philosophy which got rid of Windows media player has seen these replaced with versions work better on a phone and took zero time to learn.

Volume, camera and power are mounted on the edge, on the front are three buttons which take longer to explain than to learn   “Back” and “Start” are the main navigation buttons going 1 step at a time or straight to the Start screen and “Search” which applications can use to start their own search (want to find a contact ? – Press search in people – it’s very intuitive), otherwise it launches Bing.  The search destination in Internet Explorer is fixed by the carrier: that’s out of character for the phone, you can remove the carrier’s or phone maker’s apps, but with Vodafone I’m stuck with Google in the all-new IE. IE supports multiple open pages, and “pinch zoom”: I’m still learning to tap accurately with a fingertip (the old touch screens worked with a fingernail or any stylus, the new ones don’t – though there are capacitive styli available to stop me obsessively polishing finger-marks off) so zooming in on a link is good and pinch zoom has come more naturally than using the on-screen keyboard.  Zooming is smooth and rendering is snappy which I attribute to having graphics acceleration as standard, rather than the faster processor. Competing phones have graphics acceleration but  introducing it piecemeal into Windows Mobile 6.5 (or earlier) wouldn’t have worked: the “Break with the past” means all apps can count on a certain level of graphics,  accelerometers and so on,  very little should be specific to one phone. Nowhere is the new hardware standard more obvious than in games. 

This is my first phone without built in games;  odd as Microsoft positions it as consumer more than corporate, but it means that people will find their way to the Market Place. Plenty on offer is free, and most paid games and apps have demo versions. The quality runs from truly great to truly lousy. Videos and music are downloaded in the same way as software, all three can be driven from the phone or the PC Zune software. I blogged early in the life of Vista that Windows had what it took to handle podcasts, it was just ugly and buried: finally Microsoft has decent podcast support through Zune. Microsoft are pushing Zune pass, all you can eat music streaming for £8.99 a month – which works from the Xbox, Phone or PC – as well as traditional purchase and download

There are some new look and feel elements, so besides the search button, when the built-in apps produce a long list – like songs or people – they break it up by letters: pressing a heading letter displays the whole alphabet, as a “jump-to” list To listen to “zest” or phone “Zoe”, a couple of taps saves a long scroll. It will be interesting to see how developers stick to the style – I  compared two Sudoku games one would look wrong on anything but WP7 and another looked like a port by people who hadn’t seen a finished phone. Chunky tiles on the start menu make simple targets to tap on)Word press have copied it for their newly launched app.) I already think of the icons interface we’ve grown as the Windows 3.1 program manager, the phone’s start menu is like what we’ve been used to since Windows 95/NT 4. “Start” button jumps to something like main part of the menu; and “All Programs” is off to the right. I looked in settings, for “Uninstall” without success: taping and holding anything brings up an action menu (think “right-click”) for a  program this has options to uninstall, pin to the start menu or write a review for Marketplace.

There is a distinction between Marketplace apps and the built in ones; the latter can run in the background (and update their tiles)  downloaded ones deactivate when they lose focus – although the phone locking doesn’t count. Storage for apps is compartmentalized –so a rogue app can’t do much damage, but the Trophy’s storage device isn’t removable (it is on some WP7 devices, but the phone does some weird magic with the file system, so the card won’t work anywhere else). There is a hack to make Zune files visible from the PC, but it can’t see any  other “compartments” The Zune software will only sync Music Videos and photos, Contacts and Appointments need to go via Exchange or Windows Live.

One-note syncs with Windows live, which is great, but you can only to get something from the other office apps to your PC via SharePoint or by mailing it to yourself. The button attach inside mail only offers photos. I had a look at the developer tools and there is no API for add-on apps to e-mail an attachment or to upload / sync to Windows live and so on.

These are among the things which I hope to see fixed in an update early in 201.1 Paul Thurrott has a long list of What needs to be fixed in Windows Phone, here’s my cut down version of his list.

  • Add Copy/cut/paste
  • Allow Custom ringtones, notifications, and alarms
  • Support Multitasking for Third-party apps
  • Appear as a camera to  photo importing applications, e.g.  Windows Live Photo Gallery
  • Allow Zune PC software to be extended to Sync 3rd party file types.
  • Allow third party services to integrate hubs; The Pictures hub should share with and see photo services and Twitter should be able to add people to the people Hub
  • Support all the policies in Exchange ActiveSync (EAS)  instead of just a subset
  • Provide Access to Microsoft services in all supported locales (Voice search with TellMe is US only)
  • Provide a  service like MyPhone for Mobile 6.5 to deliver Cloud-based backup
  • Provide Windows Live SkyDrive in all of Office Mobile
  • Provide Developer APIS for all functions (speech, mail attachments, live sync)

Most of the list can be summarized as (a) Improve support of cloud services (or the Services themselves) (b) make it easier to get stuff on and off the phone (c) Allow developers to do more. The updates will come when Microsoft declares them ready, not when/if the device makers and carriers get round to it, and yes that’s another plus about saying goodbye to Windows Mobile 6.5

March 9, 2010

Cars, social media, phones, windows media and there’s no hiding with co-pilot.

Filed under: General musings,Mobility,Music and Media — jamesone111 @ 3:39 pm

As titles go that’s an odd one, but stay with me.

I’ve written before about my Citroen C6: Before Christmas a warning message popped up saying something was wrong with the hydro-pneumatic suspension which give the big Citroens their wonderful ride. A visit to the garage confirmed the problem was real – not a diagnostic issue, and lay with a part which rarely goes wrong i.e. one no dealer keeps in stock. It would be take a day or two to get the part and by the time it was fitted I needed to be at Tech-ed in Berlin. I expected the car to be ready when I got back, but it wasn’t. Having replaced the faulty part it turned out it had failed because of a fault in the hydraulic pump: this is beyond rare – Citroen UK told me later that they’d only ever supplied one before and that was after an accident, but I’m getting ahead of myself. The pump should have arrived before I got back from Tech-ed, but there was no sign of it. We then began a sequence where every few days I would call the garage or they would call me, and I’d get the news the pump had not arrived but would be there in a couple of days.

I’m not totally without patience, but after 3 weeks I was getting cross and started to tweet about it, and found Citroen UK on Twitter. So I posted things like Day 26 of my Citroen C6 being in the Garage. @Citroenuk promised to deliver the part today and they #Fail to. Now promising Thursday. It was partly to vent and partly to see if Citroen responded – if your organization is “doing social media” you really should know what you’re going to do if someone complains – we try to do this at Microsoft when it isn’t the “I hate Microsoft because they’re a big money making concern” variety.  Citroen UK’s twitter account turned out to be someone from  marketing who took enough ownership of the problem to get some information and make sure the right person saw it.  That was how I ended up talking to Brian (I’ll keep his last name out of it – I can see just people calling Citroen asking for him). If Brian was trained in customer care (rather than doing it by instinct) his teacher would have been pleased: he apologized (sincerely – not in an over the top way), saw the customer’s point of view “I know Caterpillar have a ‘parts anywhere in the world in 24 hours, or Cat pays’ promise. You should be able to get a part here in 24 days for your top of the range model”,  explained why it had gone wrong (the pumps showed as in stock but been taken to be modified to the latest specification), committed to speeding the resolution of the problem and promised to follow-up to talk about how Citroen could rebuild the relationship. I’ve had Citroens (7 of them) for 16 of the last 20 years, so I guess I qualify as a loyal customer they’d want to keep. 

USB box,  in glove compartment, showing all 3 connections - click for a bigger version Brian had an unexpected spell off work so it was well into January by the time he got in touch, and offered me a choice of accessories as compensation. I wanted to be able to plug in a music player in the car – I’ve tried those little FM transmitters and found on a decent length journey they’re more trouble than they’re worth. The accessory catalogue had a “USB box” which plays MP3s. Some of the other options which Brian was willing to pay for were pretty pricey and would have felt like taking advantage, but this seemed OK. It took a while to get the kit and sort out a day to fit it, but it went in last week and I have to say it’s a pretty neat gadget. The handbook suggests it goes in lot of cars – Peugeot and Citroen across the PSA group; it has a USB socket which is powered, so will charge my phone (I’ve twice blown the cigar lighter socket fuse with cheap adapters), plus a dedicated iPod socket – which will work with my wife’s nano, and a 3½mm jack plug for anything else. I tried playing a few MP3s I’d copied to a memory stick – and the first impression was nice sound quality: the integration with the built in Stereo isn’t perfect but is quite good enough.  But there was better news: it turns out the USB box plays pretty much any format, including WMA, WAV and even OGG format. Most of my music is in WMA format and sync’d to my phone, so just I tell the phone to connect in storage mode by default , plug it in (even if locked) and the USB box reads the files and plays them.

Playing OGG isn’t quite the advantage it might be when Co-pilot is installed on the memory card, because it uses OGG files for all its messages, and the USB box thinks it should play them – so the first thing it played was “Take 1st exit at roundabout” , “Take 2nd exit at roundabout” and so on. I set the files to hidden, interestingly file explorer on the phone ignores the hidden attribute, so I can’t blame the USB box for doing the same. It’s not an insurmountable problem, unlike its predecessors this phone has enough main memory to allow me to move Co-pilot’s sound files off the storage card.  So that’s another plus for the phone.

And as far as the car is concerned it’s one more thing to like about driving it, I’ve had another, minor problem since which was quickly fixed and thanks to Brian I’m back in the happy customers column.

This post originally appeared on my technet blog.

February 5, 2010

Video, Windows 7 and Windows Phone

Filed under: Mobility,Music and Media — jamesone111 @ 1:59 pm

I keep thinking back to the theft of my laptop last year. I’ve had maybe a dozen laptops over the years and I haven’t really the same bond with them that I have with, say, my cameras. Even so whichever laptop I happen to have at the time goes everywhere with me like some kind of comfort blanket. It might be a business machine, but I do personal stuff on it. There’s business payoff to that that, the fact I am on-line and signed into Exchange and Office Communications Server when I’m editing photos (for example) means that colleagues from the other side of the world can get hold of me at all kinds of odd hours, but it’s my choice of hours.  Windows 7 is the first time that we have put Media Center into the Professional and Enterprise editions of the product, so now I have a machine which is both protected with Bitlocker (good for IT) and when I’m travelling I can take the USB TV receiver or programmes I’ve recorded on the Media Center at home.

With the new phone I thought I’d try taking a TV recording I’d made under Windows 7 and moving it over from the Sync panel in Windows Media player. This works, but with the downside that the video is resized down below the resolution of the screen and I went off round the following loop.

Click for a larger version * Expansys can supply me with a Video cable for the phone
* I now have a 16GB memory card in the phone. [This was a special offer from Expansys, £30.47 including taxes shipping etc –my memory of prices gone by makes this seem so cheap. How much cheaper will memory be in a year or two.]
* If I convert my TV recordings to 480p resolution WMV I can then play these from the phone to a TV or whatever

Then I came to a stop because:

(a) The 480p / 30 Frames per second video that came out of Movie maker was too much for the phone (it might be speed of reading from the card or CPU/Graphics chip might not be up to the job, it might work better with a different codec)
(b) I’m probably going to have to power the phone because this will chomp through the battery at quite a speed. Where will the power supply be ? In the bag with my laptop, along with the video cable.  – or more likely if I’m travelling I will charge the phone from the laptop.

In short the phone is a nice music player but it is best suited to playing low-res video. If I’m anywhere that I can use a big screen I’ll have my laptop. Since Windows 7 gives me media centre why would I waste time with the other stuff ? 

Just on music front, I’m expecting to have a combined USB / Jack plug connection box in my car soon, it can play MP3 files via USB or anything the phone can output (via another connection adapter) to a jack plug. I have put voice command 1.6 on the phone so I can control Windows Media player by tapping my bluetooth earpiece and saying “Play artist/Album/whatever” – which is always a fun trick when the phone is in one room and you are in another. In the days when 512MB was a big storage card it made a lot of sense to use WMA files as used less space than Mp3 for the same quality. But depending how well the MP3 side of the adapter integrates with the existing stereo controls I want to use the phone’s ability to go into “Mass storage class” mode and act like a USB stick, which which will mean transcoding (or re-ripping) music to play in the car. I’ll be spending enough time doing that to not want to bother doing the same for video. Heck, I still have a decent pile of vinyl albums I keep saying I will digitize and haven’t got round to.

This post originally appeared on my technet blog.

November 17, 2009

Making word clouds (Part 2: how to use it , and clouds from twitter).

Filed under: Music and Media,Office,Powershell — jamesone111 @ 2:04 pm

Attached to this post is a Zip file containing Twitter.ps1 the PowerShell script I use to get information from Twitter, and since the word cloud work grew out of that it has ended up in the same file.  It also contains noise.dat the list of noise words which you can customize.


If you want to use it you will need to have PowerShell V2 installed – if you are on Windows 7 or Server 2008-R2 you have it already, otherwise you need look up KB968929 and  you can download WINRM and PowerShell 2.0 for anything back to Windows XP. The code has been tried on the Beta of office 2010 and on office 2007 and should work with PowerPoint from earlier versions but hasn’t been tested.


Click for a larger versionThe first thing you need to do is to load it , any version of Windows form Vista onwards flags files which have been downloaded from the internet and PowerShell can be a bit fussy about those. I suggest that you when you have downloaded the ZIP file you right click it go to properties and click Unblock on the general page before you extract the files. Once you have extracted the files start PowerShell and you need to enter two commands 
CD [folder where you extracted the files]  


. .\twitter.ps1


note that is Dot, space, dot backslash twitter.ps1:  it won’t work without the dots.


I have included a sample file, Macbeth.txt to get you started, it is the text of… the Scottish play. So you can now type the command


Format-wordCloud Macbeth.txt


Click for a larger version PowerPoint should start in the background and it will put together your first word cloud. The text for this will be all horizontal, all default colours and fonts and all words and no phrases. The biggest text will be 80 point and the smallest 16 – if your example turns out like the first one of mine you can see that we might want to change the –maxfont and –minfont settings or the –howmany parameter to fill the space better. When it finishes the function gives a fill percentage – that is: the total space occupied by the words as a proportion of the slide area. Mine came out at just under 50% , and experience tells me not to expect more than 75% so I might increase the font size to –maxfont 100 –minfont 20 as there are plenty of words – I don’t want to fill the space with more words.


It’s not bad for a first attempt , but it has my, our, your,his, me , him , us and No too prominently, these can be taken out with the –extraNoisewords parameter,like this:


Format-wordCloud macbeth.txt -ExtraNoiseWords  my, our, your,his, me , him, us, no


We can introduce some colours – if you enter the this command it will show you what the colour selections are


$RGBSet


The colours numbers are Red + 256 * Green + 65536 * Blue , so the default is 4 black, 1 red, 1 green , 1 blue.
In addition we can make about 25% of the words appear vertical, and use a font which looks right for Shakespeare


Format-wordCloud macbeth.txt -ExtraNoiseWords  my, our, your,his, me , him -RandomVertical 0.25 -RgbSet $rgbset -fontName “Blackadder ITC”


Click for a larger version The final thing to try might be to look something on twitter. It takes several seconds to run a twitter search for the last 1500 posts (that’s the –Deep switch) so it is better to store the result, in case you want to run with a different set of parameters so let’s see what is in showing up in the F1 world today, first get the tweets , the put just their titles into the cloud.


$searchResults = Get-TwitterSearch “F1” –deep


$searchResults | Foreach {$_.title} | Format-wordCloud -phrases -RandomVertical 0.25 -RgbSet $rgbset –uniqueLines –maxfont 60


The -uniqueLines switch is there for something which I have mentioned before – the tendency of people to retweet an identical post many times – you can spot this happening when a long phrase becomes very prominent, which is often the case if a couple of news stories dominate a search, even with this in you can a few stories are repeated in slightly different forms.


I can’t show everything here. Obviously you can do a lot once the slide is created in PowerPoint: one favourite trick is to do select all and set the animation for every bit of text to Appear 0.1 second after previous.  I tweaked the colours and layout for the F1 tweets from twitter in PowerPoint as well. I haven’t shown –randomtwist (the value is the maximum angle of twist in degrees), but that needs a lot more fiddling after the layout is done. Nor have I shown -randombold or -randomItalic which work just like random vertical – (phrases are always in italic). No two layouts which use any of the Random parameters will be identical, and sometimes it is worth running the format again with the –useExisting switch(and no filename –text or piped data) to see if you a second one looks better than the first.


You can export $words to a csv file with $words | export.csv –path MyWords.csv , and modify it in excel or use it as a template for your own text. If you do you’ll notice there is a URL column – you can assign links to the text if you want to. Once you have the text you want as a CSV file you can reimport it with $words = import-CSV MyWords.csv and run format-wordcloud with the –useExisting switch


As you can see there’s lots to play with. PowerShell seems quite happy to process very large amounts of text – I got the text of War and Peace and it took a while to process the words but it worked just fine. So try your own text and combinations of settings.  But let me stress the disclaimer that covers everything here – it is provided “AS IS” with no warranties, and confers no rights.


This post originally appeared on my technet blog.

Making Word clouds (Part 1: how it works).

Filed under: Desktop Productivity,Music and Media,Office,Powershell — jamesone111 @ 9:41 am

I’ve been playing with word clouds on and off for the last couple of months, and finally I’ve decided the time has come to share what I have been doing. 


Word clouds turn up in all sorts of places, and I wanted to produce something which could take any text, be customized, and let me edit the the final version. The last requirement was key, because anything which produces a bitmap graphic at the end is not going to be easy to edit. I’ve seen it done with HTML tables but they are hard redesign (You can’t move words round easily). So it needed to be something like Visio or PowerPoint, or WMF which can produce a drawing containing text. Eventually I settled on PowerPoint. Although I’m using the beta of Office 2010 it relies on an object model for PowerPoint which hasn’t changed for several versions. And, since I only seem to program in PowerShell these days I wrote it in PowerShell. This gives me an easy way of taking any text – like Tweets from Twitter – and pushing it into a cloud. So I wrote my longest single PowerShell function yet to do the job.


wordCloud



  1. If Not already connected to PowerPoint, get connected. Start a new, blank, slide

  2. Get a list of “Noise words” from a file (I used a copy of the Noise.dat, which is part of Windows Search, as a starting point) and merge that list with any passed via the –ExtraNoiseWords parameter.

  3. Take text from a file (specified by the –Filename Parameter) , a PowerShell variable or expression (specified by the –text parameter) or from the pipeline in PowerShell, and  produce a “clean” set of words by:

    1. Removing anything which is not a space, letter, digit or apostrophe from the text.

    2. Removing `s at the end of words, and convert “_” to space.

    3. Splitting the text at spaces.

    4. Removing “words” which are either URLs or numbers .

  4. Count the occurrences of the words , and determine the “cut-off” frequency which words must meet to get into the final cloud (a –HowMany parameter sets the number of words, if this is the default value of 150 and the 150th non-noise word occurs 10 times, accept all words with 10 occurrences, even if that gives 160 non-noise words )

  5. if the –phrases switch is specified:

    1. Find phrases which contain any of the words which meet the cut-off frequency.

    2. Ignore those phrases which don’t make the cut-off frequency.

    3. Repeat the process looking for longer phrases which contain the phrases which were just found. Keep repeating until no phrases are found which meet the cut-off frequency.

    4. Add the phrases to the list of found words and reduce the count of their constituent words.

  6. Remove noise words, and two word phrases where one is a noise word, and words which do not reach the cut-off frequency, sort the list of words by frequency and then number of letters

  7. Store the words in a global variable ($words) so that the function can be re-run with the ‑useExisting switch. $words can be reviewed or exported and re-imported later.

  8. If the –noPlot  switch is specified , stop leaving the words and phrases found and their counts in $words.

  9. Set additional properties on the word:
    Set the font size for the word, scaled between the values set by the -minFont and –maxFont parameters (these default to 16 and 80 point respectively)
    Set the margins to the value specified in the –Margin parameter – Powerpoint uses quite generous margins by default, but script defaults to 0.
    If –RandomVertical and/or -RandomBold, and/or -RandomItalic values are specified, generate random number for each and if it are less than the specified number, set the text attributes to true
    If -Randomtwist is specified set the twistAngle attribute to a random amount up to the value of randomtwist
    If multiple rgb colours have been provided using the -RgbSet parameter, select one at random. If not the default PowerPoint colour will be used – normally black.
    If the -fontname parameter has been provided  and is a single name, set the word to use it it, if multiple fonts have been specified select one at random. If not font is specified the default PowerPoint font will be used. 

  10. Place the first (most common) word in a Powerpoint Shape (rectangle) at the centre of the slide, store the positions of its corners as properties of the word

  11. Place each remaining word in its own shape at the top left corner of the slide, setting its properties as already defined. Get its size from PowerPoint, then try to place it around the boundaries of each existing shape, stopping when the placement won’t overlap with any of the other placed shapes. (The starting point for this method was something I read by Chris Done it was here but his pages on word clouds only show up in Search Engine caches now.)  Note that the the more shapes which have been placed, the longer each new shape will take to place. Store the positions of the newly-placed shape’s corners as properties for use placing future shapes.

  12. Stop when either the number of words cannot be placed exceeds the value in –maxFailsToPlace (3 by default) or all words have been placed successfully.

In part 2 I’ll include the PowerShell code: the example above was from the Tweets about teched and I’ll show some more examples, with the command lines which were used. As you can see from the above, there are 20 or so parameters to explain.


Update Thanks Ian for letting me know that Chris’s Page is missing in action, the italicized part of point 11 has been changed accordingly.


tweetmeme_style = ‘compact’;
tweetmeme_url = ‘http://blogs.technet.com/jamesone/archive/2009/11/17/making-word-clouds-part-1-how-it-works.aspx’;

This post originally appeared on my technet blog.

September 27, 2009

Windows 7… “Media for everyone !”

Filed under: Music and Media,Windows 7 — jamesone111 @ 8:12 pm

From the betas of Windows Vista until the start of September I ran the Ultimate edition of Windows, rather than the enterprise edition. We had a perfectly good enterprise edition as a network installation, but in Vista there one some features missing from enterprise and from time to time I needed to talk about those. I never quite understood the thinking that video never needed to be edited in a business context.

A check of the version comparison page shows the way things have have changed for Windows 7. Professional is a super-set of Home Premium; Enterprise and Ultimate are effectively the same super-set of professional, just with different licensing. So Media Center and so on are in the versions found in business. I don’t see many IT departments thinking “oh great we’ve go Media Centre on every PC” for desktop PCs in the office you might turn it off (via Windows features in control panel). But think of the road warrior carrying a laptop round the country: plug in a USB TV stick (I have one from Hauppauge but there are others out there – prices now start at under £20) , and all the Freeview (or other DVB-T) channels are watchable from a hotel room or wherever: so is anything recorded on Media Center at home

Like quite a few things Media center has been given an additional polish between the Windows Vista an Windows 7 releases : for example it colour codes different program types, and for movies on TV it will also pull down a miniature of the movie poster. The movies menu shows all the upcoming movies with their posters.

Click for a full size version Click for a full size version

During the beta I discovered “My Channel logos” : it changes the text for the channel names with their logos which you can see in the left picture: well worth the $3 donation the student who created it is asking for I’d say.

This post originally appeared on my technet blog.

January 19, 2009

Songsmith again.

Filed under: Music and Media — jamesone111 @ 2:40 pm

Amazing how a Picture goes around , I found it on Eileen’s blog she found it on Jon’s blog

Doing tech-desk duty at the BETT show last week I had the pleasure of directing questions on Songsmith to Eileen (I’ve got it but haven’t sorted out an activation key so I’m holding off installing it) and I noticed following the Aston link to Jon, I noticed he’s got a post on it too.  “Classic hits by Microsoft Songsmith” is a great search term to put into You tube. Jon linked to Roxanne which has me helpless with laughter. This remix of Wonderwall is impressive. Enjoy them while you can… (A quick search for Isolate voice track got me to the starting point for doing these – there goes more time). 

Technorati Tags:

This post originally appeared on my technet blog.

January 8, 2009

Songsmith – there goes a chunk more time !

Filed under: Music and Media — jamesone111 @ 11:34 pm

Embarrassing personal revelation time. I sing in the car, in silly voices. Anyone who hasn’t heard me doing “Winston Churchill sings Dido’s ‘White Flag’” has had a lucky escape. I mention this because the folks in Microsoft research seem to have been putting something together for people with as little singing ability as me.


Watching the FriendFeed that went on during SteveB’s CES keynote in the small hours of this morning there was a plaintive howl from Long Zheng “He didn’t talk about Songsmith, but it made the press release”. What the heck is Songsmith ? Which press release because I couldn’t find it. Well it’s up there now. I hate it when something comes along and says “You know you haven’t go time for this … and yet you’re not going to be able to resist”.  My sister is a part-time evanglist for Korg’s Kaoscilator  – I’ve got one thanks to her – and I’m already wondering about the possibilities of combining it with songsmith. Normally parents get wound up by kids making music – in my household it could be the other way round.


There’s a nice video at the MSR SongSmith page but I don’t seem to be able to embed it here. Go look, but only if you don’t have a pressing deadline !


Technorati Tags:

This post originally appeared on my technet blog.

October 21, 2008

PowerShell and Windows Media Player, part 1

Filed under: Music and Media,Powershell,Windows Vista — jamesone111 @ 3:13 pm

Stange bedfellows you might think but why shouldn’t media be scripted ?

I was thinking this a couple of weeks ago. I wanted to run a video before I started a presentation. If the Presentation is due to start at 10:00, and the video is 3 minutes I want to the video to start automatically at 9:57, and step onto the stage at 10:00 exactly as it finishes. I cobbled something together to do that but I didn’t like it. Actually I want to play music before the video. I want a play list of tracks to start at the right time, I want the last one to fade out and go into the video. If people are in their seats before the video starts I want something counting down on screen. Etc.

Now Windows Media Player has an object model and I’ve used it before so how hard could it be ? It turned out to be a little harder than I thought because the object I used in a bit of VB.net aeons ago doesn’t seem to like running in PowerShell. I found Saveen was using a different object so I typed in

$wmp = New-object  –COM WMPlayer.OCX

and I was away… but compared with other things I have worked with recently the Object model is – backward is the nicest word I can use. I can get a play list and I’d expect to be able to do “For each item in list.tracks”. But no: you have to go call list.item(track Number) for each track. To get a playlist you have to request it by name from the “playlist collection” object.  You have to specify the exact name – no wild cards. Yet it comes back as a collection, which again doesn’t work with forEach. Grrr. So I wrote a function to get a playlist.

Function get-Playlist   
{param ($Name)
if ($Name -eq $null) {$wmp.currentPlayList}
else {$list=$wmp.playlistCollection.getByName($Name) 0..($list.count - 1)|foreach {$list.item($_) } }
}

If the name isn’t specified the function returns the currently playing list, otherwise it gets the named list, and it outputs each list found. All 1 of them.

Next came Set-Playlist – I wanted to be able to do Set-PlayList $listObject or set-playlist “random” or get-Playlist “random” | set-playlist so this became a filter

filter Set-Playlist

{param ($Playlist)
if ($playlist -eq $null) {$playList=$_}
if ($playlist -is [string]) {$playlist=get-playlist $playList}
if ($Playlist -is [system.__ComObject]) {$WMP.currentPlaylist = $playlist}
}

Of Course I wanted to see the tracks in a play list so that became the next function – again set up to take Piped input, or a name or an object

filter get-MediaInPlaylist  
{param ($Playlist)
if ($playlist -eq $null) {$playList=$_}
if ($playlist -is [string]) {$playlist=Get-Playlist $playList}
if ($playlist -eq $null) {$playList=$wmp.currentPlayList}
0..($Playlist.count - 1) | foreach {$playlist.item($_) }
$playlist=$null
}

Getting media which is not in an existing play list involves a query to the mediaCollection object there is get media by name, get media by artist and get media by album. It turns out that any attempt to get media returns a playlist, I could have left it that way and te results could be piped into set-playlist but I wanted to see the tracks, so that was how I built the next function.

function get-media 

{param ($Name, [Switch]$album, [Switch]$artist)
if ($artist)    {$wmp.mediaCollection.getByAuthor($Name)| get-MediaInPlaylist }
elseif ($album) {$wmp.mediaCollection.getByAlbum($Name) | get-MediaInPlaylist }
else {$wmp.mediaCollection.GetByName($name) | get-MediaInPlaylist } 
}

There’s also a get media by attribute so you can say “Find me all files where the format is MP3.”

function get-mediaByAttribute 
{param ($attribute, $value)
$wmp.mediaCollection.getByAttribute($Attribute,$value)  | get-MediaInPlaylist }

Next I wanted to be able to add the items I’d just found to the current playlist – so in came Append media, and to make sure I could start with an empty list so did Reset-Media.

filter Append-Media

{param ($item , $Playlist)
if ($Item -eq $null) {$Item=$_}
if ($playlist -is [string]) {$playlist=get-playlist $playList}
if ($playlist -eq $null) {$playList=$wmp.currentPlayList}
$playList.appendItem($item)
$item=$null }
Function reset-media {$wmp.currentPlaylist=$wmp.newPlaylist("Playlist","") }

Finally (for now ) came starting and stopping the playlist.

Function Start-media   {$wmp.controls.play() }
Function Stop-media  {$wmp.controls.stop() } 

Function Pause-media {$wmp.controls.pause() }

 

In the next post I’ll look at waiting for the media to do things, fading music up and down, why this is no good for video and what to do about it.

This post originally appeared on my technet blog.

May 30, 2008

A little bit of Microsoft Honesty.

Filed under: Music and Media,Windows Vista — jamesone111 @ 10:39 pm

image  I like Vista. And I like the fact that with Ultimate I can have a 64-bit, domain joined , Tablet enabled, Media Center PC. (IN XP these were 4 products). I like media-center.  But one aspect of media centre drives me nuts, and that’s its determination to keep a ton of free space and to over estimate the space it takes for any given recording. I wanted to record 2 hours of a movie tonight which would have taken about 2.5GB of space.I have 8.2GB free and Media center wouldn’t record. By the time I’d shifted some recordings off the PC the start of the show had come and gone

This evening I had two problems. I  suspect because Media Center brought the machine out of sleep to record something yesterday when it was in the car and the TV stick was disconnected, the Windows Media Center Receiver Service got stuck. The symptoms of this are that the Media Center program believes there is no tuner attached. I had to kill several things before finding it was the service and along the way I  killed the "E-home tray applet" which media center uses to tell me when what it’s up to.

So when I tried to start a recording manually, the message box on the left appeared. I have to admire whichever of my Redmond colleagues put this message in. What I’m curious about is everywhere else "Center" is written with an ER as in US English. Here it’s written with an RE as in British English. I preferred this to "General Failure, Error 4096 has occurred" style messages but  somehow I doubt if it’s a trend.

This post originally appeared on my technet blog.

April 26, 2008

Humphrey Lyttelton. 1921-2008.

Filed under: General musings,Music and Media — jamesone111 @ 9:12 am

Humphrey LytteltonOn the Roadshow we have been in Cinemas so it seemed appropriate to have a round of IT professional’s film club, an idea which we lifted from Radio 4’s "I’m sorry I haven’t a clue".

I’ve never really taken to any other Radio station: I can remember asking my grandmother why "Just a minute" had that "very fast piano music" (The Minute Waltz) as a signature tune. On "I’m sorry I haven’t a clue" Humph’s fantastically contrived double-entendres and good natured insults are exactly my sense of humour. As one of the many tributes from the public posted this  morning on the BBC web site says, "Not having to pull over due to crying with laughter will mean the roads will be safer now, unfortunately."

So it was a bombshell to hear, on Radio 4 as I woke up this morning, that Humphrey Lyttelton has died It seems too small a thing to say "I’ll miss him". But I will, terribly.

This post originally appeared on my technet blog.

April 7, 2008

SD cards (again)

Filed under: Music and Media,Photography,Windows Vista — jamesone111 @ 4:37 pm

I was about to say some things about Vista and TV when I realized I had actually said them a few months ago

When your TV programmes are FILES there’s a different psychological relationship to them compared with TAPE. VHS cassettes were something you recorded over and over. You taped a programme watched it, taped over it. ..it’s easy to buy the DVD of the show … But with files we’re conditioned to Save them, why call them files if you don’t, well, file them ?

Memory cards for photos have got so cheap, I’m seriously considering using memory cards only once (with back-up copies).

Memory cards and photos first, A few weeks ago, I had a sad experience with my (almost) new diving camera…  Normally there is a 1GB Mini-SD card in an adapter for plugged into my laptop for Vista to use as a ReadyBoost device. When I heard that one of the changes in SP1 is that Vista uses Readyboost to speed up the time to come back from sleep I thought I’d stick an old card in the SD slot semi-permanently: ,it stays in when I put the laptop in its bag – although because it sticks out there’s risk of damaging the adapter.
At the end of my last dive trip I swapped the ReadBoost card with the one in my camera so as not to lose it while I downloaded my photos. When I came to swap the cards back the Mini SD card came out of the camera leaving the adapter stuck fast. To cut a long story short the SD slot was damaged, not covered by warranty and the quote to fix it was greater than the cost of a new camera – which arrived this morning.

With 7 day shop charging round the £6 mark for 2GB Micro-SD cards by Kingston and SanDisk (compatible with my phone and with a much safer adapter) I really should get rid of the old Mini cards, but that’s hard to do, Psychologically, we’re conditioned not to throw these things away. So, I tried to get a bit more life out of a device with a replacement cost less than a prawn sandwich  and it cost me a camera. As if to add insult to injury, the card itself died this weekend. I had two of them so the other is nowin the laptop – but at the first sign of trouble it’s going in the bin. As if to prove the that these events always come in the threes, the SD socket on my Portable Hard-disk/Card reader has decided to play dead as well. Grrrr. But on the bright side when I got it my biggest memory card was 512MB. Now I can shove 10GB of SD in my pocket. And it is still useful as storage photo photos and MediaCenter recordings. 

When I rebuilt my machine for Vista SP1 I managed to reset some of the settings in MediaCenter. Mostly, I like the Media parts of Vista, but every now and then they drive me nuts and it’s usually around storage. Firstly MediaCenter seems to insist on keeping 5% of my disk space free. Keeping the last 1GB from 20GB might make sense, but keeping the last 50GB from 1TB probably doesn’t. I’ve not found any setting to manage this. The problem is compounded because it over estimates the space needed by a recording, and sometimes, wrongly, says there won’t be space for a programme (e.g. 3 hours of Grand Prix coverage would have needed about 4-5GB of space, with 12GB free Media center said "No") . Worse, it keeps free space by deleting recordings unless you tell it not to:  infuriatingly last week it was told to record two programs back to back, and deleted the first one seconds after it was made. This sent me off to BBC iPlayer, which has become Vista Compatible since last time I wrote about it. I was surprised how small the file size was for good  quality with the iPlayer, which I daresay I’ll talk more about another time.
Since I’m pushed for space it makes sense to move the files off the machine but here comes the next irritation… Different channels run different levels of compression:  I recorded the same Episodes of Ashes to Ashes, on when first shown on BBC-one (2.30 GB) and repeated on BBC Four (1.70GB). A US drama on Channel 4 is 1.42 GB, but re-broadcast on on E4 it was 1.05 GB. So… I the number of 1 hour Episodes I can burn onto a data DVD varies dramatically: if I use Stephen Toub’s DVR-MS Editor to trim the channel 4 shows down, they’re only 40 minutes of actual programme so I can fit in 6 episodes on a disk; an hour of BBC is an Hour of programme and only 1 fits.  I can get 150 Minutes with a video DVD – and unlike Media Center’s files, a DVD will play on my Xbox. But making a DVD is a long process, not just because the transcoding takes time but also  because psychology cuts in again: unlike files-on-a-DVD-disk, a "proper" DVD feels wrong if it has all the extraneous crud of a recording, so it needs to be edited and before you know it you’re going to the trouble of making bootleg DVDs. The time it takes to make one is worth more than the cost of the commercial DVD – and I like to own the artifact anyway.   (And working for a company based around intellectual property, I really shouldn’t be making bootlegs).

With 8GB SD cards now available below £20 may the smart thing would be get some and treat them like VHS tapes; that would be more battery efficient when travelling too. Streamlining the media I use for everything sounds attractive. 

This post originally appeared on my technet blog.

June 29, 2007

Open source lobby: "We’ll get the EU to stop your telly"

Filed under: Music and Media — jamesone111 @ 2:56 pm

For some reason media seems to be on my mind at the moment….

The BBC i-player is to go live at the end of July. This follows Channel 4”s “4OD” service (I’m a bit peeved the that it’s not available on Vista today, but C4 tell me it’s in the Pipeline) . Five has five download, Sky have “Sky Anytime” and  which is also XP only (not Vista) . They use the same off-the-shelf DRM package which is already present on most of the world’s PCs: Windows media player.

Performers, writers and others involved in a production are paid based on how many people have access to something. Releases on DVD carry a fee. Repeats carry a fee. I don’t know, but I suspect there is a difference between “catch again” repeats – i.e. the ones on BBC Three the next day – and “real” repeat-as-nearly-new-content – the ones which run 2 years later on UK Gold.

In the UK section 70 of the Copyrights designs and Patents Act says “The making for private and domestic use of a recording of a broadcast or cable programme solely for the purpose of enabling it to be viewed or listened to at a more convenient time does not infringe any copyright in the broadcast or cable programme or in any work included in it” – when I wrote about giving media center’s recordings “a permanence they weren’t supposed to have” that was in the back of my mind.

It’s  easy to see that a “catch-up” download service belongs in the same category as the “time-shift” Video recording, and “catch again repeats”, but giving people copies to keep belongs to the same category as selling the programme on DVD. So how does one ensure that a service is catch-up, and not keep-a-copy. That’s where DRM comes in. It’s a technology which gets a bad press, because it means restricting what people can do. Classically when you bought a record or a CD there was no mechanism to stop you making copies: DRM defines what you can do, and everything else is forbidden; which isn’t nice. Of course there is a trade off, because if the restrictions are tolerable and it means I get something that would otherwise languish a vault somewhere that’s fine with me. 

A DRM application decrypts the content and does what it is allowed to do and no more. This means you can’t have open source DRM: the first thing that would happen is that someone would produce a version that dumped out the unencrypted information. This isn’t to say a “secret source” DRM app can’t run on an Open Source OS. Microsoft could produce media player for Linux. But there are a number of reasons why this is unlikely. (a) Why would we help the adoption of a competing platform ? (b) Some Linux users are pragmatists – people who like to dig into the code of the OS. But others are ideologues who would not have Microsoft software on their machine even it were free. There is also a subset who would not accept DRM from any vendor because to their way of thinking does not allow for intellectual property rights.

It shouldn’t come as a surprise that the “Open Source Consortium”  have weighed in. In the BBC’s report of their threat to go to the EU, their president is quoted as saying  “In an ideal world all DRM would be removed”. In his world perhaps; to the broadcasters who wouldn’t distribute content that could be watched forever that’s not ideal at all. The OSC’s web site shows they have been trying to stop the BBC i-Player by talking to the UK regulator Ofcom. Ofcom appear to have given them the response they deserved. With Channels 4,5 and Sky are already using this technology and don’t support anything but Windows; the fact that BBC downloadable content isn’t available on Linux is not going to sway people who want Linux to buy Windows. They also try to muddy the waters using the EUs ruling which forced the creation of “N” versions of XP and Vista without Media player. To the broadcasters it is fantastic  for the same player to be on 90% of computers with broadband. The EU competition commission is charged with promoting competition (they don’t act on behalf of consumers) to them 20 competing players with less than 10% is far better than one with 90%.  That doesn’t give a platform which gets services delivered.

This post originally appeared on my technet blog.

June 17, 2007

PowerShell , VB , Media Center and SQL

Filed under: Music and Media,Powershell,Windows Vista — jamesone111 @ 12:19 pm

I hesitate to describe myself as a dilettante (1) programmer. Not because it isn’t true but because we have a running joke in the office about vocabulary deficiency. Eileen said to someone “What’s it like to be surrounded by People more Erudite (2)  than you “?  I quipped “Don’t say that, he thinks it’s a kind of glue”. A couple of people in the education team were having trouble pronouncing the word Pedagogue (3) (ped-a-gog) never mind knowing what it means. “OK I know obscure words” I said “I heard Stephen Fry on the Radio saying people don’t know the meaning of words like Anthropophagi (4) or Thaumaturgy (5)  and I did ! ” I know the former from Flanders and Swann and the latter from Terry Pratchett

Long words aside, I only really dabble with coding. I’ve become a convert to Media Center. When he did, the Vista after hours event, James Senior had a sidebar gadget which showed the Electronic Program Guide. (EPG). I tracked the gadget  down to Ascii Express, but I’ve found it a bit flaky and I wanted to investigate how you get the data out of media center.  

Eventually I found a post on the Media Center Sandbox Forums which gave a VB sample. Another post there gave me a registry key I’d need and a link to the very useful MCE Query. With this I was able to build up some SQL queries. There are tables with names like Lineups, Services, Programs, Credits, Genres (all plural) and others which join them together with names like “serviceLineups”. So if you want to the Services and Lineups you join those 2 tables with serviceLineups.  The tables all call their primary key “identifier”, and when it’s referred to in is called by name like Service or Lineup (all singular). Here’s an example: a query to get a list of stations, when the guide information starts and finishes, and their assigned channel numbers e.g. Radio stations are on Freeview – the British DVB-T service – have station numbers in the 800 range.

select serviceLineups.service  ,  lineups.displayedNumber  , Services.serviceName, services.callsign, services.startTime, Services.endtime  
from servicelineups , services, lineups
where (
       (serviceLineups.service = services.identifier) and (serviceLineups.Lineup=Lineups.identifier)
        and  (servicelineups.isAvailable = 1) and  (servicelineups.ProgramInfo = 1)
       )
Order by lineups.displayedNumber

This one gives a list of programs – be warned with 14 days of guide and 60+ stations this is about 20,000 rows, so you may want to add a condition –  e.g. a specific value of Station.identifier taken from the ServiceLineups.Service value in the previous one

select programs.identifier , programs.title as programTitle, programs.description as programDescription, 
programs.episodeTitle, programs.year , programs.originalairdate ,
ScheduleEntries.StartTime, ScheduleEntries.Endtime, services.serviceName 
from scheduleentries , services , programs
where (
(services.identifier = scheduleentries.service) and  (programs.identifier = scheduleentries.program)
)

Once you’ve got the Programs.identifier you can query things like keywords

select keyword, keywordType, keywordIndex from keywords where program=2639 

Your might want to use a where Program = condition on these 4 which get attributes, credits, genres and ratings.

select programattributes.program, attributes.value as attributeValue 
from programattributes , attributes 
where (programattributes.attribute = attributes.identifier)

 

select programCredits.program, Credits.name as CreditName , Credits.type as CreditType
from   programCredits , Credits
where (programCredits.Credit = Credits.identifier)

 

select programgenres.program, genres.name as GenreName
from programgenres , genres
where (programgenres.genre = genres.identifier)

 

select programratings.program, ratings.name as RatingsName
from programratings , Ratings
where (programratings.rating = ratings.identifier)

This gave me what I needed to query the information in power shell. First get the registry Key which tells me where the EPG is

$key = get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Service\epg'

Then load the DLL which lets me address it, and get a SQL Lite Database connection, set it up

[Reflection.Assembly]::LoadFile("C:\windows\ehome\ehepg.dll")
$conn = New-Object microsoft.ehome.epg.database.sqlLiteConnection
$conn.init($key.currentEPG , $true)
$conn.open()

Normally I’d just pass the SQLstring put to make it easier to read I’m building it up here, then I can create a command object with that query to run against the database

$sql = 'SELECT  lineups.displayedNumber  , Services.serviceName '
$sql = $SQL + ' FROM ServiceLineups , Services, Lineups '
$sql = $SQL + ' WHERE  ( '
$sql = $SQL + ' (serviceLineups.service = services.identifier) '
$sql = $SQL + ' and (serviceLineups.Lineup=Lineups.identifier) '
$sql = $SQL + ' and (servicelineups.isAvailable = 1) and  (servicelineups.ProgramInfo = 1) '
$sql = $SQL + ' )   Order by lineups.displayedNumber '
$sqlcomm=$conn.CreateCommand()
$sqlcomm.CommandText=  $SQL

Now I set up a dataset object and use the Data Adapter object to fill it.

$Ds= new-object system.data.dataset
$sqladap = New-Object microsoft.ehome.epg.database.sqllitedataadapter
$sqladap.SelectCommand = $sqlcomm
$sqladap.fill($ds)

And powershell understands what it can do with a table …

$ds.Tables[0] | Format-Table 

Cool stuff. I did pipe the second query above (the big one) into convertTo-Hml as well. Internet explorer sweats a bit loading it, but it comes into Excel nicely. I’ve got to figure out how to put the data to use now I can get it.

Next up … SQL to query vista’s index

FOOTNOTES

(1) Dilettante: “Somebody who is interested in an art or a specialized field of knowledge, but who has only a superficial understanding of it”

(2) Erudite:  “Having or showing great knowledge gained from study and reading”

(3) Pedagogue “an educator or schoolteacher – esp. One who teaches in a particularly pedantic or dogmatic manner”

(4) Anthropophagi A cannibal

(5) Thaumaturgy  “The performance of Miracles or Magic”

This post originally appeared on my technet blog.

April 27, 2007

TV Indirect to your phone…

Filed under: Mobility,Music and Media,Windows Vista — jamesone111 @ 12:53 am





Well, well here’s serendipity again. While Eileen was posting about “TV-Direct to your phone” I was noticing something in the options for Windows Media Player 11 on Vista, when I had my phone plugged in. There was a setting “Convert Music, Videos and TV shows as required by this device.” Could this mean … I had to wait for the postman to bring my new 1GB memory card, and with it installed , this evening was time to try it.

I’ve not recorded that much using Media Center on my laptop, but I did record Dr Who on Saturday (and it looks fantastic at 1200×720 resolution on my TV.) What happens if I drag it into the sync column on my phone ? It converts and syncs. Normally I’d view it full screen, but just to show you it works… look left


I wouldn’t watch all my TV on something that small, but to while away time at the airport, or catch up on TV on the bus/train to work.. sure. And 52 minutes of TV took 60.3MB of space, which means I’ve got room for quite a lot in 1GB. Now to figure out how to automate the sync process.


This post originally appeared on my technet blog.

January 8, 2007

A good day to be a fake doctor …

Filed under: Music and Media,Windows 2003 Server,Windows Server 2008,Xbox — jamesone111 @ 9:28 am

I mentioned we had something big planned for the CES show in Vegas, and that something is Windows Home Server. There was a nice teaser site, The Center for Digital Amnesia Awareness which now has the information on it.

On 10 has a video which explains it; their summary

As a small, headless box that lives on your network and in your closet, a Windows Home Server can quickly grow the pool of storage from which all of your shared files for each of your users lives. The backup engine in Windows Home Server also silently backs up the entirety of each machine connected to it every night. And because the data is always online, using the built-in remote access abilities, you’ll also be able to access your data from any machine on the planet.

Charlie Kindel works on it – and he has a photo which shows the kind of ideas people have for machines that will run WHS, the Windows Server Solutions Group (which is also responsible for SBS – which Eileen mentioned recently)

One thing that seems have caused confusion is the “Personalized Internet address from Windows Live™ with no monthly service fees* ” something I read says owners of home server will be able to get a name within a domain owned/managed by windows live. I’m guessing there will be a mechanism either for home server or the DNS Server to discover the machines true Internet address and register dynamically.

I’ll post more as I have it

Update: There’s a good five minute summary Video now on the MicrosoftAtCES site

 

This post originally appeared on my technet blog.

January 6, 2007

Microsoft at CES

Filed under: Events,General musings,Music and Media,Webcasts,Windows Vista,Windows XP — jamesone111 @ 5:44 pm

The Consumer electronics show starts in Las Vegas on Monday. The internal rumor mill has been going crazy and we’ve been told not to blog about …. well I can’t tell you what obviously.

Bill Gates is delivering a keynote speech on Sunday night – 6:30PM Redmond time, by which point most people working in Europe will have gone to bed. On Monday you’ll be able to view it via  http://microsoftatces.com/ 

They’ve already got some videos on the site. One is for the “Wireless Desktop 8000” . Lousy name, very cool product. When we look at Apple we see fantastic industrial design, which I don’t see in my original X box, or the older Microsoft mice (look out for the very first MS mouse in the video – about 4:40-4:50). These days I have a Philippe Starke mouse at home, and design of the Xbox 360 is pretty good. This is the first time I’ve seen a keyboard that would inspire envyI saw these before Christmas: they’re not cheap but I have a plan to get my hands on one. As and when I do I’ll blog about it.

 

Technorati tags: , ,

This post originally appeared on my technet blog.

August 26, 2006

Zune news. No FM transmitter (yet) it seems.

Filed under: Music and Media — jamesone111 @ 11:43 am

I’m going to stick my neck out and be (I think) the first Microsoft blogger to tell you where to get details of the Zune.

It’s widely known that Zune will have wireless functions and that means for the US market it needs FCC approval. Some people who watch the FCC web site have found this link.  It seems Zune will be made by Toshiba. The best photos are found at the end of the Test report – which says there are 3 models designated 1089 1090 and 1091which are simply different colours. There may be further models with additional functions …

The test report says nothing about FM transmission – which was one of the things I said might tempt me to buy one. The user guide was looks very rough band still seems to be using the code names “Argo” and “Pyxis” which seems to be someone else’s trade mark.  Interestingly someone had leaked the code name to engadget… What it says about wireless and other users is:

Using the Wireless communication.
Turning on wireless:
In order to use wireless sharing feature such as “send’ and “DJ” you will need to turn on your device’s wireless capabilities… …your device will be discoverable by other Pyxis device and also be capable of searching for other Pyxis devices in range.

Sending Content:
Once your wireless setting is set to on, you will be able to send and receive photos and promotional copies of songs, albums, and playlists from other Pyxis users…  …You will  be presented with a“nearby” list containing any Pyxis devices that have their wireless setting on and are in range. Select one (and only one) device from the list and a notification will appear on that device allowing that user to accept or reject your send.

DJing Content:

Pyxis allows you to stream music to up to 4 other Pyxis devices. … If you chose DJ:on, anyone (max 4 at one time) can listen in to the same music that you are currently listening to. If you chose DJ: friends, only people in your friends list can listen in. If you choose DJ:off, no one can listen to your music but you can still tune in to other people who have their DJ setting turned on.

Friend requests:
You can invite other Argo members that you meet to be your friends wirelessly via Pyxis.

Sounds to me like the wireless is an adhoc peer-peer arrangement. Nothing in here suggests that the device will be able to connect to home network to play through an XBox 360, or get recorded TV from media center, or download from a PC without USB … never mind connect directly to the internet. Whether than is a matter of documentation or whether the features are missing is anybody’s guess.

Tagged as Microsoft Zune

This post originally appeared on my technet blog.

August 20, 2006

Would Apple sue Scoble’s new company ?* . Don’t Google for Podcasts. And other stuff from my weekend reading.

Filed under: Apple,Beta Products,General musings,Music and Media,RSS — jamesone111 @ 3:16 pm

Before I was working for Microsoft,  I read Douglas Coupland’s book “Microserfs”. I visited Redmond in1997 and was amazed how close it was to the book. Half a dozen pages in Coupland writes “WinQuote … gives continuouse updates on Microsoft’s NASDAQ price … Most staffers peek at Winquote a few times a day … Last April Fools day someone fluctuated the price up and down by fifty dollars and half the staff had coronaries”


The value of stock roughly halved after I joined Microsoft in 2000 (not that I’m bitter about that), and we’re not quite so obsessive about it. But I  looked at last week’s stock buy back offer and felt “It must be worth more than that”.  According to The Financial Times I wasn’t alone. Disclaimer. This is not investment advice: consult someone qualified. The value of Microsoft shares can go up as well as down. Etc.


While I’m on the subject of Coupland. Some family friends recently opened a bookshop, and I picked up his latest “JPOD” last time I was in there (though I haven’t started it yet). JPOD is billed as “Microserfs for the Google Generation”, by the way, I love the home page for the JPOD book-site – and not just because the music listing includes an obscure cover of a Gary Numan song which I happen to have. I can’t remember the last home page I loved.


Back at the Financial times I read that Coupland or his publisher could be on the wrong end of writs from Apple and Google, who both appear to have been studying at the Gina Ford school of public relations.  Google want people to stop using their name as a verb. I can only think of a few tradenames which have become generic (like Kleenex) and also become a verb (you don’t Kleenex your nose though you might Hoover your carpet, or Xerox your documents).  Google don’t want me to talk about “googling” something on Windows Live Search, but while defending a trademark is all fine and good, “you can’t put the toothpaste back in the genie bottle” as one blogger put itThe Independent reports Dictionaries already include the verb “to google” and I was first aware of people using it in print when I read William Gibson’s 2003 novel “Patern Recognition” where it appears on the second page. In case you didn’t know, Gibson is famous as the man who coined the term “Cyberspace”.


Any Cricket fan will know of the term “Googly” maybe it will come to describe a kind of behaviour, and we’ll have to refine the verb “to Google” as “to search for people using terms to which you claim rights” , if Apple turn googly, they may complain about Coupland’s tittle as they claim to own the word “Pod”. I don’t know what we’re supposed to call the things peas come out of (no… not “freezers”) or groups of whales. I always thought that it was the ‘i’ part of iMac, iPod, iTunes, iPhoto, iWeb, iLife which was the Apple specific part. Apple have gone after the makers of a datalogger called “profit pod”. If Yell can accuse Yellow wikis of passing off for using the colour yellow, how long before a name like Podtech attracts a “cease and desist” letter from Apple.


Robert Scoble is Podtech’s famous employee. He picked up a link from someone with no hands on experience of Zune, who asserts that it won’t have support for Podcasting: presumably non-Apple devices won’t be allowed to call it that . Robert, knows more about RSS than that, he linked to one of my posts about it.  Podcasting support is not in the iPod device, but the iTunes software. Sadly, I’ve no inside information about the Zune and I find the Zune blog by a Microsoft employee to be pretty feeble: so I’m forced to rely the same leak as everone else. That says nothing about the PC software and says that Wifi was disabled on the test device. Who knows what it will be able to fetch over wireless ?


That Zune story contains a reason why (if true) I might want one: built in FM transmitter. I was reading The 10 most annoying car innovations. My Citroen C5 has 5 of these 10 (and the automatic wipers and lights work well. It has lane departure warning – because it would have prevented an accident I was involved in last year). However Citroen have removed the Cassette player – it has a 6 CD multi-changer and a further CD player in the dash. I have to use an FM adapter to play WMAs and MP3 – which I do from my phone but it is such a fiddle to set up I rately bother. An FM transmitter would mean I could play music in the car and on any of the radios dotted round the house. This would be an inspired move, but who knows. Producing the player of choice for in-car use wouldn’t hurt the stock price.


Tagged as Microsoft Zune Apple  iPod Legal Google Gina Ford Yellow wikis


* Note I have no idea if they intend to or not: I’ve subtley changed the title from the original post so it doesn’t imply that they will.

This post originally appeared on my technet blog.

Next Page »

Create a free website or blog at WordPress.com.