To duplicate std output of a program (here my_prog) in bash
./my_prog | tee logfile.txt
Development and system problems, basic solutions and workarounds / Platform : Linux, C,C++,OpenCV, OpenGL, SDL, SDL2, ffmpeg, Libav, Blackmagic acquisition
vendredi 5 septembre 2014
lundi 28 juillet 2014
Script to test if ethernet interface eth3 is up
#!/bin/bash
var="down"
while [[ $var != "up" ]]
do
var=$(</sys/class/net/eth3/operstate )
echo $var
done
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
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.
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
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
Inscription à :
Articles (Atom)