• 14Mar
    Categories: Linux, Open Source, Photography Comments Off

    I made this video for my other blog, of my street where I live in Bangkok.

    The video was quite a piece of work. I don’t have the hardware to do proper time lapse photography so I actually just took a 15 minute video and then cut it into frames. See I knew I could speed up a video in various programs on linux, such as kdenlive or kino or avidemux, but I knew that most of them would crash when trying to save a file with a massively high framerate, or they’d drop frames and look shitty. So it had to be broken into frames, processed, and then encoded into a video first at a high framerate, and then transcoded to a video with a normal frame rate so that software didn’t freak out.

    I tried a few techniques but I’ll just describe the one that worked for me. Firstly, because I only had 15 minutes of footage and I wanted at least a 2 minute video, I couldn’t speed it up all that much, so it wasn’t going to be one of those super high-motion traffic shots. Instead it looked quite sedate and the cars were in focus and detailed, even when sped up. I didn’t want this, so I looked for a way to blur the frames together. Ideally I would expect a good encoder to do this, like iMovie etc does on the Mac, but I was in Linux land with no such luxuries.

    Instead I found a guy who had written an unusual script to apply an IIR gaussian blur between consecutive frames, to give a sort of blurred motion effect. This helps make time lapse videos without large amounts of footage look a bit smoother. The script is available on github here, but you will have to alter it a bit to suit your filenames and such. Also, the blur factor is at 15 at first. Higher numbers give less blur, lower numbers more. I used 10 for my video. Also it used JPG files and I felt this was ruining the high definition of my video, so I just changed all references to “jpg” to “png” in the script and it used png files instead (though much slower). It also encoded the videos using ffmpeg and I wasn’t happy with the results of this, so I chose to use my own mencoder command which I give below.

    IIR Smoother (relies on ImageMagick)

    mencoder -ovc copy -mf w=640:h=360:fps=202:type=png ‘mf://out*.png’ -o timelapse.avi

    This 2 minute video was about 6.2 gb in size, and my editor (Kdenlive) was just choking on it, so I then ran another mencoder transcode to reduce it to a workable size.

    mencoder timelapse.avi -o finished.avi -ovc lavc -oac mp3lame -lavcopts vbitrate=4800:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:scplx_mask=0.1:tcplx_mask=0.1:naq -ofps 30

    Next time I would like to try doing higher definition video and trying some other tricks to reduce the encoding and preparation time, because this job took me a LONG time to achieve, but really only due to the experimentation involved in trying to find the best solution.

    I recommend you click the YouTube logo at the corner of this video and then watch it in full screen at high resolution. Afterwards is some photos I took the same night.

    DSC_7030.JPGDSC_7033.JPGDSC_7038.JPGDSC_7040.JPGDSC_7042.JPGDSC_7043.JPGDSC_7044.JPGDSC_7046.JPGDSC_7054.JPGDSC_7056.JPGDSC_7057.JPGDSC_7044.JPG
  • 23Jul
    Categories: Photography, Travel Comments Off

    Yes, you have to read that title like the professor from Futurama.

    I can’t believe I was so busy yesterday that I forgot to mention this news. I have a small job coming up in December. No, not what you think. Not a web job or an IT job. It’s a job as a wedding photographer.

    I had been posting a bunch of photos on this forum, and people were quite enjoying them, and this other guy who does photography posted some of his collection, including some wedding photos and I sighed and said “I would love to do weddings, but since I don’t have a studio and it’s not my primary business, noone ever asks me to do it”.

    Well, this couple liked my photos and the woman emailed me and said “Would you be interested in doing our wedding photography in December ?”

    Well, yes. I would. I would be delighted. I mean, it’s fun to take photos of things for people and have them give you a few bucks for a copy, but all it makes you is an amateur freelance. But to cover a whole wedding ? That’s a real job. I could comfortably call myself a professional photographer after that.

    I really had better find time to setup my photography website. I bought the domain and installed wordpress and a theme and I never got any further with working on it. I have too many damn sites to work on. Suki’s site and my photography site have been been left on the back burner for too long. I just don’t have enough hours in the day. Perhaps if I stopped going out drinking and sat home and worked on code all day I could have all these sites rocking, but that wouldn’t be so much fun, would it ?

    Well, in honour of this momentous news, I guess I’d better post a photo, hadn’t I ? I couldn’t really find much that I haven’t posted before, so I decided to just enhance an existing image a bit. No, it’s not cheating, it’s errr.. bringing out the true beauty of nature ! Now excuse me, I have to go pickup my laundry and get ready to go camping !

    Steaming down the Saigon River