Colour of the Wire

After the last post I’ve watched a few more episodes and have arrived in Season 3 of the wire. I though it might be interesting to see the overall colours of different episodes or seasons and compare them.

Following the same path1 as in the previous post I created a montage of screenshots from Episode 1 of season 3. I sort of expected it to be a bit brighter but:

out-1000

A bit of googling took me to Image Color Summarizer – RGB and HSV Image Statistics and:

Image Color Summarizer – RGB and HSV Image Statistics Season 1 Episode 1

Image Color Summarizer – RGB and HSV Image Statistics Season 3 Episode 1

Both described as dark faded red.

colours-of-the-wire

I wonder if it would be interesting to expand this to other episodes and series or if everything looks dark.


Footnotes:

1. I had a few problems with Storyboard this time as the .srt file I downloaded didn’t work, a quick google found one that did. I also noticed that the montage code I posted last time was missing a parameter --geometry +0+0 to remove padding

Chain of Command

wire01
(the above gif has nothing to do with the rest of the post, other than it is to do with the wire.)
A while back I posted about gifboard and it’s bigger brother storyboard. I’ve played a bit with storyboard and the wire this week.

Storyboard is a command line application which creates pdfs from movies with subtitles, one page per subtitle.

I just started with a bit of playing round with no particular destination in mind. The first thing I did was rip a pdf of subtitled frames from Episode 1 using storyboard. This gave me a 30mb file with >1400 ‘pages’.

I then thought that it might be an idea to get all of these pages out as images, a quick google suggested pdfseparate. This is another commandline app. I generally have no idea what commandline options are available, so I typed: man pdfseparate in the terminal and got back the man page, so it was installed.1

For once I though ahead and moved the pdf into its own folder, I then, in the terminal, cd into the folder and:

pdfseparate The\ Wire\ Episode\ 01\ -\ The\ Target.pdf  wire-ep-1-%d.pdf

The %d bit just gave me a numbered set of jpegs. I ended up with a folder full of 1497 pdfs. I really wanted images rather than pdfs so:

mkdir jpgs; sips -s format jpeg *.* --out jpgs

This command first makes a new folder called jpgs and then uses sips (built into OSX) to convert each pdf into a jpg and put it in the folder. These jpgs were quite big so I cd into the folder and:

sips --resampleWidth 300 *.jpg

Which resizes them nicely. I also duplicated the folder and made a set of smaller jpgs and some gifs with sips too.

My first thought was to make some animated gifs2, but a gif with 1497 frames turns out to be pretty big, even if you reduce it to 8bit. There are probably a few interesting gifs in this project which I might return to.

My next idea was to make one of those infinite scrolling web page with the jpg, and this turned out ok: The Wire Scrolls On, S1E1.

infinite-scroll

This gives quite an interesting view of the episode, it is pretty dark and there are a lot of closeups and expressive faces (this might be skewed by the fact we grab bits of dialog). I was quite surprised that the page loaded quite well.

After seeing that page I thought a montage would be the next obvious step. Again a quick google suggested the ImageMagick set of command line tools. Again I’d already installed these at some time in the past so it only took another google to suggest that the montage tool was the way to go. So inside the folder of smaller jpgs:

montage wire-ep-1-[1-1497].jpg out.jpg

out-1000
I can’t imagine how long it would take to do something like this with a gui application. I can imagine that quite a few folk would not be all that interested in this process or the results, am thinking that it is somewhat analogous to looking at large sets of data. These image manipulating commandline tools allow different views of video to be created quickly. They also give an overview of a whole section that can be analysed and mused over.

I am not really much of a command line user although I’ve dabbled over the years and installed a fair number of applications along the way. I would recommend that dipping toes in, with say gifsicle before jumping in to install and try a pile of stuff. Google is your friend here and you can often find a command line way to do something by adding ‘command line’ to the search. In addition to the tools above, or even before, ffmpeg for example.

Update: The Wire EP 1 Mashup.


Footnotes:

1. I little digging around reminded me I had installed this as part of poppler. Poppler I’d installed using homebrew (the chain is tangling already). If you want to install various command line apps I’d recommend homebrew as a good option.

2. gifsicle is a wonderful command line application for creating animated gifs.

all in the game

Wire Characters Season 1

My last couple of posts have been about using and setting up videogrep.py.

Videogrep is a python script that searches through dialog in videos and then cuts together a new video based on what it finds. Basically, it’s a command-line “supercut” generator.

I’ve been thinking about how to use it, especially since Jim Groom gave it a rousing reception( Wiring Supercuts & The Game Supercut ).

I’ve always liked the suspect board on the wire, where the detectives pin up pictures of suspects in a mindmap fashion, and wondered if I could make a board with Supercut videos of the characters. Turns out I can: Wire Characters Season 1.

A man must have a code

The Wire Season 1 Episode 07   one Arrest

First thing I had to do was make the supercuts, I just used the method described in the previous post, with one wrinkle. Some of the characters are refered to by more than one name, some times Kima is Greggs, I wanted to catch all of the references. It turns out that the default search for videogrep is a regular expression. Now I don’t know much (anything) about regEx, but a quick google game me the pipe character as OR, so:

