Motion - Feature Request 2006x 07x 16x 092729

Feature Request: Option to disable the link of lastsnap.jpg

Description

I would like to have option in motion.conf to disable the link of lastsnap.jpg. I need snapshoot every 300s for example. I would like to have the name of snapshoot the same as normal image and I have - motion has set the mask name of snapshot exactly the same as the mask name of normal image. But the link is really annoying. It disturbs my bash script when these move some files to another directory. Now these scripts do $> rm -f lastsnap.jpg every time.

-- MichaelK - 16 Jul 2006

Follow up

Hmm. Yes. I see it is a bit bad that this feature cannot be turned off.

I will not add another option just to turn this on and off.

I think I'd rather remove the feature and replace it with something more flexible like a new on_xxxx option which defaults to creating a link to latest snap.

Let me think about it for a few days.

Until I have come up with something let me help you to remove the feature from the sources.

In the file event.c find the function event_image_snapshot

Find the code that says

    /* Update symbolic link *after* image has been written so that
       the link always points to a valid file. */
    snprintf(linkpath, PATH_MAX, "%s/lastsnap.%s", cnt->conf.filepath, imageext(cnt));
    remove(linkpath);
    if (symlink(filename, linkpath)) {
        motion_log(LOG_ERR, 1, "Could not create symbolic link [%s]", filename);
        return;
    }

and just delete it.

Then the feature is gone.

-- KennethLavrsen - 16 Jul 2006

Comments

Topic revision: r2 - 16 Jul 2006, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.