Blooming Cacti

Bring life to a barren, technological wasteland

Updating VideoHub: Design Needs

I generate my video files from iMovie and dump them into a folder. I generally generate both a high and a low quality video. I need a way to painlessly:

  1. Detect the video quality of the files
  2. Generate a stub post for the file, with appropriate height / width values, and links to both the high and low quality files.
  3. Generate separate RSS feeds for the high and low quality videos.
  4. Generate the VideoJS embed code for the video, to include in the post.
  5. Geneate a VideoJS embed file, suitable for embedding in an iFrame, so that the videos can be embedded on Those Martins or other sites.

I think I can do all of that with Jekyll but I need to learn it and figure out which pieces do what.

I think that each individual post should have some YML Front Matter to detail the metadata for each video. It may look something like this:

Video Data:

  • Name
  • Height
  • Width
  • High Quality File
  • Low Quality File
  • Preview Image

From that data I need to generate several files:

  • An embed file, including the HTML/JS code necessary to show the video in a browser. It should be suitable both the actual video posts as well as being used from an iframe, to embed the video on a different site.
  • The actual video post file
  • The low quality RSS feed
  • The high quality RSS feed

I can then edit the post, to add a description / narrative for the video. After that, I generate the static site and let rsync take care of pushing it to the server.

The Video Tag and Embed

Through Liquid Extensions, Jekyll has support for including fragments into a larger page. So, the embed files could be generated into _includes/video.html. Then, the post file could include it and the file for the actual embed page could also include it.

{% include video.html %}

Getting the Video Data

I’ve been looking at Jekyll plugins but I’m not sure that they’re right for scanning my video directory, looking for new videos, getting the video’s metadata and then generating the embed fragments. I might be able to make it work but it also seems more natural to just write a standalone program that will do all of that work and then let Jekyll handle the actual site generation.

Generating the RSS Feeds

It doesn’t look like Jekyll has a built-in method for generating RSS feeds. I found an example RSS template, courtesy of recursive. I’m thinking that I should just create two RSS templates: one to pull the low quality data from the posts and one to pull the high quality data from the posts.

Other Things

To make it easy to move the video files around, I need to have a global host / path prefix, for where the videos live. I should be able to define that in a site-wide configuration file, so that all of my URLs generate automatically.