nazargren
Posts: 58
Joined: Mon Jan 07, 2013 11:32 pm

target_dir Motion MMAL

Wed Jul 31, 2013 2:50 pm

I'm running Wheezy. In Motion MMAL, my photos a filling up my SD card because of the target_dir, does anyone have a tutorial on how to fix this? Thanks!

User avatar
jbeale
Posts: 3445
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: target_dir Motion MMAL

Wed Jul 31, 2013 4:34 pm

mount a USB memory stick, or USB hard drive, and change the target directory to that instead?

nazargren
Posts: 58
Joined: Mon Jan 07, 2013 11:32 pm

Re: target_dir Motion MMAL

Wed Jul 31, 2013 6:53 pm

jbeale wrote:mount a USB memory stick, or USB hard drive, and change the target directory to that instead?
Thanks for the reply! I'm trying to avoid that. Is there like a ghost directory that just nothing gets saved to?

User avatar
jbeale
Posts: 3445
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: target_dir Motion MMAL

Wed Jul 31, 2013 7:34 pm

You mean you don't want to save still photos at all? (eg you just want the video clips?) You can turn off saving of still images in the config file, see below setting: output_pictures off

Code: Select all

    ############################################################
    # Image File Output
    ############################################################

    # Output 'normal' pictures when motion is detected (default: on)
    # Valid values: on, off, first, best, center
    # When set to 'first', only the first picture of an event is saved.
    # Picture with most motion of an event is saved when set to 'best'.
    # Picture with motion nearest center of picture is saved when set to 'center'.
    # Can be used as preview shot for the corresponding movie.

    output_pictures off

nazargren
Posts: 58
Joined: Mon Jan 07, 2013 11:32 pm

Re: target_dir Motion MMAL

Wed Jul 31, 2013 11:27 pm

Sorry, I should have stated that I only want JPG's.

User avatar
jbeale
Posts: 3445
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: target_dir Motion MMAL

Thu Aug 01, 2013 12:14 am

You mean you don't want the AVI files? In that case edit the config file to turn them off: ffmpeg_output_movies off

Code: Select all

############################################################
# FFMPEG related options
# Film (movies) file output, and deinterlacing of the video input
# The options movie_filename and timelapse_filename are also used
# by the ffmpeg feature
############################################################

# Use ffmpeg to encode movies in realtime (default: off)
# ffmpeg_output_movies on
ffmpeg_output_movies off

nazargren
Posts: 58
Joined: Mon Jan 07, 2013 11:32 pm

Re: target_dir Motion MMAL

Thu Aug 01, 2013 1:27 am

Sorry again sir if I'm not making myself clear. So in MMAL, I've edited the config to not save AVI's, like you've stated, and to only send JPG's to my email in the on_picture_save option. If I set output_pictures to off, then nothing is emailed. My problem is that I don't want to use up my SD card's space or any extra device's space. I'm mainly looking for a way to turn target_dir off, create a directory that just nothing is saved to, or something like that. Thanks!

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: target_dir Motion MMAL

Thu Aug 01, 2013 12:30 pm

Hi again nazargren!

Unfortunately you will have to save a file somewhere in order to run the on_picture_save command to mail it. No other way around it.

Did you try my suggestion in another thread of following this command with one to delete the file after it is sent? E.g.

Code: Select all

on_picture_save mpack -s Alert %f [email protected] && rm %f
Or if that doesn't work, wrap the commands up in a bash script and call that, e.g.

Create a text file called mail-temp-picture.sh with this text:

Code: Select all

#!/bin/bash
mpack -s Alert $1 [email protected]
rm $1
Then make the on_picture_save setting be:

Code: Select all

on_picture_save mail-temp-picture.sh %f
This may need a little tweaking to work; unfortunately I'm away from any machine I can test it on.

pleasuretek
Posts: 1
Joined: Wed Aug 07, 2013 4:35 am

Re: target_dir Motion MMAL

Wed Aug 07, 2013 4:42 am

I use a bash script to clear my image folder with images older than 3 days. just point the target directory to where you save your images to.

Code: Select all

find /var/www/motion/camera1 -mtime +3 -type f -exec rm -rf {} \;

davyinfrance
Posts: 2
Joined: Mon Apr 13, 2015 4:17 pm

Re: target_dir Motion MMAL

Mon Apr 13, 2015 4:23 pm

Hi,

I spent the whole weekend trying to fix this,
at the moment I have

target_dir /mnt/usbkey

The daemon and console write photos to /home/pi !

Is this a known bug?
Thanks
D

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: target_dir Motion MMAL

Mon Apr 13, 2015 9:47 pm

There isn't an issue with target_dir of which I'm aware.

Please supply examples showing how you're running motion as a daemon and from the console - I'd like to first eliminate the straightforward possibilities such as whether you're running the version of motion you expect, and from where it loads the config file.

davyinfrance
Posts: 2
Joined: Mon Apr 13, 2015 4:17 pm

Re: target_dir Motion MMAL

Wed Apr 29, 2015 8:25 am

I suspected that it was the version of Motion MMAL that I used.
So I followed the steps in this

http://embeddedday.com/projects/raspber ... tion-mmal/

And everything works fine.

Now I've just got to get SAMBA to allow a share from the usb drive.

Return to “Camera board”