Wulf's Webden

The Webden on WordPress

Video stills

| 0 comments

Being half-term, there weren’t any band rehearsals this evening so I used the time to do a bit more work on the music library website I am working on for the Training Band. I wanted to add a couple of features, one of which was links to videos of the pieces being performed. If the videos exist, isn’t that hard to find them but not everyone has good search-fu and sometimes you just want to pull up a video you can get on practising along to rather than skimming through lots that are unsuitable (for reasons such as poor sound quality or using the wrong arrangement).

What I discovered along the way was that you can extract a number of still images from any YouTube video just by crafting an image URL. For example, here is the URL for a video of me playing double bass at a folk session a couple of years ago (in The Plough, a local pub that is now sadly being demolished and the land sold off): https://www.youtube.com/watch?v=x2A_8IYce3k. The critical bit of information is at the end after “v=” (ie. video id equals). I can take “x2A_8IYce3k” and use it in various ways. For example, here is a version that gives a copy of the selected thumbnail image at a reasonable size: https://img.youtube.com/vi/x2A_8IYce3k/maxresdefault.jpg. It is also possible to get a lower resolution image (http://img.youtube.com/vi/x2A_8IYce3k/0.jpg) or, by changing 0.jpg to 1.jpg, 2.jpg or 3.jpg, to get some stills clipped out of the video (at a size smaller still). It isn’t something most people will want every day but just the ticket for what I needed. Hat tip to snailedlt for the stackoverflow post which gave me the information I needed.

BTW, if you were curious but didn’t get round to clicking the link, here is the video using WordPress’s built in video-embed code:

Leave a Reply

Required fields are marked *.


This site uses Akismet to reduce spam. Learn how your comment data is processed.