10 July, 2009

Convert Color Video To GrayScale

I've recently found it useful to convert color video into grayscale video. I found the following to be effective in doing so.


$ ffmpeg -y -i /tmp/video.avi -s 640x480 -pix_fmt gray -vcodec rawvideo /var/tmp/video.avi


I haven't however found a means to re-encode the grayscale into an alternative codec (sigh).

06 July, 2009

Narrowing Your Google Search

I was just surfing for ServiceMix documentation and came across instructions at a website that suggested searching their site for specific info by using Google and constraining the search to their site.

Paint my ass and call me Sally.....I didn't know you could do that.

Seems that you can constrain a search to a given site by specifying a site: directive.

For example,

site:fatslowkid.blogspot.com imagemagick


This'll limit your search to the fatslowkid.blogspot.com site, looking for instances of imagemagick.

Cheers.

03 July, 2009

ImageMagick Frame Differences

ImageMagick has some image processing utilities built right in. I recently found a means to display the differences between 2 PNM images.

By using these image processing utilities you can compare the following images to detect the changes between frames by using the following command:

$ convert frame00000002.bmp frame00000001.bmp -compose difference -composite -threshold 0 -negate diff.bmp




The resultant image is as follows:



Another side note that's worth mentioning, you don't have to redirect the results to a file. You can instead redirect the output to stdout and pipe it into the display utility for immediate rendering to screen; as follows:

$ convert frame00000002.bmp frame00000001.bmp -compose difference -composite -threshold 0 -negate - | display



Gotta love the command pipe!!