Send Motion-user mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: USB video cameras changing /dev/video#'s after reboot
      (Mike Wilson)
   2. ffmpeg 5.6 & motion (folkert)
   3. text location (folkert)
   4. Re: ffmpeg 5.6 & motion (tosiara)


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Nov 2015 12:01:30 -0500
From: Mike Wilson <[email protected]>
Subject: Re: [Motion-user] USB video cameras changing /dev/video#'s
        after reboot
To: [email protected], Motion discussion list
        <[email protected]>
Message-ID: <6dc3677a-fcfc-43ae-a4be-22ed864cd6c9@Spark>
Content-Type: text/plain; charset="utf-8"

Your best option here is to use udev rules to name the cameras something that 
will not change.


On Nov 23, 2015, 11:29 AM -0500, Kenneth Kron<[email protected]>, wrote:
> I have several systems running motion and they reboot every day as there
> is no way to avoid power interruptions.
> 
> Is there any way to tell linux to bring up the different usb
> ports/cameras in sequence instead of in parallel?
> 
> Thanks
> 
> Kenneth
> 
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug&build mobile apps&2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Motion-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/motion-user
> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Tue, 24 Nov 2015 11:27:41 +0100
From: folkert <[email protected]>
Subject: [Motion-user] ffmpeg 5.6 & motion
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi,

To get motion compile with ffmpeg 5.6 I had to make a couple of changes:

Index: ffmpeg.c
===================================================================
--- ffmpeg.c    (revision 564)
+++ ffmpeg.c    (working copy)
@@ -374,7 +374,7 @@
 #endif
         /* Manually override the codec id. */
         if (of)
-            of->video_codec = CODEC_ID_MSMPEG4V2;
+            of->video_codec = AV_CODEC_ID_MSMPEG4V2;
 
     } else if (strcmp(codec, "swf") == 0) {
         ext = ".swf";
@@ -390,7 +390,7 @@
 #else        
         of = av_guess_format("flv", NULL, NULL);
 #endif        
-        of->video_codec = CODEC_ID_FLV1;
+        of->video_codec = AV_CODEC_ID_FLV1;
     } else if (strcmp(codec, "ffv1") == 0) {
         ext = ".avi";
 #ifdef GUESS_NO_DEPRECATED
@@ -403,7 +403,7 @@
          * Requires strict_std_compliance to be <= -2
          */
         if (of)
-            of->video_codec = CODEC_ID_FFV1;
+            of->video_codec = AV_CODEC_ID_FFV1;
 
     } else if (strcmp(codec, "mov") == 0) {
         ext = ".mov";
@@ -499,7 +499,7 @@
 
     /* Create a new video stream and initialize the codecs. */
     ffmpeg->video_st = NULL;
-    if (ffmpeg->oc->oformat->video_codec != CODEC_ID_NONE) {
+    if (ffmpeg->oc->oformat->video_codec != AV_CODEC_ID_NONE) {
 #if defined FF_API_NEW_AVIO 
         ffmpeg->video_st = avformat_new_stream(ffmpeg->oc, NULL /* Codec */);
 #else
@@ -526,7 +526,7 @@
 #else
     c->codec_type = AVMEDIA_TYPE_VIDEO;
 #endif    
-    is_mpeg1      = c->codec_id == CODEC_ID_MPEG1VIDEO;
+    is_mpeg1      = c->codec_id == AV_CODEC_ID_MPEG1VIDEO;
 
     if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
         c->strict_std_compliance = -2;


Folkert van Heusden

-- 
Curious about the inner workings of your car? Then check O2OO: it'll
tell you all that there is to know about your car's engine!
http://www.vanheusden.com/O2OO/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



------------------------------

Message: 3
Date: Tue, 24 Nov 2015 11:35:37 +0100
From: folkert <[email protected]>
Subject: [Motion-user] text location
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi,

I've changed the timestamp/generic code a bit so that you can not only
put them bottom-left/right but also at the top.

Index: conf.c
===================================================================
--- conf.c      (revision 564)
+++ conf.c      (working copy)
@@ -147,9 +147,10 @@
     netcam_proxy:                   NULL,
     netcam_tolerant_check:          0,
     text_changes:                   0,
-    text_left:                      NULL,
-    text_right:                     DEF_TIMESTAMP,
-    text_event:                     DEF_EVENTSTAMP,
+    timestamp:                      DEF_TIMESTAMP,
+    timestamp_location:             NULL,
+    generic_text:                   NULL,
+    generic_text_location:          NULL,
     text_double:                    0,
     despeckle_filter:               NULL,
     area_detect:                    NULL,
@@ -850,26 +851,44 @@
     print_string
     },
     {
-    "text_right",
+    "timestamp",
     "# Draws the timestamp using same options as C function strftime(3)\n"
     "# Default: %Y-%m-%d\\n%T = date in ISO format and time in 24 hour clock\n"
-    "# Text is placed in lower right corner",
+    "# Text is placed in lower right corner (default, override with 
timestamp_location)",
     0,
-    CONF_OFFSET(text_right),
+    CONF_OFFSET(timestamp),
     copy_string,
     print_string
     },
     {
-    "text_left",
+    "timestamp_location",
+    "# Where to place the timestamp-text. Can be upper-left, upper-right, 
bottom-left or bottom-right.\n"
+    "# Default: Not defined = bottom-right\n",
+    0,
+    CONF_OFFSET(timestamp_location),
+    copy_string,
+    print_string
+    },
+    {
+    "generic_text",
     "# Draw a user defined text on the images using same options as C function 
strftime(3)\n"
     "# Default: Not defined = no text\n"
-    "# Text is placed in lower left corner",
+    "# Text is placed in lower left corner (default, override with 
generic_text_location)",
     0,
-    CONF_OFFSET(text_left),
+    CONF_OFFSET(generic_text),
     copy_string,
     print_string
     },
