Archive for the ‘Raspberry Pi Camera’ Category

Raspistill Arguments

Posted: October 13, 2013 by schoolpiclub in General News, Raspberry Pi Camera

Here is an example of a Raspistill command for a constant stream of jpeg images:-

$ raspistill -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 &

Now let’s take a look at the arguments for Raspistill one by one:-

-w  sets the image width. For an HD stream use 1920 here.

-h   sets the image height. For an HD stream use 1080 here.

-q   sets the JPEG quality level, from 0 to 100. I use a pretty low quality, better quality generates bigger pictures, which reduces the frame rate.

-o    sets the output filename for the JPEG pictures. I’m sending them to a temp directory. The same file will be rewritten with updated pictures.

-tl   sets the timelapse interval, in milliseconds. With a value of 100 you get 10 frames per second.

-t    sets the time the program will run. I put a large number here, that amounts to about two hours of run time.

-th  sets the thumbnail picture options. Since I want the pictures to be as small as possible I disabled the thumbnails by setting everything to zero.

&   puts the application to run in the background.

If you are interested in setting up a stream from your Raspberry Pi camera  to web browsers or even iOS or Android devices please visit this link for more details. http://blog.miguelgrinberg.com/post/stream-video-from-the-raspberry-pi-camera-to-web-browsers-even-on-ios-and-android

Advertisements

To playback videos on our Raspberry Pi we installed OMXplayer. This is a media player created by Edgar Hucek specifically for the Raspberry Pi.

Instructions to install

Omxplayer is installed on the latest Raspbian image so you may already have it installed. If not you can install it via LX Terminal using :

sudo apt-get update
sudo apt-get -y install omxplayer

Video Playback

To play a video file you just need to type the following into LX Terminal :

omxplayer myvideo.mp4

If you are using HDMI you should use this command to pass audio over the HDMI interface :

omxplayer -o hdmi myvideo.mp4

10 second video with Raspberry Pi Camera

Posted: October 13, 2013 by schoolpiclub in Raspberry Pi Camera

To take a 10 second video with your Raspberry Pi camera type the following into LX Terminal

raspivid -o video.h264 -t 10000

raspivid = is the utility that is part of Raspbian (the Raspberry Pi operating system) which is used to capture video.

-o = sets the output filename for the video

video.h264 = is the file name (h.264 is a new video codec standard which can achieve high quality video in relatively low bitrates. You can think it as the “successor” of the existing formats (MPEG2, MPEG-4, DivX, XvidD etc.) as it aims in offering similar video quality in half the size of the formats mentioned before.

-t = sets the time the program will run in milliseconds.

10000 = 10 seconds

 

 

 

To take a camera still photo type the following into LX Terminal

raspistill -o image.jpg

A preview screen will appear and after approximately 5 seconds it will take the picture.

raspistill = is the utility that is part of Raspbian (the Raspberry Pi operating system) which is used to capture still pictures.

-o = sets the output filename for the JPEG pictures.

image.jpg = is the file name

Raspberry Jam Lightning Talks in a Flash

Posted: October 13, 2013 by schoolpiclub in General News, Raspberry Pi Camera

Here is a timelapse video taken by 14 year old Reagan at the recent Raspberry Jam (7th Oct).

The view isn’t ideal but this is only our 2nd timelapse video.

Here is our first Timelapse video. It was created at today’s HackJam.

We followed the instructions via this link http://www.raspberrypi-spy.co.uk/2013/05/creating-timelapse-videos-with-the-raspberry-pi-camera/

We used the command to take a photo every 10 seconds (10000 milliseconds) for a 5 minute period (300000 milliseconds) resulting in a sequence of 30 images. This was the command we typed into LX Terminal on our Raspberry Pi.

raspistill -o myimage_%04d.jpg -tl 10000 -t 300000

We then had to combine the images into a video. We used “avconv”. You can install this useful library with the following command:-

sudo apt-get -y install libav-tools

To construct the video file from our image sequence we used the command below. We cropped the images and create a standard 1280×720 resolution. Please note this must be entered as a single line 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 video was quite fast so I used iMovie just to slow it down a little, I also added the movie again but in reverse.

We are planning to do more Timelapse video’s in the near future.

Ready for tomorrow’s lunch club I am installing the Raspberry Pi camera for the first time.

I have purchased a camera mount and USB led light (£4.99) from eBay to hold the camera securely in place. As seen in this image.

20130929-200430.jpg

The Raspberry Pi camera module needs to be installed, to do this I followed this YouTube video

As stated in the video the install takes approx 30 mins depending on your internet connection.

Raspberry Pi Guy is also on twitter, well worth a follow @RaspberryPiGuy1