python ../videogrep.py -i /Users/john/Movies/The\ Wire/Season\ 1 -s 'Kima|Greggs' -o Kima.mp4

Gets clips with either Kima or Greggs in the subtitles.

I then convert the mp4 files with miro video converter, using iphone as the setting, this lets me hear the clips which lose sound on my system. I open the output movies with QuickTime Pro find a still and hit copy. Switch to Fireworks and paste into a new document, save as a jpge with the same name as the video apart from the file extension.

I’ve now got a folder full of movies and images and just need a html file to display them.

I wanted to do a few things with the display of the videos, I wanted them to be is some sort of disarray as if pinned on, not all lined up. I also was making this in between all of the supercutting. This lead me to put the videos on the page with Javascript rather than hard coding all the tags. If you are really interested you can view the code on the page, I’ll just blog a few concepts here. I did hardcode an array of the names, without the file extensions and a matching one with the character names. It was them easy to loop through these arrays creating video elements and populating them with the video source and the jpg images as posters.

The CSS gives the div wrapping the video a white background and a drop shadow, some javascript rotates the divs (JavaScript Rotate | KaisarCode) and randomised the margins between them and the white border width.

I also used the javascript to scale down the video to fit more across the page and css to set the page width to 1600 pixels (side scroll I am afraid).

when it’s not your turn

I also missed a few things out.

  • The files are big, converting them with miro made them bigger, I guess I could use ffmpeg to do a better job of that, I could also scale them down to the size they are displayed.
  • The videos do not play in Firefox on a mac, firefox does not support the video format in the video tag. I had a very quick try using mediaelement.js to add flash for firefox but it looked like it would be too much work to display properly. I could also convert all the files to ogg for firefox, I might try that in combonation with scaleing them down a bit at a later date.

Update: I’ve run all the videos first throught te commandline ffmpg to downsize them to 360×240 and then ffmpeg2theora to create ogg versions.

Dope on the damn table

So while some of this has been for self education around javascript and css there are a few ds106 style things that spring to mind from the exercise.

The supercuts get the parts of the video where a character is mentions, sometimes this is never when they are on screen. I had to use other parts of the movie to get posters for some characters. The supercuts let you focus on the character from other characters points of view and the POV of the writers and directors. Some characters I love and feel are important are not refered to much by name, the video file sizes gives a view of this, Ellis Carver’s video is tiny (I love how his character in season 1 hints of his growth during the wire as a whole).

Although I’ve now watched most of season 1 (third time round) I’ve struggled to watch with a critical eye, or even an eye to a gif, the programme is too absorbing and emotionally involving. It has reinforced the series as my favourite tv. I am especially noticing the parts when charcters show complexity beyond normal tv. Kima, presented very positivly, leads the charge to kick and beat a youth that hits the rather usless police Pogue (or Mahone). The emotion showed by the character at the end of episode 10 and the beginning of 11 is viceral, rewatching brings back the shock from the first viewing in a suprisingly powerful way.

Watching the supercuts allows you to step back a bit, pulls information about a character together in a suprising way letting you see the character and how their story is told in new light.

Exploring the territory

Yesterday’s Daily Create looked interesting:

Exploration video. Maybe you’re exploring a new land, the depths of quarks, outer space, the mind, the soul, etc.

Given the excessive rain, I started thinking about exploring the mind, vaguely thinking of some sort of psychedelic movie, or even La Belle et la Bête which I’ve grabbed more than one gif from.
I don’t really have the toolkit or skills for skewing some sort of kaleidoscope, tunnel nightmare vision but I remembered I’d used Screenflow to do something like this with titles in my BRIGADS106 movie. and though I could do a little testing.
Screenflow is designed for screen-casting, but it lets you layer video (from its builtin screen-capture and elsewhere), text, and images. It allows you to zoom, arrange, rotate and transition to and from these effect on a layer-by-layer basis.
My first idea was a journey through a dark tunnel/gallery with animated gifs lining the wall. As I started experimenting I realised that this was probably doable, but not by me in an afternoon. I pivoted to do a journey into ds106 as a slightly wizzy screencast using some of screenflow’s effects, even this took most of the afternoon to complete.
In ScreenFlow you can add a ‘video action’ to a clip. After adding this you can set the zoom, rotation etc of the clip before and after the action, Screenflow will tween between the two.
Here is a screenshot showing a clip with a video action (click for full-sized):

Screenshot 2014-02-09 13.42.43

And a gif taken from the exported video.

journey_into_ds106_01

Interestingly you can use gifs in screenflow, I guess they are played via Quicktime, but unfortunately they do not loop. You can get round this by recording the gifs in screenflow. As I’ve been writing this up, I made a very quick experement.

  1. Made a webpage with a few gifs on it.
  2. Recorded the page with screenflow.
  3. In screenflow cropped to a strip.
  4. Imported into screenflow and made a movie rotating the first clip.

To make this work properly I’d need to think a good bit more about angles and timings, but I think there are some possibilities for fun.