mercredi 26 février 2014

Downloading big files from camera

On Mint downloading files from a camera using the gphoto2 automount and caja can be very slow on big files. An efficient alternative is to use gphotofs.

First create a directory for further mounting of the camera


sudo mkdir /media/mtp 
sudo chmod 777 -R /media/mtp

Then  unmount the device automatically mounted by gphoto2 and then you can mount your camera as follows

sudo gphotofs /media/mtp -o allow_other

To unmount

sudo fusermount -u /media/mtp

Then you can use a terminal and copy files, e.g.

cd /media/mtp/*
cp */*.MOV~/Images

This process is much faster than with caja

lundi 24 février 2014

swap blue and red

to exchange red and blue channel in an image file with imagemagick, I found this command

convert salle_test3.png -separate -swap 0,2 -set colorspace RGB -combine -set colorspace sRGB salle_test.png



The reason for specifying the colors pace is not clear to me. Not doing so however clearly changes the lightness of the image.

mercredi 19 février 2014

webcam libav

I tried to read from a webcam using the libav library or the ffmpeg equivalent, which are obviously not well documented w.r.t. this specific matter. I realized that the following call is required at the beginning of the program :

avdevice_register_all();

not to mention
av_register_all();

To install  ffmpeg and the corresponding original libraries  on Mint, the following tutorial works well:
http://trac.ffmpeg.org/wiki/UbuntuCompilationGuide

A working code example
https://github.com/j0sh/thesis/blob/master/capture.c

mercredi 23 octobre 2013

C++ tutorials

cout <<setiosflags(ios::fixed)<<setprecision(2) <<"t=" <<setw(5)<<mytime/1000<<" dt=" <<setw(3)<<dif<<" fps=" <<setw(6)<<fps<<" incr=" <<setw(3)<<incr<<"        \r"<<flush;
 


output formatting in c++ http://arachnoid.com/cpptutor/student3.html

Other c++ online tutorials

vendredi 14 juin 2013

convert a mpeg4 .mp4 video en h264 quicktime .mov

ffmpeg -i film.mp4 -f mov -acodec libfaac -ab 128k  -vcodec libx264  -preset medium  -y film.mov

samedi 11 mai 2013

ffmpeg commands to create a "drawing" style video

Enhancing local contrast and creating lines
ffmpeg -ss 60 -i film.avi -vf hue=s=0,\
lutyuv="y=2*val",smartblur=1:1:0,edgedetect=low=0.1:high=0.2\
-vcodec huffyuv -pix_fmt bgra -y dessin.avi

To extract an alpha channel
ffmpeg -i  film.avi -vf alphaextract -vcodec huffyuv -y alpha.avi
To merge a alpha channel to an existing movie
ffmpeg -i dessin.avi -vf "movie=alpha.avi[alpha];[in][alpha]alphamerge[out]" -vcodec huffyuv -y dessin2alpha.avi

mercredi 13 février 2013

Performance on Mint LMDE

My system (Mint LMDE 64 bits AMD PhenomII X4) was running at the base CPU Freq 800 MHz instead of 3.4GHz

I followed the advice mentionned here and with synaptic removed all cpufreqd from my system and according to system profiler the processors frequency now seems ok