DVBT Raspberry Ais Receiver

AIS receiver for the Raspberry Pi

This is very much a work in progress…

Installing the RTL_SDR software

http://www.satsignal.eu/raspberry-pi/AIS-receiver.html

2013-Nov-19

This information is a direct copy of my write-up for installing the same software for the ADS-B dump 1090 program.

  • sudo  apt-get  install  git-core
  • sudo  apt-get  install  cmake
  • sudo  apt-get  install  libusb-1.0-0dev
  • git  clone  git://git.osmocom.org/rtl-sdr.git
  • cd  rtl-sdr
  • mkdir  build
  • cd build
  • cmake  ../ -DINSTALL_UDEV_RULES=ON
  • make
  • sudo make install
  • sudo ldconfig
  • cd ~
  • sudo  cp  ./rtl-sdr/rtl-sdr.rules  /etc/udev/rules.d/
  • sudo reboot
  • rtl_test
  • rtl_test -t  (for E4000-based tuner)

 

SE NON FUNZIONA E restituisce il seguente errore:

usb_claim_interface error -6
Failed to open rtlsdr device #0

Some research told me that apparently this is caused by a conflict with the DVB-T kernel modules provided by the Linux kernel. There were two sugested remedies:

1) Blacklist the kernel modules using modprobe.d. You need to create a file /etc/modprobe.d/librtlsdr-blacklist.conf and put the following in it: “blacklist dvb_usb_rtl28xxu” (Without the quotes). I tried this, and it didn’t work – same error.

