The Yale Astronomy Department is putting together a video showcasing some of the work going on in the department. All of the parts recently arrived for the Moletai Astronomical Observatory (MAO) Spectrograph that our group is building. The timing seems perfect, so the videographer in charge setup a couple cameras to capture the initial build of the spectrograph.
The photographer sent all of the stills in advance, and we couldn’t wait to
see what the final time lapse would like, so I made a few time lapse videos
###Setting up ffmpeg
To put this together, I needed to install ffmpeg. This turned out to be a \ little challenging. I tried the normal homebrew install:
This worked! I then added a symbolic link to add it to my path:
Unfortunately, when I tried to get help on ffmpeg, here’s what it returned:
I then did a search for this .dylib. homebrew installed it:
I just needed to add it to my path:
I repeated this for a few more packages homebrew installed that were not in my path:
ffmpeg -h returned the help, as expected.
The files I wanted to add were stored in a folder named Bench-View_JPG. They
were in sequential order, but they didn’t start at 0. The easiest way to add
them all to the movie was the use the
pattern_type optional argument in
glob. The other options I used were:
- -framerate: the number of frames per second to input -r: the number of frames per second in the output video
- s: the size of the output video
I wanted my video to be 1080p HD, and the final video to be called
BenchMovie1080p11fps.mp4, so I used the following command:
The result can be seen below.
For embedding the video into the web page, I used the HTML5
<video> tag. I
also set the width to “100%”” and the height to “auto” to make sure it was
responsive and scaled properly. Here’s the code that made the above video:
The message, of course, only appears in unsupported browsers. Chrome, Firefox, Internet Explore, Opera, and Safari all support mp4 in the video tag.
The result is something that looks great on any browser and any device! I also created a time lapse video from stills taken with the other camera using the following command:
The results can be seen on MAO page of the Exoplanets Web Site.