2

I have a webcam running on my RPi. How can I use motion to save single images or movies to a file instead of streaming via http?

  • if you are using a Pi- then it is Pi related. I edited you question to ask a proper question as it is a really good one and valid for Pi. Please upvote answers and mark any ones that help you solve your problem. Thanks – Piotr Kula Jul 4 '13 at 8:33
3

This video http://www.youtube.com/watch?v=NwDLkMPLTw0

and part 2 http://www.youtube.com/watch?v=ZAoA_J5HD0M

is exactly what you're looking for.

You'll be editing the /etc/motion/motion.conf (provided you have one webcam) and in that file you'll want to find this section:

"############################################################

 Target Directories and filenames For Images And Films
 For the options snapshot_, jpeg_, mpeg_ and timelapse_filename
 you can use conversion specifiers
 %Y = year, %m = month, %d = date,
 %H = hour, %M = minute, %S = second,
 %v = event, %q = frame number, %t = thread (camera) number,
 %D = changed pixels, %N = noise level,
 %i and %J = width and height of motion area,
 %K and %L = X and Y coordinates of motion center
 %C = value defined by text_event
 Quotation marks round string are allowed.

"############################################################

You'll want to change the target_dir option below this section to where you want, for example :

>target_dir /home/pi/motionpic

Make sure the folder is created before-hand

0

You may also want to consider using nginx with rtmp-module. You have to compile it and you can find a guide I made here. You will have to skip a few part as that guide is to use the Pi Camera module.

I used these keyframes and it works really well. All you have to do is package your stream as flv and direct it to localhost nginx-rtmp. It has allot of other features.

in the server part you put this in

# record 10 video keyframes (no audio) every 2 minutes
       record keyframes;
       record_path /tmp/vc;
       record_max_frames 10;
       record_interval 2m;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.