{"id":1418,"date":"2014-10-02T08:52:45","date_gmt":"2014-10-02T07:52:45","guid":{"rendered":"http:\/\/johnjohnston.info\/106\/?p=1418"},"modified":"2015-02-02T17:32:25","modified_gmt":"2015-02-02T17:32:25","slug":"chain-of-command","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/106\/chain-of-command\/","title":{"rendered":"Chain of Command"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1419\" src=\"https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/wire01.gif\" alt=\"wire01\" width=\"100%\" \/><br \/>\n(the above gif has nothing to do with the rest of the post, other than it is to do with the wire.)<br \/>\nA while back I <a href=\"http:\/\/johnjohnston.info\/106\/storyboard-and-gifboard\/\">posted<\/a> about gifboard and it\u2019s bigger brother <a href=\"http:\/\/markolson.github.com\/storyboard\/\">storyboard<\/a>. I\u2019ve played a bit with storyboard and the wire this week.<\/p>\n<p>Storyboard is a command line application which creates pdfs from movies with subtitles, one page per subtitle.<\/p>\n<p>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 &gt;1400 \u2018pages\u2019.<\/p>\n<p>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: <code>man pdfseparate<\/code> in the terminal and got back the man page, so it was installed.<a class=\"footnote\" href=\"#hbfn\" name=\"fhbfn\">1<\/a><\/p>\n<p>For once I though ahead and moved the pdf into its own folder, I then, in the terminal, cd into the folder and:<\/p>\n<pre><code>pdfseparate The\\ Wire\\ Episode\\ 01\\ -\\ The\\ Target.pdf  wire-ep-1-%d.pdf\r\n<\/code><\/pre>\n<p>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:<\/p>\n<pre><code>mkdir jpgs; sips -s format jpeg *.* --out jpgs\r\n<\/code><\/pre>\n<p>This command first makes a new folder called jpgs and then uses <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Darwin\/Reference\/ManPages\/man1\/sips.1.html\">sips<\/a> (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:<\/p>\n<pre><code>sips --resampleWidth 300 *.jpg\r\n<\/code><\/pre>\n<p>Which resizes them nicely. I also duplicated the folder and made a set of smaller jpgs and some gifs with sips too.<\/p>\n<p>My first thought was to make some animated gifs<a class=\"footnote\" href=\"#gifsiclefn\" name=\"fgifsiclefn\">2<\/a>, 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.<\/p>\n<p>My next idea was to make one of those infinite scrolling web page with the jpg, and this turned out ok: <a href=\"http:\/\/johnj.info\/wire106\/infinitewp1\/\">The Wire Scrolls On, S1E1<\/a>.<\/p>\n<p><a href=\"http:\/\/johnj.info\/wire106\/infinitewp1\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1421\" src=\"https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/infinite-scroll.png\" alt=\"infinite-scroll\" width=\"600\" height=\"393\" srcset=\"https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/infinite-scroll.png 600w, https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/infinite-scroll-300x196.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>After seeing that page I thought a montage would be the next obvious step. Again a quick google suggested the <a href=\"http:\/\/www.imagemagick.org\">ImageMagick<\/a> set of command line tools. Again I\u2019d 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:<\/p>\n<pre><code>montage wire-ep-1-[1-1497].jpg out.jpg\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/out-1000.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1422\" src=\"https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/out-1000.jpg\" alt=\"out-1000\" width=\"100%\" srcset=\"https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/out-1000.jpg 1000w, https:\/\/johnjohnston.info\/106\/wp-content\/uploads\/2014\/10\/out-1000-300x210.jpg 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><br \/>\nI can\u2019t 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.<\/p>\n<p>I am not really much of a command line user although I\u2019ve 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 \u2018command line\u2019 to the search. In addition to the tools above, or even before, <a href=\"https:\/\/www.ffmpeg.org\">ffmpeg<\/a> for example.<\/p>\n<p><strong>Update:<\/strong> <a href=\"http:\/\/johnj.info\/wire106\/infinitewp1\/flip.html\">The Wire EP 1 Mashup<\/a>.<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<p>Footnotes:<\/p>\n<div id=\"hbfn\">\n<p><a class=\"reversefootnote\" href=\"#fhbfn\">1.<\/a> I little digging around reminded me I had installed this as part of poppler. Poppler I\u2019d installed using <a href=\"http:\/\/brew.sh\">homebrew<\/a> (the chain is tangling already). If you want to install various command line apps I\u2019d recommend homebrew as a good option.<\/p>\n<\/div>\n<div id=\"gifsiclefn\">\n<p><a class=\"reversefootnote\" href=\"#fgifsiclefn\">2.<\/a> <a href=\"http:\/\/www.lcdf.org\/gifsicle\/\">gifsicle<\/a> is a wonderful command line application for creating animated gifs.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>(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\u2019s bigger brother storyboard. I\u2019ve played a bit with storyboard and the wire this week. Storyboard is a command line application which creates pdfs from &hellip; <a href=\"https:\/\/johnjohnston.info\/106\/chain-of-command\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Chain of Command&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[73,113,154],"tags":[162,77,164,158,152,163],"class_list":["post-1418","post","type-post","status-publish","format-standard","hentry","category-remix","category-tutorial","category-web","tag-commandline","tag-javascript","tag-storyboard","tag-thewire","tag-video","tag-wire106"],"better_featured_image":null,"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3RLlC-mS","_links":{"self":[{"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/posts\/1418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/comments?post=1418"}],"version-history":[{"count":5,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/posts\/1418\/revisions"}],"predecessor-version":[{"id":1612,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/posts\/1418\/revisions\/1612"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/media?parent=1418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/categories?post=1418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/106\/wp-json\/wp\/v2\/tags?post=1418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}