Motion - Feature Request 2006x 03x 07x 190118

Feature Request: Thread Name

Description

I'd like to have the option of specifying a name for each thread which could be incorporated into strings (filenames etc) as an alternative to thread number. Ideally also used in webcam URLs.

It could be that %t was replaced by name if name was specified or it could be a separate conversion specifier thing.

-- DickMiddleton - 07 Mar 2006

Follow up

Hmmm. A text_user and corresponding conversion specifier. I can see the purpose for it.

It could also be name or camera_name and be used also as a label for the web control interface.

I will leave this in discussion mode for a while to see what the other regular developers think also thinking about version 4.X where this may be the name label for a config section.

Comments

Just spotted this as a place to post this patch.

For some time now I have been using the text_event string as a name on my StatisticsDataPatch screen, but that name cannot be overlaid onto event image(s) reliably since text_event is null sometimes (when no event in progress). It doesn't appear on hourly snapshots, for example.

So I added a new ConversionSpecifier called %e (which actually seems to be the last single-letter one!) which inserts the string value specified by config file variable 'name' into the string.

This allows me to use text_left strings like this:
text_left %e\\nEVENT %v (Noise %N Thr. %o)

Note that multi-line support in text_left strings (using \\n) is already in Motion. It causes the text to scroll up the screen from the bottom.

The results are illustrated in the image attached, 20081215_event0104_cam2.jpg

The patch is attached below, named SWpatch_Friendlyname_161208. It is a number of diff -Naur catted together, I hope that's acceptable. It's a long time now since I did a Motion patch! It's short, so should not need much massaging if it doesn't cleanly apply. It's against 3.2.11.Oh and the web control interface seamlessly lets you change the 'name' parameter per thread - I didn't need to write any patch, it just works....

-- SimonW - 15 Dec 2008

Doesn't work against 3.2.12. The config parameters are now held in a conf array so in motion.c you have cnt->conf.name instead of cnt->name.

As a result you don't need to declare name as an array in context structure at all - it's all handled in conf.c. It's probably best if not necessary, to keep FRIENDLY_NAME_MAX to limit output length.

-- DickMiddleton - 13 Jun 2016
Topic attachments
I Attachment Action Size Date Who Comment
20081215_event0104_cam2.jpgjpg 20081215_event0104_cam2.jpg manage 40 K 15 Dec 2008 - 22:44 SimonW Image from my system (yes it is mostly dark) showing the use of the %e in text_left
SWpatch_Friendlyname_161208EXT SWpatch_Friendlyname_161208 manage 3 K 15 Dec 2008 - 22:43 SimonW Patch against 3.2.11 to add a config file string 'name' which is applied using the %e conversion specifier.
Topic revision: r4 - 13 Jun 2016, DickMiddleton
Copyright © 1999-2017 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.