2) Option 2 – enable detaching the kernel module at compile time, when you build the rtl-sdr driver. This feature is disabled by default in the CMakeLists.txt file (for those interested, the changelog is here: http://ftp-master.metadata.debian.or….README.Debian

To enable it when building with cmake, you need the option: cmake ../ -DDETACH_KERNEL_DRIVER=ON

So the relevant section in your HowTo doc would become:

cd rtl-sdr
mkdir build
cd build
cmake ../ -DDETACH_KERNEL_DRIVER=ON -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

 

 

Installing the AIS Decoder software

From: http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/new/

The basic instructions are:

  • wget  http://www.aishub.net/downloads/aisdecoder.tar.gz
  • tar  zxvf  aisdecoder.tar.gz
  • cd  aisdecoder
  • mkdir  build
  • cd  build
  • cmake  ../ -DCMAKE_BUILD_TYPE=Release

At this point, the cmake command was not found, so I tried:

  • sudo  apt-get  update
  • sudo  apt-get  install  cmake

and then repeated the command:

  • cmake  ../ -DCMAKE_BUILD_TYPE=Release

This resulted in the error messages:

— Build configuration: Release
CMake Error at CMakeLists.txt:54 (MESSAGE):
The development files for ALSA or PulseAudio are required – libasound-dev,
libpulse-dev

— Configuring incomplete, errors occurred!

So let’s try installing those packages, but first remove the file which tells cmake which packages were found or not.  If you don’t do this, no amount of installing packages will help, and you can waste an entire morning chasing the problem,  Been there, done that!

  • rm  CMakeCache.txt
  • sudo  apt-get  install  libasound-dev  libpulse-dev
  • make

2013-Dec-10

Not sure what’s happened (other than two reboots), but now running the cmake command works without errors:

— Build configuration: Release
— Configuring done
— Generating done
— Build files have been written to: /home/pi/AIS/aisdecoder/build

so next to link the radio receiver software with the AIS decoder program…

Altri link:

http://www.satsignal.eu/raspberry-pi/AIS-receiver.html

http://www.maritec.co.za/aisvdmvdodecoding/

http://gnuais.sourceforge.net/

http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGR

http://de8msh.blogspot.it/2012/09/rtl-sdr-toolbox-on-linux-based-os.html

http://www.rtl-sdr.com/rtl-sdr-radio-scanner-tutorial-receiving-airplane-data-with-acars/

http://atlantic-source.com/blog/how-to-connect-ais-receiver-or-transponder-to-opencpn-software/

http://opencpn.org/ocpn/ais

http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=23478

http://forum.43oh.com/topic/4833-potm-daisy-a-simple-ais-receiver/

https://sites.google.com/site/n7bhcvhf/trans-oceantic-ducting/beacon-project/non-amateur-beacons/marine-band-beacons

http://www.coaa.co.uk/epirbplotter.htm

http://www.cruisersforum.com/forums/f134/fast-cheap-ais-using-20-rtl-sdr-dvb-t-sdr-dongles-84234.html

http://www.rtl-sdr.com/wp-content/uploads/2013/05/gr-ais_in_SuSE12.3.en_.v.1.pdf

http://forum.aishub.net/ais-decoder/ais-decoder-beta-release/

http://forum.flightradar24.com/threads/6133-Raspberry-Pi-type-B-DVB-T-Dongle-to-feed-FR24/page33

 

 

 

 

Installing Raspberry Operating System Images on Linux

Please note that the use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below you could delete your primary Linux partition. Please be careful.

  • Run
    df -h

    to see what devices are currently mounted.

  • If your computer has a slot for SD cards, insert the card. If not, insert the card into an SD card reader, then connect the reader to your computer.
  • Run
    df -h

    again.
    The new device that has appeared is your SD card. The left column gives the device name of your SD card; it will be listed as something like /dev/mmcblk0p1 or /dev/sdd1. The last part (p1 or 1 respectively) is the partition number but you want to write to the whole SD card, not just one partition.
    Therefore you need to remove that part from the name (getting, for example, /dev/mmcblk0 or /dev/sdd) as the device for the whole SD card.
    Note that the SD card can show up more than once in the output of df; it will do this if you have previously written a Raspberry Pi image to this SD card, because the Raspberry Pi SD images have more than one partition.

  • Now that you’ve noted what the device name is, you need to unmount it so that files can’t be read or written to the SD card while you are copying over the SD image.
  • Run
    umount /dev/sdd1

    , replacing sdd1 with whatever your SD card’s device name is (including the partition number).

  • If your SD card shows up more than once in the output of df due to having multiple partitions on the SD card, you should unmount all of these partitions.
  • In the terminal, write the image to the card with the command below, making sure you replace the input file if= argument with the path to your .img file, and the /dev/sdd in the output file of= argument with the right device name. This is very important, as you will lose all data on the hard drive if you provide the wrong device name. Make sure the device name is the name of the whole SD card as described above, not just a partition of it; for example sdd, not sdds1 or sddp1; or mmcblk0, not mmcblk0p1.
    dd bs=4M if=2014-06-20-wheezy-raspbian.img of=/dev/sdd
  • Please note that block size set to 4M will work most of the time; if not, please try 1M, although this will take considerably longer.
  • Also note that if you are not logged in as root you will need to prefix this with sudo.
  • The dd command does not give any information of its progress and so may appear to have frozen; it could take more than five minutes to finish writing to the card. If your card reader has an LED it may blink during the write process. To see the progress of the copy operation you can run
    pkill -USR1 -n -x dd

    in another terminal, prefixed with sudo if you are not logged in as root. The progress will be displayed in the original window and not the window with the pkill command; it may not display immediately, due to buffering.

  • Instead of dd you can use
    dcfldd

    it will give a progress report about how much has been written.

  • You can check what’s written to the SD card by dd-ing from the card back to another image on your hard disk, and then running diff (or md5sum) on those two images. There should be no difference.
  • Run
    sync

    this will ensure the write cache is flushed and that it is safe to unmount your SD card.

  • Remove the SD card from the card reader.

Installing VNC server in Raspberry Pi running Raspbian

This guide assumes you already have Raspbian OS installed in your Raspberry Pi. VNC is very useful when we intend to manage our Raspberry Pi remotely. This means we don’t need a separate display, keyboard and mouse. Just leave Raspberry Pi on and connected to local network, and we can remotely access it from other computer with VNC client.

raspbian-desktopBefore installing new application or service in Raspbian, make sure to always type this into terminal :
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

If you’re installation is not the latest version, it might take a while as Raspbian will download the latest files from Internet. My Raspbian image file is dated 9 Feb 2013. Different version of Raspbian might produce different behavior.

Now, open terminal again and type:
sudo apt-get install tightvncserver
This will install TightVNC into Raspbian system.

Next, we need to do first-time run to set the password. Type this into terminal:
tightvncserver :1
Then enter your desired password (8 characters) for VNC connection.

Having VNC executed with user action does not serve the purpose of preparing Raspberry Pi for remote access. We need to add VNC server into startup sequence. There are more than one ways to do this, but I’ll use an easy one.

As usual, type this into terminal:
wget http://www.robertsetiadi.net/download/tightvncserver-init.txt
sudo mv tightvncserver-init.txt /etc/init.d/tightvncserver

Credit to PenguinTutor for the script. You may need to change the variable on line 16. It is currently set to pi (the default username on the Raspbian OS image). Set this to whatever username you want to login to TightVNC as, but do not put root as the user.

sudo chown root:root /etc/init.d/tightvncserver
This is to change the ownership of the file (set to belong to root).

sudo chmod 755 /etc/init.d/tightvncserver
This is to make the file executable.

sudo update-rc.d tightvncserver defaults
This is to add the script to startup.

Just for additional information, you can manually start VNC by:
sudo /etc/init.d/tightvncserver start or sudo /etc/init.d/tightvncserver stop

Now you need to know the IP address of your Raspberry Pi.
ifconfig eth0 (if you’re using network cable)
ifconfig wlan0 (if you’re using WiFi)

Finding MAC address: (this command is actually not needed for VNC)
cat /sys/class/net/eth0/address (if you’re using network cable)
cat /sys/class/net/wlan0/address (if you’re using WiFi)

You might also want to make your Raspberry Pi having a static IP address:
sudo nano /etc/network/interfaces

Then change this line:
iface eth0 inet dhcp
into:
iface eth0 inet static
and add the following lines below the iface line:
address 192.168.1.8 (change this with your desired address for the Pi)
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.254
Of course, you should adjust the lines according to your network settings.

The next step is to install VNC client in another computer and test the connection. This will depend on which operating system it uses and which VNC client you prefer. For the connection, you will need Raspberry Pi’s IP address and port. For the port, try 1 or 5901. I am using Chicken VNC in Mac and can connect without any problem.

Lastly, a quick tip. In VNC mode, I was unable to shutdown my Raspberry Pi using GUI. The only option available is “Log Out”. Type this into terminal to perform manual shutdown:
sudo shutdown -hP now


Raspberry PI boot to browser

Fonte: Nejc Zupan at Jan 22, 2013 12:51 PM | Permalink

Here at NiteoWeb, we use various SaaS monitoring and logging providers such as Librato Metrics and Papertrail to keep on top of our Plone and Pyramid projects. Hence the need to have a wall-mounted screen to display various graphs and outputs these services. What better way to drive the screen than a Raspberry Pi!

Getting the Raspberry Pi to boot into X and connect to the net was fairly trivial, just follow the official docs. However, getting the Pi to boot directly into a browser (also called “kiosk” mode) required some research. This is how I’ve done it in the end:

  1. Disable screen sleep — so the screen stays on
    $ sudo nano /etc/lightdm/lightdm.conf
    
    # add the following lines to the [SeatDefaults] section
    
    # don't sleep the screen
    xserver-command=X -s 0 dpms
  2. Hide cursor on inactivity
    $ sudo apt-get install unclutter
  3. Configure LXDE to start the Midori browser on login
    $ sudo nano /etc/xdg/lxsession/LXDE/autostart 
    
    # comment everything and add the following lines
    
    @xset s off
    @xset -dpms
    @xset s noblank
    @midori -e Fullscreen -a http://plone.org

# don’t sleep the screenxserver-command=X -s 0 dpms

Using Raspberry Pi to run a shop window slideshow

SiteShow.htm

Author: Troy Wolf (troy@troywolf.com)
Modified Date: 2006-05-24

What is it?

SiteShow is a very easy to use, self-contained HTML/CSS/Javascript page that facilitates a slideshow of web pages. Each web page becomes a “slide” in the show. The pages can be your own web content, direct links to images, or any other web page on the Internet.

See it in action! See the source code

Things you should know

SiteShow uses an IFRAME to contain the slide pages. If any of your slide pages have script to force itself out of a frameset, the page will obviously break the show.

If any of your slide pages are slow loading, it detracts from the show’s effect. Not my problem. 🙂 I designed the show for use on an Intranet for display in a company’s lobby. In this environment, the show works fantastic.

SiteShow works best in IE. I welcome suggestions to make it work better in Mozilla/Firefox. The issues in Firefox are:

  1. The fading in and out is a bit jerky. It is smooth in IE.
  2. The SiteShow body background color is inherited by the slide pages. This can produce undesirable results. This is not a problem in IE.

TIP: Use SiteShow in your browser’s full-screen mode (F11 key).

Features

  • Easily define as many slides as you want. For each, you specify a title, URL, and duration time in seconds.
  • SiteShow Menu allows people to pause, play, or go directly to any specific slide. The menu auto-fades in on page mouseover. It auto fades-out after a few seconds.
  • Modify the fade out color by changing the CSS background-color.
  • Requires zero server-side code. Entire utility is contained in a single, simple, client-side page.

How do I use it?

Simply copy the page source below into a new HTML file then edit the slides[] array in the Javascript.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
SlideShow v1.0
Troy Wolf <troy@troywolf.com>
Simply define your "slides" in the javascript slides[] array below.
-->
<html>
<head>
<title>SiteShow 1.0</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">

<style>
/* Change body background-color to change fade out color. */
body.siteshow { margin:0; padding:0; background-color:#000000; }
#menu
{
font-family:Arial;
font-size:9pt;
display:none;
opacity:0.00;
-mozopacity:0.00;
filter:alpha(opacity=0);
position:absolute;
top:10px;
left:10px;
padding:5px;
background-color:#000000;
color:#FFFFFF;
border:3px dotted #999999;
}
#menu a { color:#ffffff; }
#menu a:hover { text-decoration:none; }
#title { font-size:11pt; font-weight:bold; letter-spacing:2; }
#slides { font-size:9pt; line-height:16pt; }
.button { width:60px; font-size:9pt; letter-spacing:1; }
</style>

<script type="text/javascript">
var current_idx = 0;
var slides = new Array();
var menuwin;
var show_timer;
var menu_timer;
var menu;
var content;
var loaded = true;

// Define your "slides". 3 values for each are:
// 1. Duration in seconds.
// 2. Title to be used in menu.
// 3. Source URL. Can be full URI or a relative URL.
slides[1] = new Array(15, "WAMP HOWTO", "http://www.troywolf.com/articles/wamp_howto.htm");
slides[2] = new Array(15, "PHP Proxy", "http://www.troywolf.com/articles/php/class_http/proxy.phps");
slides[3] = new Array(15, "HTTP class", "http://www.troywolf.com/articles/php/class_http/");
slides[4] = new Array(15, "Session class", "http://www.troywolf.com/articles/php/class_session/");
slides[5] = new Array(15, "RSS Consumption", "http://www.troywolf.com/articles/php/class_xml/rss_example.php");
slides[6] = new Array(15, "PHP Exchange WebDAV", "http://www.troywolf.com/articles/php/exchange_webdav_examples.php");
slides[7] = new Array(15, "vCard class", "http://www.troywolf.com/articles/php/class_vcard/");

function MenuInit()
{
var html = "";
for(idx=1; idx<slides.length; idx++) {
html += '<a href="javascript:Navigate('+idx+')">' +
slides[idx][1] + "</a><br />\n";
}
document.getElementById("slides").innerHTML = html;
menu.style.display = "block";
}

function MenuShow()
{
clearTimeout(menu_timer);
opacity('menu', 0, 90, 500);
menu_timer = setTimeout("MenuHide()", 3500);
}

function MenuHide()
{
opacity('menu', 90, 0, 500);
}

function Pause()
{
clearTimeout(show_timer);
document.getElementById('play').style.display = "block";
document.getElementById('pause').style.display = "none";
}

function Navigate(slide_idx)
{
clearTimeout(show_timer);
if (current_idx == 0) {
if (!slide_idx) { slide_idx = 1; }
current_idx = slide_idx;
content.src = slides[current_idx][2];
document.getElementById('play').style.display = "none";
document.getElementById('pause').style.display = "block";
show_timer = setTimeout("Navigate()", slides[current_idx][0]*1000);
return;
}

if (slide_idx) {
current_idx = slide_idx;
content.src = slides[current_idx][2];
document.getElementById('play').style.display = "block";
document.getElementById('pause').style.display = "none";
return;
}

loaded = false;
current_idx++;
if ( current_idx == slides.length) { current_idx = 1; }
opacity('content', 100, 0, 500);
document.getElementById('play').style.display = "none";
document.getElementById('pause').style.display = "block";
show_timer = setTimeout("Navigate()", slides[current_idx][0]*1000);
return;
}

function opacity(id, opacStart, opacEnd, millisec)
{
//speed for each frame
var speed = Math.round(millisec / 100);
var timer = 0;

//determine the direction for the blending, if start and end are the same nothing happens
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
if (opacEnd == 0) { setTimeout("FadeOutTrigger('"+id+"')",((timer-1) * speed));; }
//if (opacEnd == 0) { FadeOutTrigger(id); }
} else if(opacStart < opacEnd) {
if (opacStart == 0) { FadeInTrigger(id); }
for(i = opacStart; i <= opacEnd; i++)
{
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}
}

//change the opacity for different browsers
function changeOpac(opacity, id)
{
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}

function FadeOutTrigger(id)
{
//alert('FadeOut: '+id);
switch(id) {
case "menu":
document.getElementById(id).style.display = "none";
break;
case "content":
content.src = slides[current_idx][2];
//setTimeout("opacity('content', 0, 100, 500)", 1000);
break;
default:
break;
}
}

function FadeInTrigger(id)
{
//alert('FadeIn: '+id);
switch(id) {
case "menu":
document.getElementById(id).style.display = "block";
break;
case "content":
//opacity('content', 0, 100, 500);
break;
default:
break;
}
}

function FadeInContent()
{
if (!loaded) {
opacity('content', 0, 100, 500);
loaded = true;
}
}

function LoadTrigger()
{
//self.resizeTo(1366,768);
menu = document.getElementById('menu');
content = document.getElementById('content');
Navigate();
MenuInit();
MenuShow();
}

window.onload = LoadTrigger;

</script>

</head>
<body>
<iframe id="content" name="content" style="width:100%; height:100%;" frameborder="no" scrolling="auto" src="" onmouseover="MenuShow();" onload="FadeInContent();" ></iframe>
<div id="menu">
<div id="title">SiteShow Menu</div>
<div id="slides">
</div>
<p>
<input id="pause" style="display:block;" type="button" value="pause" onclick="Pause()" />
<input id="play" style="display:none;" type="button" value="play" onclick="Navigate()" />
</p>
</div>
</body>
</html>


Raspberry Pi Camera Board – RaspiStill Command List

RaspiStill Camera App

=====================
Runs camera for specific time, and take JPG capture at end if requested
usage: RaspiStill [options]
Image parameter commands
-?, –help : This help information
-w, –width : Set image width <size>
-h, –height : Set image height <size>
-q, –quality : Set jpeg quality <0 to 100>
-r, –raw : Add raw bayer data to jpeg metadata
-o, –output : Output filename <filename> (to write to stdout, use ‘-o -‘). If not specified, no file is saved
-v, –verbose : Output verbose information during run
-t, –timeout : Time (in ms) before takes picture and shuts down (if not specified, set to 5s)
-th, –thumb : Set thumbnail parameters (x:y:quality)
-d, –demo : Run a demo mode (cycle through range of camera options, no capture)
-e, –encoding : Encoding to use for output file (jpg, bmp, gif, png)
-x, –exif : EXIF tag to apply to captures (format as ‘key=value’)
-tl, –timelapse : Timelapse mode. Takes a picture every <t>ms
Preview parameter commands
-p, –preview : Preview window settings <‘x,y,w,h’>
-f, –fullscreen : Fullscreen preview mode
-n, –nopreview : Do not display a preview window
Image parameter commands
-sh, –sharpness : Set image sharpness (-100 to 100)
-co, –contrast : Set image contrast (-100 to 100)
-br, –brightness : Set image brightness (0 to 100)
-sa, –saturation : Set image saturation (-100 to 100)
-ISO, –ISO : Set capture ISO
-vs, –vstab : Turn on video stablisation
-ev, –ev : Set EV compensation
-ex, –exposure : Set exposure mode (see Notes)
-awb, –awb : Set AWB mode (see Notes)
-ifx, –imxfx : Set image effect (see Notes)
-cfx, –colfx : Set colour effect (U:V)
-mm, –metering : Set metering mode (see Notes)
-rot, –rotation : Set image rotation (0-359)
-hf, –hflip : Set horizontal flip
-vf, –vflip : Set vertical flip
Notes
Exposure mode options :
off,auto,night,nightpreview,backlight,spotlight,sports,snow,beach,verylong,fixedfps,antishake,fireworks
AWB mode options :
off,auto,sun,cloud,shade,tungsten,fluorescent,incandescent,flash,horizon
Image Effect mode options :
none,negative,solarise,sketch,denoise,emboss,oilpaint,hatch,gpen,pastel,watercolour,film,blur,saturation,colourswap,washedout,posterise,colourpoint,colourbalance,cartoon
Metering Mode options :
average,spot,backlit,matrix

Creating Timelapse Videos With The Raspberry Pi Camera

Timelapse ProcessIn this post I will explain how I made some timelapse videos using the Raspberry Pi camera module. This is a two step process which involves getting the camera module to take a series of stills over a period of time and then combining them into an MP4 video file.

We can use the “raspistill” utility to take a set of time lapsed photos as described in my Taking Hi-Res Photos With The Pi Camera Module article. Make sure you have installed the camera and updated your operating system.

Step 1 – Taking the time-lapsed photos

This command will take a photo every 60 seconds (60000 milliseconds) for 2 hours (7200000 milliseconds) resulting in a sequence of 120 images.

raspistill -o myimage_%04d.jpg -tl 60000 -t 7200000

The “%04d” will result in a four digit number appearing in each filename.

myimage_0001.jpg
myimage_0002.jpg
...
myimage_0119.jpg
myimage_0120.jpg

Step 2 – Combine images into MP4 video

Once you’ve got your image sequence you will need a method to stitch them together. I decided to use “avconv”. You can install this useful library with the following command :

sudo apt-get -y install libav-tools

To construct the video file from your image sequence you use the command shown below. Although it appears on multiple lines for readability it should be entered as a single line on the command line :

avconv -r 10 -i myimage_%04d.jpg
       -r 10 -vcodec libx264 -crf 20 -g 15
       timelapse.mp4

The video will be the full resolution of the default image size (2592×1944).

To crop the images and create a more standard 1280×720 resolution video you can use the following command :

avconv -r 10 -i timelapse_%04d.jpg
       -r 10 -vcodec libx264 -crf 20 -g 15
       -vf crop=2592:1458,scale=1280:720
       timelapse.mp4

The “vf” option defines a video filter. In this case two filters which crop the incoming image to 2592×1458 and then scale them to 1280×720.

The “r” option tells avconv to create a video with a frames per second of 10. It appears twice to prevent avconv dropping frames that it thinks are similar.

The “crf” option tells avconv to aim for a quality level of “20″ which is a good starting point. Lowers values are better but will increase the file size.

The “-g” option sets the GOP value. The YouTube Advanced Encoding Settings page recommends that the GOP should be set to half the frame rate so this is set to 15.

The conversion process is very slow on the Pi compared to doing the same thing on a desktop PC. For long sequences with hundreds of frames I would recommend downloading an appropriate version of Libav on your desktop or laptop and build your MP4 files much faster!

use ffmpeg

When using ffmpeg to compress a video, I recommend using the libx264 codec, from experience it has given me excellent quality for small video sizes. I have noticed that different versions of ffmpeg will produce different output file sizes, so your mileage may vary.

To take a list of images that are padded with zeros (pic0001.png, pic0002.png…. etc) use the following command:

ffmpeg -r 60 -f image2 -s 1920×1080 -i pic%04d.png -vcodec libx264 -crf 15 -vpre normal test.mp4

where the %04d means that zeros will be padded until the length of the string is 4 i.e 0001…0020…0030…2000 and so on. If no padding is needed use something similar to pic%d.png.

  • -r is the framerate
  • -crf is the quality, lower means better quality, 15-20 is usually good
  • -s is the resolution
  • -vpre is the quality setting, better quality takes longer to encode, some alternatives are: default, normal, hq, max

the file will be output (in this case) to: test.mp4

Note: the -vpre command only works if the corresponding setting file is available

Finer Bitrate control (to control size and quality)

  • -b 4M

you can use the -b flag to specify the target bitrate, in this case it is 4 megabits per second

Testato:

ffmpeg -r 5 -i images_%04d.jpg -vcodec libx264 -crf 10 -vpre hq test.mp4

Server di stampa e scansione con Raspberry

Categoria: Progetti
Pubblicato Lunedì, 24 Giugno 2013 22:40
Scritto da Christian – Linux Ludus Villafranca (VR)

Se avete più di un pc magari e una MPF o semplicemente stampanti escanner e siete stufi di doverli ogni volta collegare per stampare e o scansionare qualcosa, allora siete come me. Ciò che andrò a descrivere èvalido per qualsiasi periferica supportata da cups e da sane, ovvero i server di stampa e scansione di linux.

Requisiti generali:

  • raspberry funzionante, ovvero complessivo di SD.
  • sistema operativo (xbian, raspxbmc,openelc,raspbian) quello che più vi piace, io ho usato xbian
  • collegamento di rete (eth o wifi)

Per iniziare è opportuno aver configurato il raspberry per l’accesso in rete.

Stampante di rete

Configurare CUPS

Per prima cosa è opportuno installare cups che si proterà come dipendenza anche sane, usando il seguente comando:

1
sudo apt-get install cups

Il passo successivo sarà quello di aggiungere l’utente della vostra minidristro al gruppo lpdamin (amministratori gruppo stampa), nel mio caso xbian
usermod -aG lpadmin xbian
Questo passaggio è importante dal momento che noi necessitiamo dei permessi di root per aggiungere stampanti.
Ora dovremmo cambiare le impostazioni di accesso a cups per accedervi dalla rete, si deve modificare il file di configurazione di cups:

1
sudo nano /etc/cups/cupsd.conf

Per permettere l’accesso remoto alla interfaccia web di cups si deve quindi modificare il file nel seguente modo:
Cambiare Listen localhost: 631 con Port: 631
Se la vostra rete non è accessibile dall’esterno potete permettere a tutti di accedere a cups con il comando:

1
2
$ sudo cupsctl --remote-admin
$ sudo cupsctl --remote-any

evitando di editare il file sopra menzionato.
Quello che stiamo facendo è dire a cups quali IP della rete si potranno collegare, nel nostro caso tutti, per completare la configurazione è necessario riavviare cups:

1
$ sudo /etc/init.d/cups restart

Aggiungere stampante:

Con il vostro browser puntate all’IP del vostro RaspPI con la porta 631, esempio:

 https://192.168.1.169:631

Andate su amministrazione e poi cliccate su aggiungi stampante, vi verrà chiesto di inserire user e password dell’utente che state utilizzando, poi potrete selezionare la vostra stampante.
Ricordatevi di selezionare le opzioni di condivisione di rete e anche la stampa da internet.
Scanner di rete:

Come detto in precedenza, qualsiasi periferica riconosciuta da sane è facilmente gestibile da remoto, andando a dire al server saned chi può accedere alla periferica collegata editando il file, sul raspberry:

1
/etc/sane.d/saned.conf

aggiungendo semplicemente gli IP ammessi alla connessione al file.
Infine, accertiamoci che sane sia avviato al boot, editando il file:

1
/etc/default/saned

cambiando la linea impostando su yes come sotto:

1
RUN=yes

Dopo aver configurato la parte server dobbiamo configurare la parte client sul nostro computer, al quale diremo quale IP in rete condivide lo scanner modificando il file:

1
/etc/saned/net.conf

aggiungendo l’IP del raspberry
Ora la configurazione è terminata e potrete godere dei vantaggi di una multifunzione in rete.

————————————————–

Si ringrazia Linux Ludus Villafranca (VR), nello specifico Christian, per la guida.

Link: http://www.linuxludus.it/

Descrizione: LinuxLudus è il LUG di Villafranca di Verona. Il nostro gruppo non tratta unicamente il Sistema Operativo GNU/Linux ma anche altri Sistemi Operativi liberi ed in generale tutto il FOSS (Free Open Source

Preserving movies with a Raspberry Pi

Kinograph: preserving 1920s movies with a Raspberry Pi

3 comments Tags: 3 hours agoby liz

submit to reddit

A great motivator for us in developing the Raspberry Pi was bringing down the cost of computing. Nobody should be excluded from being able to learn about computing, or from using it for work or pleasure, by what’s in their pocket.

The pricing of electronics means that some important and useful tools have historically been outside the reach of anyone without a large chunk of capital behind them. You’ll have seen the photography hacks we feature here, which use a Pi to make very, very inexpensive versions of photography equipment like time-lapse rigs, gigapixel rigs, water droplet setups and the like. Off-the-shelf versions of equipment like this can cost thousands of pounds, but a Pi and some ingenuity can bring the cost right down to levels which are sensible and affordable. These projects are not just for amateurs: we have seen professional photographers using Pi-based, home-hacked equipment in preference to the expensive stuff. It works just the same, and there’s a lot to be said for the warm glow you get from making your work tools yourself.

It’s not just individuals and small businesses who are sometimes priced out of doing worthwhile stuff by the price of electronics. Libraries, museums and other public institutions are often priced out of being able to digitise collections by the prohibitive cost of equipment.

Isolating audio

Kinograph is an astonishing thesis project from Matthew Epler, an artist and film historian. It’s a Pi-powered, open-source, scalable device for digitising old film stock, complete with the ability to stabilise images (another application for OpenCV) and recapture sound. A good DSLR camera is the most expensive part of the setup, at about $2000; the rest of the equipment comes to $1200. (Matthew is working on getting that figure down below the magic $1000.) Compare that to the $480,000 it would cost you to digitise 50 films on reels at a film lab, or the $175,000 it’d cost you to buy a Kinetta (the nearest commercial equivalent device) and a whole world of possibilities opens up. Film stock, be it celluloid, acetate or nitrate based, is not stable, and being able to record and save our film heritage is a pressing concern. We’ve already lost more than 90% of all silent movies, and around 50% of the films with audio made before 1950.

Kinograph at work – note the 3D printed rollers

I have what could probably be called a bit of an old movie problem; my bedroom wall has framed pictures of pre-talkies Norma Shearer, Lupe Velez and Anna May Wong, like the bedroom of a teenager who’s been time-shifted 90 years. I howl with frustration at poor Eben, who has to share that bedroom, when I read the synopses of pre-code movies I’d give my right arm to see, which have gone forever. We’ve got shelves of books on silent movies, along with boxes of DVDs and old fan magazines. That the Raspberry Pi is a part of this project makes me unspeakably proud.

Here’s a two and a half minute video about the technology.

Matthew is working to iron out a few remaining bugs and to bring the cost down further. He expects to be posting the materials, instructions, and code online at the end of July. Watch this space!

Fonte: Raspberry PI .org