A-  A  A+ RSS Feed

Deep Thoughts by Robert Felty

thoughts on wordpress, latex, cooking et alia

Archive for April, 2009

Saturday, April 25th, 2009

Editing video from a Canon FS100 with Kino and ffmpeg

Last Christmas my parents got me a Canon FS100 video camera. I had asked for a video camera to take videos of my son. I honed my video editing skills a bit before he arrived, but am still working on it. The camera uses flash memory, and records videos in .mod files, which are basically just .mpg files. Although the camera is not HD (the HD version was more than twice as expensive), it does have the option of recording in 16:9 widescreen. I have been using Kino to do my editing, with some success. One problem I had was that if I used Kino to import the files from the camera, the aspect ratio got messed up. Kino would treat the file as 4:3 aspect ratio, even though I had the settings to 16:9. Then it would pad the sides with black space. I saw others complaining about this problem as well, but did not find anyone with a solution. Eventually, I decided to try my hand with ffmpeg myself. After some playing around, I determined that I could create a dv file from the .mod file with ffmpeg, open the .dv with Kino, do some editing, export, and then convert again.

First the conversion from .mod to .dv

ffmpeg -i MOV001.MOD -target dv -aspect 16:9 MOV001.dv

Then I open the .dv file in Kino and edit it, and export to raw dv, making sure to uncheck the options for splitting into separate files and for resampling audio

Finally, I convert the dv to flv to put on my blog:

ffmpeg -i infile.dv -b 325k -ar 22050 -ab 24k -s 480x270 -aspect 16:9 outfile.flv

You can see the result on the fedibblety blog

Thursday, April 23rd, 2009

caribbean sweet potato gratin and sweet and sour eggplant chickpea stew

Caribbean sweet potato gratin and sweet and sour eggplant chickpea stew
Caribbean sweet potato gratin and sweet and sour eggplant chickpea stew

Last weekend I tried out a few more new recipes. The sweet potato gratin recipe came from The Voluptuous Vegan, and the eggplant chickpea stew recipes came from The Very Vegetarian.

sweet and sour eggplant chickpea stew
sweet and sour eggplant chickpea stew

The stew was excellent! I will probably make that again unmodified. The eggplant melted in my mouth, and the combination of vinegar, sugar, and some crushed red pepper was the perfect spice combination.

caribbean sweet potato gratin
caribbean sweet potato gratin

The gratin was only so-so, and I am not sure I would make it again. I did make one mistake. It called for cornmeal for the topping, but I only had corn flour and polenta on hand. I chose the polenta, which turned out very crunchy — too crunchy. Nevertheless, there was still something off about the flavor. It might have just been lacking salt. I am not itching to try that one again though.

Thursday, April 23rd, 2009

Fruit swirl bread take two

Fruit swirl bread take two
Fruit swirl bread take two

About a week ago I tried making fruit swirl bread again. This time I rolled out the loaves thinner, allowing me to put in more filling, and have more swirl. The result was definitely better, though I might have also added too much flour this time, since it was a bit dry. I also still had the problem with a large pocket forming near the top. I think for my third try I will score the top of the loaf down the middle before baking.

Tuesday, April 14th, 2009

Two types of pngs

I recently learned that there are basically two different types of png images – indexed and truecolor. Most pngs you find on the internet are probably the truecolor type. The truecolor type uses an rgb format, so each pixel is represented by either 24 bits (8 bit channel depth * 3 channels), or 48 bits (16 bit channel depth). In contrast, indexed images map each pixel onto a 256 (or less) color palette. Wikipedia has a nice graph on this.

Many image tools which produce pngs use the truecolor format. There are advantages to this, as it is a lossless compression format, and it produces nice images. It also includes an option for a separate alpha channel (meaning 32 or 64 bits per pixel), which means you can get some really nice shading. However, the quality of the image comes at a cost – size. Choosing the indexed type of png results in much smaller files, akin to a .gif. Once again, imagemagick can handle this, but by default, actually produces 16bit truecolor pngs. So you have to get the right options. Here is an example of how to convert a pdf into a png in an indexed format.

convert -density 300 -quality 90 -resize 800x600  -type PaletteMatte -depth 8 fig/jfactor.pdf fig/jfactor.png

the 2 crucial options here are -type PaletteMatte and -depth 8. For some applications, it is nice to have a truecolor png. For thumbnails on webpages, you definitely want an indexed image though, since the file size is much smaller. Indexed PNG images will also be smaller than GIF files, because PNG uses a better compression algorithm.

Wednesday, April 1st, 2009

Fruit swirl bread

Fruit swirl bread
Fruit swirl bread

I have been baking bread for 9 years now. Mostly I make sourdough bread, near German style. Sometimes it is nice to make a sweet bread though. When I say sweet bread, I mean a yeasted sweet bread, not one with baking soda. The German bakery down the street from our house makes some very tasty fruit breads, which inspired me to give it a try.

recipe details