-     {
+    {
+    "generic_text_location",
+    "# Where to place the generic text. Can be upper-left, upper-right, 
bottom-left or bottom-right.\n"
+    "# Default: Not defined = bottom-left\n",
+    0,
+    CONF_OFFSET(generic_text_location),
+    copy_string,
+    print_string
+    },
+    {
     "text_changes",
     "# Draw the number of changed pixed on the images (default: off)\n"
     "# Will normally be set to off except when you setup and adjust the motion 
settings\n"
@@ -1710,7 +1729,7 @@
                 /*
                  * If argument is in "" we will strip them off
                  * It is important that we can use "" so that we can use
-                 * leading spaces in text_left and text_right.
+                 * leading spaces in timestamp and generic_text.
                  */
                 if ((beg[0] == '"' && beg[strlen(beg)-1] == '"') ||
                     (beg[0] == '\'' && beg[strlen(beg)-1] == '\'')) {
Index: conf.h
===================================================================
--- conf.h      (revision 564)
+++ conf.h      (working copy)
@@ -124,8 +124,8 @@
     const char *netcam_proxy;
     unsigned int netcam_tolerant_check;
     int text_changes;
-    const char *text_left;
-    const char *text_right;
+    const char *timestamp, *timestamp_location;
+    const char *generic_text, *generic_text_location;
     const char *text_event;
     int text_double;
     const char *despeckle_filter;
Index: motion.c
===================================================================
--- motion.c    (revision 564)
+++ motion.c    (working copy)
@@ -1069,6 +1069,25 @@
     }
 }
 
+void format_and_draw_text_at_location(struct context *const cnt, const char 
*const text, const char *const location)
+{
+    int size_mul = cnt->conf.text_double ? 2 : 1;
+    char tmp[PATH_MAX];
+    mystrftime(cnt, tmp, sizeof(tmp), text, &cnt->current_image->timestamp_tm, 
NULL, 0);
+
+    if (strcasecmp(location, "bottom-left") == 0)
+        draw_text(cnt->current_image->image, 10, cnt->imgs.height - 10 * 
size_mul, cnt->imgs.width, tmp, cnt->conf.text_double);
+
+    else if (strcasecmp(location, "bottom-right") == 0)
+        draw_text(cnt->current_image->image, cnt->imgs.width - 10, 
cnt->imgs.height - 10 * size_mul, cnt->imgs.width, tmp, cnt->conf.text_double);
+
+    else if (strcasecmp(location, "upper-left") == 0)
+        draw_text(cnt->current_image->image, 10, 10, cnt->imgs.width, tmp, 
cnt->conf.text_double);
+
+    else if (strcasecmp(location, "upper-right") == 0)
+        draw_text(cnt->current_image->image, cnt->imgs.width - 10, 10, 
cnt->imgs.width, tmp, cnt->conf.text_double);
+}
+
 /**
  * motion_loop
  *
@@ -1721,24 +1740,13 @@
                           cnt->imgs.width, tmp, cnt->conf.text_double);
             }
 
-            /* Add text in lower left corner of the pictures */
-            if (cnt->conf.text_left) {
-                char tmp[PATH_MAX];
-                mystrftime(cnt, tmp, sizeof(tmp), cnt->conf.text_left, 
-                           &cnt->current_image->timestamp_tm, NULL, 0);
-                draw_text(cnt->current_image->image, 10, cnt->imgs.height - 10 
* text_size_factor, 
-                          cnt->imgs.width, tmp, cnt->conf.text_double);
-            }
+            /* Add generic text */
+            if (cnt->conf.generic_text)
+               format_and_draw_text_at_location(cnt, cnt->conf.generic_text, 
cnt->conf.generic_text_location);
 
-            /* Add text in lower right corner of the pictures */
-            if (cnt->conf.text_right) {
-                char tmp[PATH_MAX];
-                mystrftime(cnt, tmp, sizeof(tmp), cnt->conf.text_right, 
-                           &cnt->current_image->timestamp_tm, NULL, 0);
-                draw_text(cnt->current_image->image, cnt->imgs.width - 10, 
-                          cnt->imgs.height - 10 * text_size_factor,
-                          cnt->imgs.width, tmp, cnt->conf.text_double);
-            }
+            /* Add timestamp */
+            if (cnt->conf.timestamp)
+               format_and_draw_text_at_location(cnt, cnt->conf.timestamp, 
cnt->conf.timestamp_location);
 
 
         /***** MOTION LOOP - ACTIONS AND EVENT CONTROL SECTION *****/
Index: motion-dist.conf.in
===================================================================
--- motion-dist.conf.in (revision 564)
+++ motion-dist.conf.in (working copy)
@@ -369,14 +369,24 @@
 
 # Draws the timestamp using same options as C function strftime(3)
 # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
-# Text is placed in lower right corner
-text_right %Y-%m-%d\n%T-%q
+# Text is placed default in lower right corner. Change this with 
timestamp_location
+timestamp %Y-%m-%d\n%T-%q
 
+# Select where to place the "timestamp".
+# Default: Not defined = bottom-right
+# Can be bottom-left, bottom-right, upper-left, upper-right
+; timestamp bottom-right
+
 # Draw a user defined text on the images using same options as C function 
strftime(3)
 # Default: Not defined = no text
-# Text is placed in lower left corner
-; text_left CAMERA %t
+# Text is placed default in lower left corner. Change this with 
generic_text_location
+; generic_text CAMERA %t
 
+# Select where to place the "generic_text".
+# Default: Not defined = bottom-left
+# Can be bottom-left, bottom-right, upper-left, upper-right
+; generic_text_location bottom-left
+
 # Draw the number of changed pixed on the images (default: off)
 # Will normally be set to off except when you setup and adjust the motion 
settings
 # Text is placed in upper right corner


Folkert van Heusden

-- 
MultiTail cok yonlu kullanimli bir program, loglari okumak, verilen
kommandolari yerine getirebilen. Filter, renk verme, merge, 'diff-
view', vs.  http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



------------------------------

Message: 4
Date: Tue, 24 Nov 2015 12:48:59 +0200
From: tosiara <[email protected]>
Subject: Re: [Motion-user] ffmpeg 5.6 & motion
To: Motion discussion list <[email protected]>
Message-ID:
        <cachtdwtvege-b58lio6fhnyqxktklgk7az+m2a+wwbncueu...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Which motion version are you compiling?

On Tue, Nov 24, 2015 at 12:27 PM, folkert <[email protected]> wrote:

> Hi,
>
> To get motion compile with ffmpeg 5.6 I had to make a couple of changes:
>
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c    (revision 564)
> +++ ffmpeg.c    (working copy)
> @@ -374,7 +374,7 @@
>  #endif
>          /* Manually override the codec id. */
>          if (of)
> -            of->video_codec = CODEC_ID_MSMPEG4V2;
> +            of->video_codec = AV_CODEC_ID_MSMPEG4V2;
>
>      } else if (strcmp(codec, "swf") == 0) {
>          ext = ".swf";
> @@ -390,7 +390,7 @@
>  #else
>          of = av_guess_format("flv", NULL, NULL);
>  #endif
> -        of->video_codec = CODEC_ID_FLV1;
> +        of->video_codec = AV_CODEC_ID_FLV1;
>      } else if (strcmp(codec, "ffv1") == 0) {
>          ext = ".avi";
>  #ifdef GUESS_NO_DEPRECATED
> @@ -403,7 +403,7 @@
>           * Requires strict_std_compliance to be <= -2
>           */
>          if (of)
> -            of->video_codec = CODEC_ID_FFV1;
> +            of->video_codec = AV_CODEC_ID_FFV1;
>
>      } else if (strcmp(codec, "mov") == 0) {
>          ext = ".mov";
> @@ -499,7 +499,7 @@
>
>      /* Create a new video stream and initialize the codecs. */
>      ffmpeg->video_st = NULL;
> -    if (ffmpeg->oc->oformat->video_codec != CODEC_ID_NONE) {
> +    if (ffmpeg->oc->oformat->video_codec != AV_CODEC_ID_NONE) {
>  #if defined FF_API_NEW_AVIO
>          ffmpeg->video_st = avformat_new_stream(ffmpeg->oc, NULL /* Codec
> */);
>  #else
> @@ -526,7 +526,7 @@
>  #else
>      c->codec_type = AVMEDIA_TYPE_VIDEO;
>  #endif
> -    is_mpeg1      = c->codec_id == CODEC_ID_MPEG1VIDEO;
> +    is_mpeg1      = c->codec_id == AV_CODEC_ID_MPEG1VIDEO;
>
>      if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
>          c->strict_std_compliance = -2;
>
>
> Folkert van Heusden
>
> --
> Curious about the inner workings of your car? Then check O2OO: it'll
> tell you all that there is to know about your car's engine!
> http://www.vanheusden.com/O2OO/
> ----------------------------------------------------------------------
> Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Motion-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/motion-user
> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140

------------------------------

_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user


End of Motion-user Digest, Vol 114, Issue 3
*******************************************

Reply via email to