January 2018

S M T W T F S
  123456
78910111213
14151617181920
21222324252627
28293031   

Style Credit

Expand Cut Tags

No cut tags
Wednesday, July 14th, 2010 06:01 pm
For her Master's research, [livejournal.com profile] wormwood_pearl has to analyse some video. Not that much video, in the scheme of things - a couple of hours in total - but she has to decide and note down what's happening in every one-second chunk of said video.

Ladies and gentlemen, I give you the non-stop, fast-moving, white-heat world of SCIENCE!

[The lab has licenses for some expensive-looking software that's meant to do this automagically and without human intervention, but needless to say it doesn't actually work.¹]

So she asked me if it was possible to script VLC to play a video for a second, then pause for a couple of seconds (so she could update her spreadsheet), play for another second, and so on until the video finished. That way she'd (a) get accurate seconds, and (b) save lots of time that would have been spent clicking back and forth. I said "Er, yeah, probably".

It turns out that recent versions of VLC do, in fact, have a nice-looking scripting infrastructure based on Lua, but I don't have, and can't install, VLC on my work machine. So (at [livejournal.com profile] addict_yin's suggestion) I tried it with mplayer instead, and after a bit of fiddling got it to work. The program's very simple, but it's possible that someone else has this need, so I thought I'd make it public.

If you too need to play a video in pause-interspersed chunks (of any length you like!), you can download Sleepy here. Installation and use is very simple, and described (at least for *nix systems - let me know if you want to use it on Windows) in the README. It requires perl and mplayer, both of which are free and run on damn near anything. If you think you can improve it, please fork the GitHub repository (because all the cool kids are using GitHub these days, right?), and then send me a pull request. All comments and criticisms are welcome.

Yes, this is all massive overkill for what's actually a very simple script :-)

¹ It could be worse. Apparently an important early experiment on foam formation required a grad student to make up a soap foam between two glass plates, put the assemblage on a photocopier, and then press "Copy" every few seconds for up to ten hours straight. As my friend Micah put it when telling this story, if a nodding bird could do your research better than you could, you've probably taken a wrong turn somewhere.
Wednesday, July 14th, 2010 10:09 pm (UTC)
Was there a particular reason that grad student couldn't actually put a nodding bird there instead of pressing the key himself? Or did he do it?
Thursday, July 15th, 2010 08:53 am (UTC)
I don't know - I'll try and track down the paper and find out.

Personally, I'd have given the nodding bird tactic a serious shot before giving up. Well, I'd have probably tried to rig up something electronic for preference, because I'd be surprised if a nodding bird could maintain equal-length intervals over that timescale.
Thursday, July 15th, 2010 03:53 pm (UTC)
Plus, something electronic would probably be big enough to stick a Post-it on to label it as yours ;-)
Saturday, July 17th, 2010 04:08 pm (UTC)
You could put a lab coat on the bird...
(Anonymous)
Thursday, July 15th, 2010 08:14 am (UTC)
I always feel sorry for Hans Geiger and Ernest Marsden, who spent an inordinate amount of time in a dark room staring into a microscope counting little flashes of light on a zinc sulphide screen, only for Rutherford to get most of the credit. Geiger and Marsden were students (Marsden was actually an undergrad) and Rutherford was their supervisor. Admittedly, Rutherford did interpret the results and draw the conclusion that atoms have a nucleus... MPJ
Thursday, July 15th, 2010 08:57 am (UTC)
The version I'd heard was that Rutherford (very unusually for the time) allowed G&M to publish their results under their own names, and that they called the effect "Rutherford scattering" in thanks - similar to the story of Gröbner bases (http://en.wikipedia.org/wiki/Gr%C3%B6bner_basis). It does appear to have been Rutherford (http://en.wikipedia.org/wiki/Rutherford_scattering) who subsequently worked out the implications for atomic structure, though.