1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021
|
<h1><a name="Motion_Guide_One_Large_Document"></a> Motion Guide - One Large Document. </h1>
This version of the Guide is made for inclusion in the Motion download package for off line reading.
<p />
If you read this document from the distribution package of Motion or from some not up to date mirror you should know that the URL for the always up to date version is <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide" target="_top">http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide</a>. If you are already on the Foswiki based Motion site clicking the link just mentioned will lead you to the index page for the Motion Guide documents.
<hr />
This topic consists of the following subtopics:
<a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOverview">MotionOverview</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/KnownProblems">KnownProblems</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/InstallOverview">InstallOverview</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/PrepareInstall">PrepareInstall</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigureScript">ConfigureScript</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MakeInstall">MakeInstall</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/UpgradingFromOlderVersion">UpgradingFromOlderVersion</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RunningMotionConfigFiles">RunningMotionConfigFiles</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CommandLineOptions">CommandLineOptions</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions">ConfigFileOptions</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/SignalsKill">SignalsKill</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ErrorLogging">ErrorLogging</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CaptureDeviceOptions">CaptureDeviceOptions</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionDetectionSettings">MotionDetectionSettings</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ImageFileOutput">ImageFileOutput</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TuningMotion">TuningMotion</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MpegFilmsFFmpeg">MpegFilmsFFmpeg</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/SnapshotsWebCam">SnapshotsWebCam</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TextFeatures">TextFeatures</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/AdvancedFilenames">AdvancedFilenames</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebcamServer">WebcamServer</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RemoteControlHttp">RemoteControlHttp</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ExternalCommands">ExternalCommands</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TrackingControl">TrackingControl</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/UsingDatabases">UsingDatabases</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/LoopbackDevice">LoopbackDevice</a>.
<hr />
<p />
<a name="foswikiTOC"></a><div class="foswikiToc"> <ul>
<li> <a href="#Motion_Guide_Installation"> Motion Guide - Installation</a> <ul>
<li> <a href="#Motion_Overview"> Motion Overview</a> <ul>
<li> <a href="#What_is_Motion"> What is Motion?</a>
</li> <li> <a href="#How_do_I_get_Motion_and_what_doe"> How do I get Motion and what does it cost?</a>
</li> <li> <a href="#Maintenance_and_Support"> Maintenance and Support</a>
</li> <li> <a href="#Which_version_to_download_and_us"> Which version to download and use?</a>
</li> <li> <a href="#What_features_does_Motion_have"> What features does Motion have?</a>
</li> <li> <a href="#FreeBSD"> FreeBSD</a>
</li> <li> <a href="#MacOSX"> MacOSX</a>
</li> <li> <a href="#Documentation"> Documentation</a>
</li> <li> <a href="#Supported_Hardware"> Supported Hardware</a>
</li></ul>
</li> <li> <a href="#Known_Problems"> Known Problems</a>
</li> <li> <a href="#How_do_I_install_Motion"> How do I install Motion?</a>
</li> <li> <a href="#Preparation_For_Install"> Preparation For Install</a>
</li> <li> <a href="#Configure_Script"> Configure Script</a>
</li> <li> <a href="#Make"> Make</a> <ul>
<li> <a href="#Make_Install"> Make Install</a>
</li> <li> <a href="#Un_install"> Un-install</a>
</li> <li> <a href="#Additional_Make_Options"> Additional Make Options</a>
</li></ul>
</li> <li> <a href="#Upgrading_From_Older_Version"> Upgrading From Older Version</a>
</li> <li> <a href="#Running_Motion"> Running Motion</a> <ul>
<li> <a href="#Important_Definitions"> Important Definitions</a>
</li> <li> <a href="#The_Config_Files"> The Config Files</a>
</li></ul>
</li> <li> <a href="#Command_Line_Options"> Command Line Options</a>
</li> <li> <a href="#Config_File_Options"> Config File Options</a> <ul>
<li> <a href="#Options_in_Alphabetical_Order"> Options in Alphabetical Order.</a>
</li> <li> <a href="#Obsolete_Options"> Obsolete Options</a>
</li></ul>
</li> <li> <a href="#Signals_sent_with_e_g_kill_comma"> Signals (sent with e.g. kill command)</a>
</li> <li> <a href="#Error_Logging"> Error Logging</a>
</li></ul>
</li> <li> <a href="#Motion_Guide_Basic_Features"> Motion Guide - Basic Features</a> <ul>
<li> <a href="#Capture_Device_Options_The_Basic"> Capture Device Options - The Basic Setup</a>
</li> <li> <a href="#video4linux_V4L_devices"> video4linux (V4L) devices</a> <ul>
<li> <a href="#auto_brightness"> auto_brightness</a>
</li> <li> <a href="#brightness"> brightness</a>
</li> <li> <a href="#contrast"> contrast</a>
</li> <li> <a href="#framerate"> framerate</a>
</li> <li> <a href="#frequency"> frequency</a>
</li> <li> <a href="#height"> height </a>
</li> <li> <a href="#hue"> hue</a>
</li> <li> <a href="#input"> input </a>
</li> <li> <a href="#minimum_frame_time"> minimum_frame_time</a>
</li> <li> <a href="#norm"> norm</a>
</li> <li> <a href="#rotate"> rotate</a>
</li> <li> <a href="#saturation"> saturation</a>
</li> <li> <a href="#tunerdevice"> tunerdevice</a>
</li> <li> <a href="#v4l2_palette"> v4l2_palette</a>
</li> <li> <a href="#videodevice"> videodevice</a>
</li> <li> <a href="#width"> width</a>
</li></ul>
</li> <li> <a href="#Network_Cameras"> Network Cameras</a> <ul>
<li> <a href="#netcam_http"> netcam_http</a>
</li> <li> <a href="#netcam_proxy"> netcam_proxy</a>
</li> <li> <a href="#netcam_tolerant_check"> netcam_tolerant_check</a>
</li> <li> <a href="#netcam_url"> netcam_url</a>
</li> <li> <a href="#netcam_userpass"> netcam_userpass</a>
</li></ul>
</li> <li> <a href="#Round_Robin_feature"> Round Robin feature</a> <ul>
<li> <a href="#roundrobin_frames"> roundrobin_frames</a>
</li> <li> <a href="#roundrobin_skip"> roundrobin_skip</a>
</li> <li> <a href="#switchfilter"> switchfilter</a>
</li></ul>
</li> <li> <a href="#Motion_Detection_Settings"> Motion Detection Settings</a> <ul>
<li> <a href="#area_detect"> area_detect</a>
</li> <li> <a href="#despeckle"> despeckle</a>
</li> <li> <a href="#gap"> gap</a>
</li> <li> <a href="#lightswitch"> lightswitch </a>
</li> <li> <a href="#mask_file"> mask_file</a>
</li> <li> <a href="#max_mpeg_time"> max_mpeg_time</a>
</li> <li> <a href="#minimum_motion_frames"> minimum_motion_frames</a>
</li> <li> <a href="#noise_level"> noise_level</a>
</li> <li> <a href="#noise_tune"> noise_tune</a>
</li> <li> <a href="#output_all"> output_all</a>
</li> <li> <a href="#post_capture"> post_capture</a>
</li> <li> <a href="#pre_capture"> pre_capture</a>
</li> <li> <a href="#smart_mask_speed"> smart_mask_speed</a>
</li> <li> <a href="#threshold"> threshold</a>
</li> <li> <a href="#threshold_tune"> threshold_tune</a>
</li></ul>
</li> <li> <a href="#Image_File_Output"> Image File Output</a> <ul>
<li> <a href="#output_motion"> output_motion</a>
</li> <li> <a href="#output_normal"> output_normal</a>
</li> <li> <a href="#ppm"> ppm</a>
</li> <li> <a href="#quality"> quality</a>
</li></ul>
</li> <li> <a href="#Tuning_Motion"> Tuning Motion</a>
</li> <li> <a href="#Generating_MPEG_films_with_ffmpe"> Generating MPEG films with ffmpeg</a> <ul>
<li> <a href="#ffmpeg_bps"> ffmpeg_bps</a>
</li> <li> <a href="#ffmpeg_cap_motion"> ffmpeg_cap_motion</a>
</li> <li> <a href="#ffmpeg_cap_new"> ffmpeg_cap_new</a>
</li> <li> <a href="#ffmpeg_deinterlace"> ffmpeg_deinterlace</a>
</li> <li> <a href="#ffmpeg_timelapse"> ffmpeg_timelapse</a>
</li> <li> <a href="#ffmpeg_timelapse_mode"> ffmpeg_timelapse_mode</a>
</li> <li> <a href="#ffmpeg_variable_bitrate"> ffmpeg_variable_bitrate</a>
</li> <li> <a href="#ffmpeg_video_codec"> ffmpeg_video_codec</a>
</li></ul>
</li> <li> <a href="#Snapshots_The_Traditional_Period"> Snapshots - The Traditional Periodic Web Camera</a> <ul>
<li> <a href="#snapshot_interval"> snapshot_interval</a>
</li></ul>
</li> <li> <a href="#Text_Features"> Text Features</a> <ul>
<li> <a href="#locate"> locate</a>
</li> <li> <a href="#text_changes"> text_changes</a>
</li> <li> <a href="#text_double"> text_double</a>
</li> <li> <a href="#text_event"> text_event</a>
</li> <li> <a href="#text_left"> text_left</a>
</li> <li> <a href="#text_right"> text_right</a>
</li></ul>
</li> <li> <a href="#Advanced_Filenames"> Advanced Filenames</a> <ul>
<li> <a href="#ffmpeg_filename_now_called_movie"> ffmpeg_filename (now called movie_filename)</a>
</li> <li> <a href="#jpeg_filename"> jpeg_filename</a>
</li> <li> <a href="#movie_filename"> movie_filename</a>
</li> <li> <a href="#snapshot_filename"> snapshot_filename</a>
</li> <li> <a href="#target_dir"> target_dir</a>
</li> <li> <a href="#timelapse_filename"> timelapse_filename</a>
</li></ul>
</li> <li> <a href="#Conversion_Specifiers_for_Advanc"> Conversion Specifiers for Advanced Filename and Text Features</a>
</li> <li> <a href="#Webcam_Server"> Webcam Server</a> <ul>
<li> <a href="#webcam_limit"> webcam_limit</a>
</li> <li> <a href="#webcam_localhost"> webcam_localhost</a>
</li> <li> <a href="#webcam_maxrate"> webcam_maxrate</a>
</li> <li> <a href="#webcam_motion"> webcam_motion</a>
</li> <li> <a href="#webcam_port"> webcam_port</a>
</li> <li> <a href="#webcam_quality"> webcam_quality</a>
</li></ul>
</li> <li> <a href="#Remote_Control_with_http"> Remote Control with http</a> <ul>
<li> <a href="#control_authentication"> control_authentication</a>
</li> <li> <a href="#control_html_output"> control_html_output</a>
</li> <li> <a href="#control_localhost"> control_localhost</a>
</li> <li> <a href="#control_port"> control_port</a>
</li></ul>
</li> <li> <a href="#External_Commands"> External Commands</a> <ul>
<li> <a href="#on_area_detected"> on_area_detected</a>
</li> <li> <a href="#on_camera_lost"> on_camera_lost</a>
</li> <li> <a href="#on_event_end"> on_event_end</a>
</li> <li> <a href="#on_event_start"> on_event_start</a>
</li> <li> <a href="#on_motion_detected"> on_motion_detected</a>
</li> <li> <a href="#on_movie_end"> on_movie_end</a>
</li> <li> <a href="#on_movie_start"> on_movie_start</a>
</li> <li> <a href="#on_picture_save"> on_picture_save</a>
</li> <li> <a href="#quiet"> quiet</a>
</li> <li> <a href="#What_happened_to_mail_and_sms"> What happened to mail and sms?</a> <ul>
<li> <a href="#Sending_email_at_start_of_event"> Sending email at start of event</a>
</li> <li> <a href="#Sending_SMS_at_start_of_event"> Sending SMS at start of event</a>
</li></ul>
</li></ul>
</li></ul>
</li> <li> <a href="#Motion_Guide_Special_Features"> Motion Guide - Special Features</a> <ul>
<li> <a href="#Tracking_Control"> Tracking Control</a> <ul>
<li> <a href="#Tracking_Feature_with_Logitech_Q"> Tracking Feature with Logitech Quickcam Sphere/Orbit</a>
</li> <li> <a href="#track_auto"> track_auto</a>
</li> <li> <a href="#track_iomojo_id"> track_iomojo_id</a>
</li> <li> <a href="#track_maxx"> track_maxx</a>
</li> <li> <a href="#track_maxy"> track_maxy</a>
</li> <li> <a href="#track_motorx"> track_motorx</a>
</li> <li> <a href="#track_motory"> track_motory</a>
</li> <li> <a href="#track_move_wait"> track_move_wait</a>
</li> <li> <a href="#track_port"> track_port</a>
</li> <li> <a href="#track_speed"> track_speed</a>
</li> <li> <a href="#track_step_angle_x"> track_step_angle_x</a>
</li> <li> <a href="#track_step_angle_y"> track_step_angle_y</a>
</li> <li> <a href="#track_stepsize"> track_stepsize</a>
</li> <li> <a href="#track_type"> track_type</a>
</li></ul>
</li> <li> <a href="#Using_Databases"> Using Databases</a> <ul>
<li> <a href="#sql_log_image"> sql_log_image</a>
</li> <li> <a href="#sql_log_mpeg"> sql_log_mpeg</a>
</li> <li> <a href="#sql_log_snapshot"> sql_log_snapshot</a>
</li> <li> <a href="#sql_log_timelapse"> sql_log_timelapse</a>
</li> <li> <a href="#sql_query"> sql_query</a>
</li></ul>
</li> <li> <a href="#MySQL"> MySQL</a> <ul>
<li> <a href="#mysql_db"> mysql_db</a>
</li> <li> <a href="#mysql_host"> mysql_host</a>
</li> <li> <a href="#mysql_password"> mysql_password</a>
</li> <li> <a href="#mysql_user"> mysql_user</a>
</li></ul>
</li> <li> <a href="#PostgreSQL"> PostgreSQL</a> <ul>
<li> <a href="#pgsql_db"> pgsql_db</a>
</li> <li> <a href="#pgsql_host"> pgsql_host</a>
</li> <li> <a href="#pgsql_password"> pgsql_password</a>
</li> <li> <a href="#pgsql_port"> pgsql_port</a>
</li> <li> <a href="#pgsql_user"> pgsql_user</a>
</li></ul>
</li> <li> <a href="#Video4Linux_Loopback_Device"> Video4Linux Loopback Device</a> <ul>
<li> <a href="#motion_video_pipe"> motion_video_pipe</a>
</li> <li> <a href="#video_pipe"> video_pipe</a>
</li></ul>
</li></ul>
</li></ul>
</div>
<p />
<h1><a name="Motion_Guide_Installation"></a> Motion Guide - Installation </h1>
<p />
<h2><a name="Motion_Overview"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOverview">Motion Overview</a> </h2>
<p />
<h3><a name="What_is_Motion"></a> What is Motion? </h3>
Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed. Or in other words, it can detect motion.
<p />
The program is written in C and is made for the Linux operating system.
<p />
Motion is a command line based tool. It has absolutely no graphical user interface. Everything is setup either via the command line or via a set of configuration files (simple ASCII files that can be edited by any ASCII editor).
<p />
The output from motion can be:
<p /> <ul>
<li> jpg files
</li> <li> ppm format files
</li> <li> mpeg video sequences
</li></ul>
<p />
<h3><a name="How_do_I_get_Motion_and_what_doe"></a> How do I get Motion and what does it cost? </h3>
Motion is an open source type of project. It does not cost anything. Motion is published under the <a href="http://www.gnu.org/licenses/gpl.html" rel="nofollow" target="_top">GNU GENERAL PUBLIC LICENSE</a> (GPL) version 2 or later. It may be a bit difficult to understand all the details of the license text (especially if your first language is not English). It means that you can get the program, install it and use it freely. You do not have to pay anything and you do not have to register anywhere or ask the author or publisher for permission. The GPL gives you both rights and some very reasonable duties when it comes to copying, distribution and modification of the program. So in very general terms you do not have to worry about licensing as a normal hobby user. If you want to use Motion in a commercial product, if you want to distribute either modified or original versions of Motion - for free or for a fee, you should read the license carefully. For more information about free software and the GPL, I encourage you to study the very interesting documents about the subject available the of the Free Software Foundation pages about the <a href="http://www.gnu.org/philosophy/philosophy.html" rel="nofollow" target="_top">Philosophy of the GNU Project</a>.
<p />
<h3><a name="Maintenance_and_Support"></a> Maintenance and Support </h3>
Both Motion and the Motion Guide are written by people that do all this as a hobby and without asking for any payments or donations. We have a life other than developing Motion and its documentation. This means that bugfixes and updates to this guide are done as our time and families allow it. You are however encouraged to participate and contribute in a very active <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MailingList">mailing list</a>. It is a list with a very "positive attitude" and with many contributors that propose features, post patches, discuss problems and patiently answer newbie questions with a very positive spirit. Expect 1-10 emails per day.
<p />
To get motion direct your browser to the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome" class="foswikiCurrentWebHomeLink">Motion Homepage</a>.
<p />
On the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/DownloadFiles">Download Files</a> page you will find a links to the latest stable version both as sources and binaries for some of the most popular Linux distributions. You will also find links to development versions. Snapshot releases are special test releases that are normally very stable. Every day a <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionDailySourceSnap">Motion Daily Source Snap</a> is created from the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionSubversion">Motion Subversion</a>
<p />
Motion was originally written by Jeroen Vreeken who still actively participates in the development of Motion and later Folkert van Heusden continued as a lead programmer with Kenneth Lavrsen responsible for Motion Guide, website and releases on Sourceforge.
<p />
From version 3.1.12 Motion is now project managed entirely by Kenneth Lavrsen, and the project now shift towards being developed by many contributers.
<p />
For support we encourage you to join the mailing list instead of writing to Jeroen, Folkert or Kenneth directly. We are all very active on the mailing list and by using the mailing list much more users will have benefit of the answers. Newbies and stupid questions are welcome on the list. Contributions in the form of patches are also very welcome on the mailing list.
<p />
<h3><a name="Which_version_to_download_and_us"></a> Which version to download and use? </h3>
Versions 3.2.X are the current version. There is at the moment no development branch. The versions 3.1.X ended at 3.1.20 and there will be no more 3.1.X releases. If you use use a version older than 3.2.X you are encouraged to update.
<p />
Since 3.1.13 quite many options have been renamed to make setting up Motion easier. From 3.1.17-18 some unfinished features have been removed. The Berkeley mpeg feature is now removed because the ffmpeg feature is now mature and much better working. At version 3.1.18 a new network camera feature was introduced replacing the old cURL based netcam code and introducing support of mjpeg streaming cameras. However this new code was quite difficult to get stable. During the development of 3.2.2 the network camera code was totally rewritten again learning from our experience and now finally it seems to be stable.
<p />
Motion is included in Debian, while Ubuntu and RPM users can find binary packages on the Motion Sourceforge file download page.
<p />
<h3><a name="What_features_does_Motion_have"></a> What features does Motion have? </h3>
See more description at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome" class="foswikiCurrentWebHomeLink">Motion Homepage</a>. <ul>
<li> Taking snapshots of movement
</li> <li> Watch multiple video devices at the same time
</li> <li> Watch multiple inputs on one capture card at the same time
</li> <li> Live streaming webcam (using multipart/x-mixed-replace)
</li> <li> Real time creation of mpeg movies using libraries from ffmpeg
</li> <li> Take automated snapshots on regular intervals
</li> <li> Take automated snapshots at irregular intervals using cron
</li> <li> Executing external program when detecting movement
</li> <li> Execute external program at the beginning of an event of several motion detections.
</li> <li> Execute external program at the end of an event of several motion detections.
</li> <li> Execute external program when a picture is saved.
</li> <li> Execute external program when a movie mpeg is created (opened)
</li> <li> Execite external program when a movie mpeg ends (closed)
</li> <li> Motion tracking
</li> <li> Feed events to an MySQL or PostgreSQL database.
</li> <li> Feed video back to a video4linux loopback for real time viewing
</li> <li> Web interface using <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RelatedProjects">Motion Related Projects</a> such as <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionCGI">motion.cgi</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/KennethsWebcamPackage">Kenneths Webcam Package</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/KevinsWebpage">Kevins Webpage</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/XMotionTool">X-Motion</a> and many more.
</li> <li> User configurable and user defined on screen display.
</li> <li> Control via simple web interface.
</li> <li> Automatic noise and threshold control
</li> <li> Ability to control the pan/tilt of a Logitech Sphere (or Orbit) camera
</li> <li> Highly configurable display of text on images.
</li> <li> High configurable definition of path and file names of the stored images and films.
</li></ul>
<p />
You can find more information and links at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome" target="_top">Motion Homepage</a>.
<p />
<h3><a name="FreeBSD"></a> FreeBSD </h3>
<p />
Motion is originally developed for Linux and it is still mainly developed and supported for this platform. From version 3.1.15 an experimental port has been made by Angel Carpintero. Not all features of Motion are supported at this time and it still needs a lot of test time on different hardware. Angel is very interested in feedback. Join the Motion Mailing List and give your feedback there. Patches for bugfixes and for enabling the missing features are very welcome. The rest of this guide is still mainly targeted for Linux users. Follow this topic to <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD" target="_top">Install FreeBSD</a>.
<p />
<h3><a name="MacOSX"></a> MacOSX </h3>
<p />
From Motion version 3.2.4 it is now also possible to build and install Motion under <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MacOSX">MacOSX</a>. Feature set it the same as for FreeBSD. See the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MacOSX">MacOSX</a> topic for specific help how to install Motion and its dependencies on <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MacOSX">MacOSX</a>. Again this port has been contributed by Angel Carpintero.
<p />
<h3><a name="Documentation"></a> Documentation </h3>
You have the following sources of information:
<p /> <ul>
<li> This <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide">Motion Guide</a>.
</li> <li> The <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FrequentlyAskedQuestions">Frequently Asked Questions</a>
</li> <li> The author of the program has written a description of the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionTechnology">technology behind motion</a>.
</li> <li> The man page. After installation simply write man motion
</li> <li> The default motion.conf file (motion-dist.conf) that comes with the package.
</li></ul>
<p />
<h3><a name="Supported_Hardware"></a> Supported Hardware </h3>
Input devices: Here we are thinking about the cameras.
<p />
Motion supports video input from two kinds of sources.
<p />
Standard video4linux devices (e.g. /dev/video0). Motion has no drivers for cameras. Installing the camera itself is outside the scope of this document. But here are some nice links. <ul>
<li> <a href="http://www.saillard.org/pwc/" rel="nofollow" target="_top">Driver for USB Philips cameras (and more)</a> This driver is a fork of the old pcw(x) driver which got kicked out of the kernel. (see: <a href="http://www.smcc.demon.nl/webcam/" rel="nofollow" target="_top">http://www.smcc.demon.nl/webcam/</a>). See also the new <a href="http://www.lavrsen.dk/foswiki/bin/view/PWC/WebHome">PWC Documentation Site</a> which is hosted in this wiki.
</li> <li> <a href="http://bytesex.org/bttv/index.html" rel="nofollow" target="_top">BTTV Driver</a> (capture cards). Part of many distributions now.
</li> <li> <a href="http://alpha.dyndns.org/ov511/" rel="nofollow" target="_top">OV511</a> based USB cameras are supported as standard by newer Kernels.
</li> <li> <a href="http://spca50x.sourceforge.net/spca50x.php" rel="nofollow" target="_top">kernel driver for USB cameras based on Sunplus spca50</a>
</li> <li> <a href="http://rivatv.sourceforge.net/" rel="nofollow" target="_top">rivatv.sourceforge.net</a> Driver for tv/composite/svideo input with most Nvidia based video cards. Network cameras (which are actually cameras with a built in web server that can be connected directory to your network).
</li> <li> <a href="http://www.axis.com/" rel="nofollow" target="_top">Axis Communications</a>
</li></ul>
<p />
<p />
<h2><a name="Known_Problems"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/KnownProblems">Known Problems</a> </h2>
See also the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FrequentlyAskedQuestions">Frequently Asked Questions</a> and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReports">Bug Reports</a> for known open bugs.
<p />
<strong>Kernel 2.6 and pwc.</strong> Note that for kernel 2.6 there is a new release of the Philips WebCam (pwc) drivers 10.0.X. It is recommended to install this. At the time of this being written the 2.6.12+ kernels have a version of pwc built-in but it is a cripled version which can only support very small picture size. You can however download the latest source code of the pwc driver (at this time 10.0.11) and build it without having to rebuild your kernel. But you will need to have either the kernel sources or a special kernel-header package installed to compile it. See <a href="http://www.lavrsen.dk/foswiki/bin/view/PWC/InstallationOfPWC">Installation of PWC</a> page which is also hosted in this wiki.
<p />
If you use use a <strong>Logitech Quickcam Orbit or Sphere</strong> using the driver pwc/pwcx and kernel 2.6.X you should replace the file in the Motion sources called pwc-ioctl.h with the one that comes with the your pwc version. Motion is shipped with 3 versions of pwc-ioctl.h-VERSION. Rename the one that fits your major pwc version number best to pwc-ioctl.h (after renaming the current to something else). There has been some small adjustments in the API that requires that you have the right header file.
<p />
<strong>Camera picture dimensions must be multiple of 16</strong>
Dimentions of camera image must have both height and width that are a multiple of 16. Ths is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.
<p />
<strong>ffmpeg_filename has changed name to movie_filename</strong>
The 3.2.5 release contains a motion_guide and man page in which it was forgotten to change ffmpeg_filename to movie_filename. Please note that the option that defines the filenames for mpeg movies is now called movie_filename. This change is made because we may soon implement alternatives to ffmpeg and then ffmpeg_filename will be a bad name. This is fixed in release 3.2.5.1.
<p />
<strong>error: `time_current_frame' undeclared (first use in this function)</strong>
A bug in 3.2.5 and 3.2.5.1 where a bugfix related to snapshot feature has created a new bug when you compile Motion without ffmpeg libs installed. This is fixed in 3.2.6.
<p />
<p />
<p />
<h2><a name="How_do_I_install_Motion"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/InstallOverview">How do I install Motion</a>? </h2>
Motion is mainly distributed as source files that you must compile yourself. There is also an RPM made on Fedora Core 3. And Debian packages are available for selected versions.
<p />
The short overview of the steps to install Motion from sources. <ul>
<li> <strong>Preparation</strong>: Motion uses a number of shared libraries that must be installed on your computer before you can build Motion. The needed shared libraries depends on the features you wish to use. Features network camera, ffmpeg, MySQL and PostgreSQL needs specific shared libraries installed. See preparation section for more information.
</li></ul>
<p /> <ul>
<li> <strong>Download</strong> the motion source files (distributed as tar'ed and compressed files). Place the file in a place of your own choice.
</li></ul>
<p /> <ul>
<li> <strong>Untar and uncompress</strong> the file to the place you want the program installed. Editor recommends placing the motion source file directory in /usr/local. If you do not have write access to the /usr/local directory (you are under the mercy of an ignorant system administrator with a severe case of paranoia) - you can install the program in a directory in your home directory. You will then need to read the next section about how to configure before you compile the program. Below is shown the exact commands using version 3.2.X installed in /usr/local as an example (replace /path/to with the actual placement of the tar.gz file).
</li></ul>
<UL>
<pre>
cd /usr/local
tar -xvzf /path/to/motion-3.2.X.tar.gz
</pre>
</UL> <ul>
<li> You will now have created a directory called motion-3.2.X. You can rename it to motion (mv motion-3.1.X motion). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different version simply by changing the link.
</li></ul>
<UL>
<pre>
ln -s motion-3.2.X motion
</pre>
</UL> <ul>
<li> Now change to the new directory
</li></ul>
<UL>
<pre>
cd motion
</pre>
</UL> <ul>
<li> Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
</li></ul>
<UL>
<pre>
./configure
</pre>
</UL> <ul>
<li> Build the code
</li></ul>
<UL>
<pre>
make
</pre>
</UL> <ul>
<li> Install the code, manual page, etc
</li></ul>
<UL>
<pre>
make install
</pre>
</UL> <ul>
<li> In /etc/motion/etc you will find a file called motion-dist.conf. If it is the first time you install Motion - rename this file to <strong>motion.conf</strong> and edit as a minimum the settings: <strong>videodevice</strong>, <strong>input</strong>, <strong>norm</strong>, <strong>frequency</strong>, <strong>width</strong>, <strong>height</strong> and <strong>target_dir</strong>. That should get you going.
</li></ul>
<p /> <ul>
<li> Run the program. To enable more features you must modify the config file.
</li></ul>
<UL>
<pre>
motion
</pre>
</UL>
<p />
<p />
<h2><a name="Preparation_For_Install"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/PrepareInstall">Preparation For Install</a> </h2>
<p />
Note: If you're using SuSE 9.2, you might want to <strong>ADDITIONALLY</strong> have a look at <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/SuSE92Prep">Compiling on SuSE 9.2</a>. As mentioned on that page as well, <em>you will still need to read the instructions here as well</em>.
<p />
Before you start you may need to install a number of shared libraries that Motion uses. If they are missing the feature will simply normally not be included. Most of these libraries can be found on the CDs of your distribution. A few will have to be downloaded from the Internet. Note that when you install software using pre-compiled binaries (Redhat type RPMs, Debian debs etc) you normally only get what is needed to run the programs themselves. In order to compile other programs from source that uses these pre-compiled libraries you also need to installed the development packages. These are normally called the same name as the package suffixed by -devel or -dev. These development packages contains the header files (xxx.h) that Motion needs to build with the shared libraries. If you build a library from sources you already have these header files. It is recommended to simply install the pre-compiled binary packages and their development brothers.
<p />
This is a list of shared libraries used by Motion and the RPM packages that provides them.
<p />
Motion will always need these libraries to be built and work
<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=1;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> libm, libresolv, libdl, libpthread, libc, ld-linux, libcrypt, and libnsl </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> glibc and glibc-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> libc6 , libc6-dev ,libglib1.2 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> libjpeg </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> libjpeg and libjpeg-devel </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> libjpeg62 and libjpeg62-dev ( optional libjpeg-mmx-dev ) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libz </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> zlib and zlib-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> zlib1g and zlib1g-dev </td>
</tr>
</tbody></table>
<p />
For generating mpeg films with <strong>ffmpeg</strong> you need this library:<br>
(See also the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MpegFilmsFFmpeg">Generating MPEG films with ffmpeg</a> for how to install ffmpeg and libavformat/libavcodec)<br>
<em>Motion must be installed with revision 0.4.8 or 0.4.9pre1 of ffmpeg. Motion will also work with later CVS snapshots of ffmpeg but the API of the ffmpeg libraries changes all the time and without warning. If you have problems compiling Motion or with running an RPM of Motion you may try with an older CVS snapshot of ffmpeg. The Motion developers will like to know when ffmpeg changes and breaks Motion so we can fix it. Please file a bug report then with the exact date of the ffmpeg CVS version you have trouble with.</em>
<p />
<table cellspacing="0" id="table2" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=2;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libavcodec, libavformat </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> ffmpeg and ffmpeg-devel or install from source </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libavcodec-dev libavcodec0d libavformat-dev libavformat0d (*) </td>
</tr>
</tbody></table>
<p />
<strong>Debian</strong> has not provided deb packages for ffmpeg due patent issues. However this is about to change so checkout for availability of newer versions of debian ffmpeg debs. You can build yourself from source or from <a href="http://debian-multimedia.org/" rel="nofollow" target="_top">Christian Marillat website</a> or apt repository.
<pre>
deb http://www.debian-multimedia.org stable main # ( etch )
deb http://www.debian-multimedia.org testing main # ( lenny )
deb http://www.debian-multimedia.org unstable main # ( sid )
</pre>
Add the suitable line to your /etc/apt/sources.list and run this:
<pre>
apt-get update ; apt-get -y install libavcodec-dev libavcodec0d libavformat-dev libavformat0d
</pre>
<p />
For logging in <strong>MySQL</strong> you need this library:
<table cellspacing="0" id="table3" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=3;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libmysqlclient </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> mysql and mysql-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libmysqlclient15-off and libmysqlclient15-dev </td>
</tr>
</tbody></table>
<p />
For logging in <strong>PostgreSQL</strong> you need this library:
<table cellspacing="0" id="table4" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Library</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">RPM Packages</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=4;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Debian Packages</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> libpq </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> postgresql-libs and postgresql-devel </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> libpq-dev and libpq4 </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Configure_Script"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigureScript">Configure Script</a> </h2>
Configure is script that you run to setup the build environment for the C-compiler. It generates the "Makefile" which the program "make" uses to compile and install the software.
<p />
To run configure your current directory must be the motion directory. You type
<p />
<code>./configure</code>
<p />
You can add the parameter <code>./configure --help</code> to get help on the different switches.
<p />
This is walk through of the options.
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/ConfigureScript#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?fd8fc4e77a93cc2c570a08a93d66e7dd' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table5" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Option</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff">Description <br /> Defaults for the options <br /> are specified in brackets [ ]</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff">Editors comment</font> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -h, --help </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> display this help and exit </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --help=short </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> display options specific to this package </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This command shows the options special to motion. Recommended </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --help=recursive </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> display the short help of all the included packages </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -V, --version </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> display version information and exit </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Gives no useful information </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -q, --quiet, --silent </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> do not print `checking...' messages </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not very useful. Output to screen is only a few lines anyway. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --cache-file=FILE </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> cache test results in FILE. [disabled] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> No function </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -C, --config-cach </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> alias for `--cache-file=config.cache' </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> No function </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -n, --no-create </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> do not create output files </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Used for testing if other switches produce error - without writing anything to the disk </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --srcdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> find the sources in DIR. [configure dir or `..'] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> DIR is a directory path. Editor recommends having the current directory being the motion installation directory and not using this switch. Then it defaults to the same directory as where the configure script is which is the current directory. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Installation directories:</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff"> </font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff"> </font> </th>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --prefix=PREFIX </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> install architecture-independent files in PREFIX <br /> [/usr/local] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The default /usr/local means that the executable binary "motion" is installed in /usr/local/bin, the manual page in /usr/local/man/man1, the document files in /usr/local/docs/motion-version, configuration file in /usr/local/etc, and some examples config files in /usr/local/examples/motion-versionEditor recommends keeping this default setting. <br /> If you are experimenting with many parallel versions it may be interesting to set the PREFIX to e.g. /usr/local/motion and then add /usr/local/motion/bin to your search path (or simply cd /usr/local/motion/bin before execution). <br /> This way you can change version just by changing the symbolic link in /usr/local/motion as suggested earlier in this guide. <br /> If you are installing the software on a machine where you have no access to the /usr/local but have write access to a home directory, then you should change this to point to a directory within your home tree. <br /> Example: --prefix=$HOME </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --exec-prefix=EPREFIX </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> install architecture-dependent files in EPREFIX <br /> [PREFIX] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> If you set this it only defines an alternative installation directory for the executable binary. <br /> Note: The executable binary will be placed in a directory "bin" below the directory specified by this option <br /> Editor recommends leaving this as default (i.e. not setting it). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --bindir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> user executables [EPREFIX/bin] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> With this option you can control exactly in which directory the executable binary is installed. The previous option automatically adds the bin directory. Here you are in fill control. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sbindir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> System admin executables [EPREFIX/sbin] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --libexecdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> program executables [EPREFIX/libexec] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --datadir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> read-only architecture-independent data [PREFIX/share] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sysconfdir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> read-only single-machine data [PREFIX/etc] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> This is where motion both installs the default configuration file and also where it later searches for it. <br /> Motion searches for the configuration file "motion.conf" in the following order: <br /> <UL> <br /> 1. Current directory from where motion was invoked <br /> 2. $HOME/.motion <br /> 3. The sysconfig directory set by this switch. If not defined the default is /usr/local/etc/ <br /> </UL> <br /> Editor recommends leaving this at default. Be careful if you run "make install" again. This will overwrite the motion.conf file that you have edited and experimented with for hours. Make sure to keep a copy in a safe place. Alternatively, copy the working file to the motion base install directory. Then make install will simply copy the same file back again. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --sharedstatedir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> modifiable architecture-independent data [PREFIX/com] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --localstatedir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> modifiable single-machine data [PREFIX/var] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --libdir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> object code libraries [EPREFIX/lib] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --includedir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> C header files [PREFIX/include] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --oldincludedir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> C header files for non-gcc [/usr/include] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --infodir=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> info documentation [PREFIX/info] </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Not used by motion. Ignore it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --mandir=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> man documentation [PREFIX/man] </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Editor recommends the default. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Optional Packages:</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff"> </font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff"> </font> </th>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-linuxthreads </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Use linuxthreads in BSD instead of native phtreads </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Only relevant for BSD. In Linux we always use this per default. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pwcbsd </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Use pwcbsd based webcams ( only BSD ) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This option allow to build motion to support <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L">V4L</a>/V4L2 in BSD. <br /> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/HowtoMotionPwcFreeBSD">HowtoMotionPwcFreeBSD</a> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-bktr </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Exclude to use bktr subsystem , that usually useful for devices as network cameras </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> ONLY used in *BSD </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-v4l </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Exclude using v4l (video4linux) subsystem. Makes Motion so it only supports network cameras. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Can be used if you do not need <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L">V4L</a> support and maybe lack some of the libraries for it. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-jpeg-mmx=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Specify the prefix for the install path for jpeg-mmx for optimized jpeg handling (optional). If this is not specified motion will try to find the library /usr/lib/libjpeg-mmx.a /usr/local/lib/libjpeg-mmx.a. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Considered experimental </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-ffmpeg=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Specify the path for the directory prefix in which the library and headers are installed. <br /> If not specified configure will search in /usr/ and /usr/local/ </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> DIR is the directory PREFIX in which the ffmpeg shared libraries and their headers are installed. <br /> If you install ffmpeg from sources and use the default directories or if ffmpeg is installed as a binary package (RPM or deb) you do not need to specify the directory prefix. Configure will find the libraries automatically. If you installed ffmpeg from sources and specified a different --prefix when building ffmpeg you must use the same value for the DIR ( --with-ffmpeg=DIR). <br /> For more information on FFmpeg see the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg project home page</a>. <br /> FFmpeg is a package that enables streamed video mpeg signal from your web camera to a browser. <br /> Editor recommends installing ffmpeg from source and in the directory /usr/local/ffmpeg and build ffmpeg with ./configure --enable-shared. <br /> This places libraries in /usr/local/lib and headers in /usr/local/include. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-ffmpeg </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Do not compile with ffmpeg </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this if you do not want to compile with ffmpeg. If ffmpeg is not installed you do not need to specify that Motion must build without ffmpeg. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-mysql-lib=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Lib directory of MySQL </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normally, configure will scan all possible default installation paths for MySQL libs. When its fail, use this command to tell configure where MySQL libs installation root directory is. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-mysql-include=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Include directory with headers for MySQL </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normally, configure will scan all possible default installation paths for MySQL include. When its fail, use this command to tell configure where MySQL include installation directory is. This is the directory with the MySQL header files. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-mysql </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Do not compile with MySQL support </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this if you do not want to include MySQL support in the package. <br /> This can also be useful if you get compilation errors related to MySQL and you actually do not need the feature anyway. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-pgsql </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Do not compile with PostgreSQL support </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this if you do not want to include PostgreSQL support in the package. <br /> This can also be useful if you get compilation errors related to PostgreSQL and you actually do not need the feature anyway. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pgsql-include=DIR </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Normally, configure will scan all possible default installation paths for pgsql include. When it fails, use this command to tell configure where pgsql include installation root directory is. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --with-pgsql-lib=DIR </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Normally, configure will scan all possible default installation paths for pgsql libs. When it fails, use <br /> this command to tell configure where pgsql libs installation root directory is. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="160" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> --without-optimizecpu </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this if the optimization causes problems. Typically if you build on some non X386 compatible CPU. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="160" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <font color="#ffffff">Developers options</font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <font color="#ffffff"> </font> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <font color="#ffffff"> </font> </th>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="160" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> --with-developer-flags </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Add additional warning flags for the compiler. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> This option is for developers only. It produces a flood of warnings that helps the developer to write more robust code. These warnings are normally harmless but can sometimes be a latent defect. <br /> For more information about these flags, see <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CompileWithDeveloperFlags">CompileWithDeveloperFlags</a> </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<h2><a name="Make"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MakeInstall">Make</a> </h2>
When you run make, all the C-source files are automatically compiled and linked. Just look out for error messages.
<p />
Make uses a file called "Makefile" which is generated by the "configure" script you just ran. If you have special needs you can manually edit this file. Next time you run configure a new Makefile will be generated and your changes are lost.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Attention!
<p />
If you have run <code>make</code> before, you should run a <code>make clean</code> before running <code>make</code> again. This cleans out all the object files that were generated the previous time you ran <code>make</code>. If you do not run <code>make clean</code> first before you rebuild Motion you may not get the additional feature included. For example: If you built Motion without ffmpeg support and then add it later - and rebuild Motion without running <code>make clean</code> first - the ffmpeg feature does not get compiled into the Motion binary.
<p />
First time you build motion run <code>./configure</code>, <code>make</code>, <code>make install</code>. If you need to build it again (to run with different configure options) run <code>./configure</code>, <code>make clean</code>, <code>make</code>, <code>make install</code>.
<p />
<h3><a name="Make_Install"></a> Make Install </h3>
<code>make install</code> simply copies all the nice files that were generated during the compilation/linking that make did.
<p />
Makes the directories (if they do not already exist)(path shown are the defaults): /usr/local/bin, usr/local/man/man1, /usr/local/etc, /usr/local/share/doc/motion-3.2.X, and /usr/local/share/doc/examples/motion-3.2.X.
<p />
Copies the following files from the base motion directory (assuming the default PREFIX /usr/local was used when running configure - otherwise adjust to the actuals you chose) <ul>
<li> Executable binary "motion" to /usr/local/bin
</li> <li> Manual page "motion.1" to /usr/local/man/man1
</li> <li> Document files "CHANGELOG, COPYING, CREDITS, INSTALL, and README to /usr/local/share/doc/motion-3.2.X
</li> <li> Example configuration files "*.conf" to /usr/local/share/doc/examples/motion-3.2.X
</li> <li> Configuration file "motion-dist.conf" to /usr/local/etc
</li></ul>
Note that the any existing files are overwritten. The default config file motion-dist.conf is named like this so that you do not get your working motion.conf file overwritten when you upgrade Motion.
<p />
<h3><a name="Un_install"></a> Un-install </h3>
From the motion base installation directory you simply run <code>make uninstall</code>
<p />
And delete the base installation directory in /usr/local and any link pointing to it. If you have forgotten where you installed it or someone else did it for you, simply search for the files and directories starting with motion. If the filenames and the directories match the names described in the "Make Install" section of this document, you can safely delete them.
<p />
<h3><a name="Additional_Make_Options"></a> Additional Make Options </h3>
The make command can be run with several options. <code>make</code>, <code>make install</code> and <code>make uninstall</code> has already been described above.
<p /> <dl>
<dt> <strong>make clean</strong> </dt><dd> deletes all the binary files (object files) and the motion binary generated by make. It also deletes temporary files and any jpg files that motion has saved in the motion source directory. It is very important to always run <code>make clean</code> before you run <code>make</code> if you change the configuration (like adding features such as ffmpeg) and rebuild motion.
</dd></dl>
<p /> <dl>
<dt> <strong>make distclean</strong> </dt><dd> deletes the files: config.status, config.log, config.cache, Makefile, and motion.spec.
</dd></dl>
<p /> <dl>
<dt> <strong>make updateguide</strong> </dt><dd> fetches a fresh new copy of this guide and place it in your motion source directory. Note that the pictures are not downloaded.
</dd></dl>
<p /> <dl>
<dt> <strong>make dist</strong> </dt><dd> performs make clean, make distclean and make updateguide in one single operation.
</dd></dl>
<p />
<p />
<h2><a name="Upgrading_From_Older_Version"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/UpgradingFromOlderVersion">Upgrading From Older Version</a> </h2>
If you are upgrading from motion 3.0.X or from an older version of 3.1.X you should note that many options have been removed from version 3.1.13 and forward and many new have arrived. You still have most of the old features. The options have been changed for two reasons. New more flexible features and to simplify getting started with Motion. With 3.2.1 the changes are significant. You should also note these major differences. <ul>
<li> The use of thread files has completely changed. Read the section "The Config Files" carefully.
</li> <li> The mask file format has changed. Read the section about "Mask File"
</li> <li> Pre_capture feature introduced in 3.1.12
</li> <li> Advanced filename feature enables very flexible filename definitions (3.1.13)
</li> <li> onffmpegclose options enables running external scripts when mpeg file is closed (3.1.13)
</li> <li> despeckle feature improves motion detection and noise immunity (3.1.13)
</li> <li> Minimum_motion_frames feature prevents short noise events from being saved (3.1.14)
</li> <li> If you use the database features you need to note that from version 3.1.15 and forward the fields have been redefined. Removed are second, minute, hour, day, month and year. Instead these six have been replaced by a real timestamp field called time_stamp. The relatively new field 'type' has been renamed to 'file_type' to avoid reserved SQL words. A new field 'text_left' has been added which stores the text given by the config option text_left. And last a field called 'camera' has been added which stores the thread number.
</li> <li> From 3.1.15 the ffmpeg feature now also supports mpeg4 and msmpeg4. The build process of Motion now use ffmpeg libraries as shared libraries. The --with-libavcodec has been replaced by a --with-ffmpeg which only needed to specify if you are installing ffmpeg from sources in a non-standard location. If you have installed ffmpeg from sources already you will need to rebuild by running (from within the ffmpeg source file root) ./configure --enable-shared followed by make and make install. If you had installed ffmpeg from a binary RPM or deb you probably don't have to do anything.
</li> <li> Rotate feature was introduced in 3.1.15
</li> <li> Berkeley mpeg feature has been removed in 3.1.18 (use ffmpeg - it is much better)
</li> <li> Incomplete prediction feature was removed in 3.1.18. (lack of interest in finishing it)
</li> <li> Smart Mask feature introduced in 3.1.18
</li> <li> output_normal can now also have the value "first" which means only save first jpg from each event (3.1.18)
</li> <li> ffmpeg-0.4.9 is now supported. Motion detection mpegs can no longer be saved as mpeg1 (ffmpeg does not support non-standard framerates in 0.4.9) (3.1.18)
</li> <li> Motion now supports most (not all) mjpeg streaming cameras (3.1.18).
</li> <li> output_normal can now have values "first" or "best". It is used when you need to present a link to an mpeg movie shown as a single jpeg image. "First" saves the first picture frame in the new event. "Best" saves the picture frame with most motion content (most changed pixels) when the event is over. "on" still saves all motion detection picture frames plus pre and post captured images. With "best" you can set jpeg_filename = "preview" and it gets the same filename as the mpeg file but with extension .jpg. Option "locate" can also take the value "preview" which makes it only draw a rectangel on the jpeg but not on the mpeg movie. (3.2.1)
</li> <li> The xmlrpc remote control interface is replaced by a much nicer http remote control interface. (3.2.1)
</li> <li> All the options that calls external programs have been made much more generic. New onxxxx options have been added. Execute, sms and mail have been replaced by the generic on_event_start. (3.2.1)
</li> <li> New setup mode makes setting all the detection options much easier.
</li> <li> netcam now also supports proxies (3.2.2) and ftp (3.2.4)
</li> <li> text on the pictures can be set to double size (3.2.2)
</li> <li> Tracking with Logitech Sphere/Orbit improved (3.2.4)
</li> <li> SQL database feature is now fully configurable so you can control which fields you have in the database.
</li> <li> Many new conversion specifiers have been added which can be used both in filenames, commands, text, and SQL database features (3.2.2-3.2.4)
</li> <li> Stepper motor tracking feature extended to also include a Y axis (3.2.5)
</li> <li> ffmpeg_filename has been renamed to movie_filename to prepare for alternative implementation to mpeg files made with ffmpeg (3.2.5)
</li> <li> New feature: ffmpeg_deinterlace which can de-interlace using the ffmpeg libs (3.2.5)
</li> <li> New feature: minimum_frame_time which enables Motion to run at frame rates below 2. minimum_gap feature was removed since this was useless and the new minimum_frame_time feature replaces it with much better function. (3.2.7)
</li> <li> New feature: process_id_file which writes a PID file when started and removes it when stopped (3.2.7)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> support with many new supported palettes : <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_SBGGR8, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_SN9C10X, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_JPEG, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_UYVY (3.2.8)
</li> <li> ffmpeg_video_codec allow swf (3.2.8)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> fix support for : <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a>_PIX_FMT_MJPEG (3.2.9)
</li> <li> ffmpeg_video_codec allow flv and ffv1(3.2.9)
</li> <li> v4l2_palette: allow to choose preferable palette to be use by motion to capture from those supported by your videodevice.
</li> <li> netcam_http: setup keep_alive , 1.1 or 1.0 http method to be used by netcam.
</li> <li> on_camera_lost: Command to be executed when a camera can't be opened or if it is lost.
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/AreaDetect">AreaDetect</a>, on_area_detected: Command to be executed by area_detect trigger.
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">ConfigOptionNetcamTolerantCheck</a> , netcam_tolerant_check less strict jpeg checks for network cameras with a poor/buggy firmware ( 3.2.11 ).
</li></ul>
<p />
The table below shows the new options in the left column, and obsolete options in the right column. If the there are options on both sides in a row it means that the options in the left column replaced the options in the right column.
<p />
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/UpgradingFromOlderVersion#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?fd8fc4e77a93cc2c570a08a93d66e7dd' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table6" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="50%" bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=6;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">New Options</font></a> </th>
<th width="50%" bgcolor="#687684" valign="top" class="foswikiTableCol1 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=6;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Obsolete Options</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> text_left (3.1.13) <br /> text_right (3.1.13) <br /> text_changes (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> drawtext_user (3.1.13) <br /> drawtext_shots (3.1.13) <br /> drawtext_changes (3.1.13) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> jpeg_filename (3.1.13) <br /> ffmpeg_filename (3.1.13) <br /> snapshot_filename (3.1.13) <br /> timelapse_filename (3.1.13) <br /> predict_filename (3.1.13) <br /> (predict_filename removed in 3.1.18) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> oldlayout (3.1.13) <br /> snapshots_overwrite (3.1.13) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> snapshot_interval (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> snapshots (3.1.13) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> realmotion (3.1.13) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> despeckle (3.1.13) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> pre_capture (3.1.12) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_timelapse (v. 3.1.14) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> ffmpeg_timelaps (renamed v 3.1.14) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_timelapse_mode (3.1.14) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> sql_log_image (3.1.14) <br /> sql_log_snapshot (3.1.14) <br /> sql_log_mpeg (3.1.14) <br /> sql_log_timelapse (3.1.14) <br /> sql_log_prediction (3.1.14) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> minimum_motion_frames (3.1.14) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> rotate (3.1.15) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_variable_bitrate (3.1.15) <br /> ffmpeg_video_codec (3.1.15) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> berkeley_single_directory (3.1.18) <br /> mpeg_encode (3.1.18) <br /> mpeg_encode_bin (3.1.18) <br /> adjust_rate off (3.1.18) <br /> jpg_cleanup (3.1.18) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> predict_filename (3.1.18) <br /> predict_enable (3.1.18) <br /> predict_threshold (3.1.18) <br /> predict_description (3.1.18) <br /> sql_log_prediction (3.1.18) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> brightness (3.1.18) <br /> contrast (3.1.18) <br /> saturation (3.1.18) <br /> hue (3.1.18) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> smart_mask_speed (3.1.18) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> output_normal <br /> valid values are now "on", "off", "first" (3.1.18) and "best" (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> setup_mode (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> always_changes (3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> locate <br /> valid values are now "on", "off", "preview" (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> jpeg_filename <br /> Besides normal path names the value "preview" has speciel meaning together with output_normal = "best" (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> control_html_output (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_event_start (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> execute (3.2.1) <br /> sms (3.2.1) <br /> mail (3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_event_end (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_motion_detected (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_picture_save (3.2.1) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> onsave (3.2.1) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> on_movie_start (3.2.1) <br /> on_movie_end (3.2.1) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> onmpeg (3.2.1) <br /> onffmpegclose (introduced 3.1.13)(renamed to on_movie_end 3.2.1) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> netcam_proxy (3.2.2) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> text_double (3.2.2) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> webcam_motion <br /> Feature has been heavily improved so it is actually usefull now (3.2.2). </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> netcam_url <br /> Now also supports fetching single frame jpeg pictures via ftp using ftp:// syntax (3.2.4) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_step_angle_x (3.2.4) <br /> track_step_angle_y (3.2.4) <br /> Add better configuration of auto tracking with a Logitech Sphere/Orbit camera. </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_move_wait (3.2.4) <br /> track_auto (3.2.4) <br /> Adds better configuration of auto tracking feature </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> sql_query (3.2.4) <br /> Adds full flexibility of defining fields when using the SQL database features. </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> track_maxy (3.2.5) <br /> track_motory (3.2.5) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> movie_filename (3.2.5) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> ffmpeg_filename (3.2.5) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_deinterlace (3.2.5) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> minimum_frame_time (3.2.7) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> minimum_gap (3.2.7) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> process_id_file (3.2.7) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_video_codec allow swf (3.2.8) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> ffmpeg_video_codec allow flv and ffv1 (3.2.9) </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> v4l2_palette (3.2.10) <br /> netcam_http (3.2.10) <br /> on_camera_lost (3.2.10) <br /> area_detect, on_area_detected(3.2.10) <br /> ffmpeg_video_codec mov(3.2.10) <br /> output_normal center(3.2.10) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> </td>
<td width="50%" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLastCol"> night_compensate (3.2.10) <br /> low_cpu (3.2.10) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> netcam_tolerant_check (3.2.11) </td>
<td width="50%" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<h2><a name="Running_Motion"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RunningMotionConfigFiles">Running Motion</a> </h2>
<p />
<h3><a name="Important_Definitions"></a> Important Definitions </h3>
Motion is invoked from the command line. It has no GUI. Everything is controlled from config files. From version 3.2 the command line is only used to define location of config file and a few special runtime modes (setup and non-daemon).
<p />
A few important definitions. <ul>
<li> A snapshot is a picture taken at regular intervals independently of any movement in the picture.
</li> <li> A "motion" image/mpeg shows the pixels that have actually changed during the last frames. These pictures are not very useful for normal presentation to the public but they are quite useful for testing and tuning and making mask files as you can see exactly where motion sees something moving. Motion is shown in greytones. If labelling is enabled the largest area is marked as blue. Smart mask is shown in read.
</li> <li> A "normal" image is the real image taken by the camera with text overlayed.
</li></ul>
<p />
<a name="ConfigFiles"></a>
<h3><a name="The_Config_Files"></a> The Config Files </h3>
<p />
If Motion was invoked with command line option <code>-c pathname</code> Motion will expect the config file to be as specified. When you specify the config file on the command line with -c you can call it anything.
<p />
If you do not specify -c or the filename you give Motion does not exist, Motion will search for the configuration file called 'motion.conf' in the following order:
<p /> <ol>
<li> Current directory from where motion was invoked
</li> <li> Then in a directory called '.motion' in the current users home directory (shell environment variable $HOME). E.g. /home/goofy/.motion/motion.conf
</li> <li> The directory defined by the --sysconfdir=DIR when running .configure during installation of Motion<br />(If this option was not defined the default is /usr/local/etc/)
</li></ol>
If you have write access to /usr/local/etc then the editor recommends having only one motion.conf file in the default /usr/local/etc/ directory.
<p />
Motion has a configuration file in the distribution package called motion-dist.conf. When you run 'make install' this file gets copied to the /usr/local/etc directory.
<p />
The configuration file needs to be renamed from motion-dist.conf to motion.conf. The original file is called motion-dist.conf so that your perfectly working motion.conf file does not accidentally get overwritten when you re-install or upgrade to a newer version of Motion.
<p />
If you have more than one camera you should not try and invoke Motion more times. Motion is made to work with more than one camera in a very elegant way and the way to do it is to create a number of thread config files. Motion will then create an extra tread of itself for each camera. If you only have one camera you only need the motion.conf file. The minute you have two or more cameras you must have <strong>one thread config file per camera</strong> besides the motion.conf file.
<p />
So if you have for example two cameras you need motion.conf <strong>and two</strong> thread config files. Total of <strong>3</strong> config files.
<p />
An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the thread files but that makes a lot of editing when you change a common thing).
<p />
An option that is unique to a camera must be defined in each thread file.
<p />
<em>It is often seen that people copy the entire motion.conf into the thread config files and change a few options. This works but it not recommended because it is more difficult to maintain and overview. Keep all the common options in motion.conf and the few unique only in the thread config files</em>
<p />
The first camera is defined in the first thread file called from motion.conf. The 2nd camera is defined in the 2nd thread file called from motion.conf etc.
<p />
Any option defined in motion.conf will be used for all cameras except for the cameras in which the same option is defined in a thread config file.
<p />
Motion reads its configuration parameters in the following sequence. If the same parameter exists more than one place <strong>the last one read wins</strong>. <ol>
<li> Motion reads the configuration file motion.conf from the beginning of the file going down line by line.
</li> <li> If the option "thread" is defined in motion.conf, the thread configuration file(s) is/(are) read.
</li> <li> Motion continues reading the rest of the motion.conf file. Any options from here will overrule the same option previously defines in a thread config file.
</li> <li> Motion reads the command line option again overruling any previously defined options.
</li></ol>
So always call the thread config files in the end of the motion.conf file. If you define options in motion.conf AFTER the thread file calls, the same options in the thread files will never be used. So always put the thread file call at the end of motion.conf.
<p />
Nearly all config options can be unique for a specific camera and placed in a thread config file. There are a few options that must be in motion.conf and cannot be in a thread config file: <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">control_authentication</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">control_html_output</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionDaemon">daemon</a>, and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThread">thread</a>.
<p />
If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that belongs to these features. You do not have to remove them or comment them out.
<p />
If you run the http control command <a href="http://host:port/0/config/writeyes" rel="nofollow" target="_top">http://host:port/0/config/writeyes</a>, motion will overwrite motion.conf and all the thread.conf files by autogenerated config files neatly formatted and only with the features included that Motion was built with. If you later re-build Motion with more features or upgrade to a new version, you can use your old config files, run the motion.conf.write command, and you will have new config files with the new options included all set to their default values. This makes upgrading very easy to do.
<p />
<p />
<h2><a name="Command_Line_Options"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CommandLineOptions">Command Line Options</a> </h2>
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> In Motion 3.2.1 and forward most command line options have been removed and replaced them by an option to specify location to motion.conf and a few options related to setting up motion. There are now only few command line options left and they are basically all new.
<p />
SYNOPSIS
<pre>
motion [ -hns ] [ -c config file path ] [ -d level ] [ -p process_id_file ]
</pre>
<p />
<div class="editTable">
<form name="edittable1_Motion_MotionGuideOneLargeDocument" action="http://www.lavrsen.dk/foswiki/bin/viewauth/Motion/CommandLineOptions#edittable1" method="post" onsubmit="foswikiStrikeOne(this)"><input type='hidden' name='validation_key' value='?fd8fc4e77a93cc2c570a08a93d66e7dd' />
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
<table cellspacing="0" id="table7" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="150" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="250" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=7;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Editors comment</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -n </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Run in non-daemon mode. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Instead of running Motion in the background Motion runs in the terminal window writing messages when things happen. If you have problems getting Motion to start or work, run Motion in this mode to get more messages that can help you solve the problem. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -s </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Run in setup mode. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Also forces non-daemon mode </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -c config file path </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Full path and filename of config file. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> E.g. /home/kurt/motion.conf. Default is /usr/local/etc unless specified differently when building Motion. Many RPMs and debian packages will most likely use /etc or /etc/motion as default </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -h </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Show help screen. </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="150" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> -d level </td>
<td width="250" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Debugging mode </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> This mode is used for developers to enable debug messages. Normal users will not need to use this mode unless a developer request to get additional information in the attempt to resolve a bug. Mainly the netcam code has debugging features. The level defines how much debugging info you get. A high number displays all debugging. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="150" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> -p process_id_file </td>
<td width="250" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> Full path of process ID file </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> Full path and filename of process id file (PID file). This is optional. If none is given as command line option or in motion.conf (process_id_file) Motion will not create a PID file. </td>
</tr>
</tbody></table>
<input type="hidden" name="ettablechanges" value="" />
<input type="hidden" name="etheaderrows" value="0" />
<input type="hidden" name="etfooterrows" value="0" />
<input class="editTableEditImageButton" type="image" src="http://www.lavrsen.dk/foswiki/pub/System/EditTablePlugin/edittable.gif" alt="Edit this table" /> </form>
</div><!-- /editTable -->
<p />
<p />
<p />
<h2><a name="Config_File_Options"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions">Config File Options</a> </h2>
These are the options that can be used in the config file.
<p />
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p />
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL and FFMPEG).
<p />
MySQL <ul>
<li> mysql_db, mysql_host, mysql_user, mysql_password
</li></ul>
<p />
PostgreSQL <ul>
<li> pgsql_db, pgsql_host, pgsql_user, pgsql_password, pgsql_port
</li></ul>
<p />
FFMPEG (libavcodec) <ul>
<li> ffmpeg_cap_new, ffmpeg_cap_motion, ffmpeg_filename, ffmpeg_timelapse, ffmpeg_timelapse_mode, ffmpeg_bps, ffmpeg_variable_bitrate, ffmpeg_video_codec
</li></ul>
<p />
<h3><a name="Options_in_Alphabetical_Order"></a> Options in Alphabetical Order. </h3>
<p />
The table below lists all the Motion options in alphabetical order. Click on the option name to see a longer description of each.
<table cellspacing="0" id="table8" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="170" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="240" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Range/Values<br />Default</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=8;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionAreaDetect">area_detect</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 999999999<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Detect motion center in predefined areas. A script (on_area_detected) is started immediately when motion center is detected in one of the given areas, but only once during an event even if there is motion in a different configured area. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">auto_brightness</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The brightness level for the video device. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionContrast">contrast</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The contrast level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">control_authentication</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4096 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">control_html_output</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionDaemon">daemon</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Start in daemon (background) mode and release terminal. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionDespeckle">despeckle</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: EedDl<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegBps">ffmpeg_bps</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 9999999<br />Default: 400000 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegCapMotion">ffmpeg_cap_motion</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegCapNew">ffmpeg_cap_new</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg libraries to encode mpeg movies in realtime. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegDeinterlace">ffmpeg_deinterlace</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">ffmpeg_filename (now called movie_filename)</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapse">ffmpeg_timelapse</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapseMode">ffmpeg_timelapse_mode</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual<br />Default: daily </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The file rollover mode of the timelapse video. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVariableBitrate">ffmpeg_variable_bitrate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0, 2 - 31<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec">ffmpeg_video_codec</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1, mov<br />Default: mpeg4 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFramerate">framerate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 2 - 100<br />Default: 100 (no limit) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Maximum number of frames to be captured from the camera per second. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 999999<br />Default: 0 (Not set) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionGap">gap</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 60 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHeight">height </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Device Dependent<br />Default: 288 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The height of each frame in pixels. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHue">hue</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The hue level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionInput">input </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 7, 8 = disabled<br />Default: 8 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionJpegFilename">jpeg_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-%q </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLightswitch">lightswitch </a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off, preview<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaskFile">mask_file</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaxMpegTime">max_mpeg_time</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 (infinite) - 2147483647<br />Default: 3600 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMinimumFrameTime">minimum_frame_time</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMinimumMotionFrames">minimum_motion_frames</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 1000s<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMotionVideoPipe">motion_video_pipe</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMovieFilename">movie_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlDb">mysql_db</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Name of the MySQL database. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlHost">mysql_host</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: localhost </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlPassword">mysql_password</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The MySQL password. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlUser">mysql_user</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The MySQL user name. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamHttp">netcam_http</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1.0, keep_alive, 1.1<br />Default: 1.0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The setting for keep-alive of network socket, should improve performance on compatible net cameras. ( new in 3.2.10 ) <br /> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamProxy">netcam_proxy</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> URL to use for a netcam proxy server, if required. The syntax is <a href="http://myproxy:portnumber" rel="nofollow" target="_top">http://myproxy:portnumber</a> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">netcam_tolerant_check</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off <br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Set less strict jpeg checks for network cameras with a poor/buggy firmware. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">netcam_url</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamUserpass">netcam_userpass</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNoiseLevel">noise_level</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 255<br />Default: 32 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The noise level is used as a threshold for distinguishing between noise and motion. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNoiseTune">noise_tune</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Activates the automatic tuning of noise level. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNorm">norm</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)<br />Default: 0 (PAL) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnAreaDetected">on_area_detected</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when motion in a predefined area is detected. Check option area_detect. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnCameraLost">on_camera_lost</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when a camera can't be opened or if it is lost. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. (new in 3.2.10) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnEventEnd">on_event_end</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnEventStart">on_event_start</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMotionDetected">on_motion_detected</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when a motion frame is detected. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an ffmpeg movie is closed at the end of an event. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an mpeg movie is created. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Command to be executed when an image is saved. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputAll">output_all</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Picture are saved continuously as if motion was detected all the time. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputMotion">output_motion</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputNormal">output_normal</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off, first, best, center (since 3.2.10)<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlDb">pgsql_db</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Name of the PostgreSQL database. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlHost">pgsql_host</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: localhost </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlPassword">pgsql_password</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL password. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlPort">pgsql_port</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 5432 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL server port number. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlUser">pgsql_user</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The PostgreSQL user name. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPostCapture">post_capture</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647 <br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to be captured after motion has been detected. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPpm">ppm</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPreCapture">pre_capture</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100s<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionProcessIdFile">process_id_file</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File to store the process ID, also called pid file. Recommended value when used: /var/run/motion.pid </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionQuality">quality</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 75 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The quality for the jpeg images in percent. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionQuiet">quiet</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Be quiet, don't output beeps when detecting motion. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRotate">rotate</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0, 90, 180, 270<br />Default: 0 (not rotated) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">roundrobin_frames</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">roundrobin_skip</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSaturation">saturation</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The colour saturation level for the video device. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSetupMode">setup_mode</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Run Motion in setup mode. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSmartMaskSpeed">smart_mask_speed</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 10<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d%H%M%S-snapshot </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for snapshots (jpeg or ppm) relative to target_dir. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotInterval">snapshot_interval</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Make automated snapshots every 'snapshot_interval' seconds. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogImage">sql_log_image</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating motion triggered image file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogMpeg">sql_log_mpeg</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating motion triggered mpeg file. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogSnapshot">sql_log_snapshot</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating a snapshot image file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogTimelapse">sql_log_timelapse</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Log to the database when creating timelapse mpeg file </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> SQL query string that is sent to the database. The values for each field are given by using <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">convertion specifiers</a> </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">switchfilter</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTargetDir">target_dir</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined = current working directory </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Target directory for picture and movie files. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextChanges">text_changes</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Turns the text showing changed pixels on/off. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextDouble">text_double</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Draw characters at twice normal size on images. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %Y%m%d%H%M%S </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextLeft">text_left</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextRight">text_right</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %Y-%m-%d\n%T </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThread">thread</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Specifies full path and filename for a thread config file. Each camera needs a thread config file containing the options that are unique to the camera. If you only have one camera you do not need thread config files. If you have two or more cameras you need one thread config file for each camera in addition to motion.conf. This option must be placed in motion.conf and not in a thread config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 2147483647<br />Default: 1500 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThresholdTune">threshold_tune</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Activates the automatic tuning of threshold level. ( It's broken ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">timelapse_filename</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: %v-%Y%m%d-timelapse </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> File path for timelapse mpegs relative to target_dir (ffmpeg only). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackAuto">track_auto</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Enable auto tracking </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackIomojoId">track_iomojo_id</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMaxx">track_maxx</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum position for servo x. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMaxy">track_maxy</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The maximum position for servo y. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMotorx">track_motorx</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The motor number that is used for controlling the x-axis. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMotory">track_motory</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The motor number that is used for controlling the y-axis. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMoveWait">track_move_wait</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 10 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackPort">track_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> This is the device name of the serial port to which the stepper motor interface is connected. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackSpeed">track_speed</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 255 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Speed to set the motor to. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleX">track_step_angle_x</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0-90<br />Default: 10 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleY">track_step_angle_y</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0-40<br />Default: 10 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepsize">track_stepsize</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 255<br />Default: 40 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Number of steps to make. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackType">track_type</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)<br />Default: 0 (None) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Type of tracker. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTunerdevice">tunerdevice</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: /dev/tuner0 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionV4L2Palette">v4l2_palette</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 8<br />Default: 8 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Allow to choose preferable palette to be use by motion<br /> to capture from those supported by your videodevice. ( new in 3.2.10 ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionVideoPipe">video_pipe</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: Not defined </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe. If a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionVideodevice">videodevice</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: Max 4095 characters<br />Default: /dev/video0 (<a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>: /dev/bktr0) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> The video device to be used for capturing. Default for Linux is /dev/video0. for <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a> the default is /dev/bktr0. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamLimit">webcam_limit</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (unlimited) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamLocalhost">webcam_localhost</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: on </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limits the access to the webcam to the localhost. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">webcam_maxrate</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 1 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamMotion">webcam_motion</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamPort">webcam_port</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 65535<br />Default: 0 (disabled) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> TCP port on which motion will listen for incoming connects with its webcam server. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamQuality">webcam_quality</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 1 - 100<br />Default: 50 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWidth">width</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> Values: Device Dependent<br />Default: 352 </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> The width in pixels of each frame. Valid range is camera dependent. </td>
</tr>
</tbody></table>
<p />
<h3><a name="Obsolete_Options"></a> Obsolete Options </h3>
<p />
<table cellspacing="0" id="table9" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th width="170" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Option</font></a> </th>
<th width="240" bgcolor="#687684" align="left" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Range/Values<br />Default</font></a> </th>
<th bgcolor="#687684" align="left" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=9;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLowCpu">low_cpu</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> Values: 0 - 100<br />Default: 0 (disabled) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> When this option is not zero motion will be in a low cpu mode while not detecting motion. In low cpu mode Motion reduces the framerate to the value given for this option. Value zero means disabled. ( DEPRECATED ) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="170" bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMinimumGap">minimum_gap</a> </td>
<td width="240" bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> Values: 0 - 2147483647<br />Default: 0 (no minimum) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> The minimum time between two shots in seconds. ( DEPRECATED ) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="170" bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNightCompensate">night_compensate</a> </td>
<td width="240" bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Values: on, off<br />Default: off </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> When this option is set the noise threshold will be lowered if the picture is dark. This will improve the sensitivity in dark places. However it might also increase the number of false alarms since most cameras also increase light sensitivity with their AGC (Automatic Gain Control) and this will increase noise. ( DEPRECATED ) </td>
</tr>
</tbody></table>
<p />
<p />
<p />
<p />
<h2><a name="Signals_sent_with_e_g_kill_comma"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/SignalsKill">Signals (sent with e.g. kill command)</a> </h2>
A signal can be sent from the command line by typing e.g. <code>kill -s SIGHUP pid</code>, where the last parameter is the process ID which you get by typing <code>ps -ef ¦ grep motion</code>. The PID is the first on the list which is the parent process for the threads.
Motion responds to the following signals:
<p />
<table cellspacing="0" id="table10" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Signal</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=10;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Editors comment</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> SIGHUP </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> The config file will be reread. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol"> This is a very useful signal when you experiment with settings in the config file. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> SIGTERM </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> If needed motion will create an mpeg file of the last event and exit </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLastCol"> </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> SIGUSR1 </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> Motion will create an mpeg file of the current event. </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLastCol foswikiLast"> </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Error_Logging"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ErrorLogging">Error Logging</a> </h2>
Motion reports errors to the console when it runs in non-daemon mode. And it outputs even more information when run in setup mode.
<p />
Error logging has been implemented so that errors during daemon (background) mode are logged in the syslog.
<p />
The syslog is in most Linux systems the file <code>/var/log/messages</code> (e.g. RedHat/Fedora) or <code>/var/log/syslog</code> and <code>/var/log/user.log</code> (e.g. Debian).
<p />
<p />
<h1><a name="Motion_Guide_Basic_Features"></a> Motion Guide - Basic Features </h1>
<p />
<h2><a name="Capture_Device_Options_The_Basic"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CaptureDeviceOptions">Capture Device Options - The Basic Setup</a> </h2>
Before you can start using motion you need to know some basics about your camera.
Either you have a camera connected directly to your computer. In this case it is a video4linux type of camera. Or you connect to a network camera using a normal web URL.
<p />
<h2><a name="video4linux_V4L_devices"></a> video4linux (<a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L">V4L</a>) devices </h2>
You need to install your camera with the right driver. It is out of scope of this document to tell you how to do this and it depends on which type of camera.
<p />
Once installed the camera(s) will have the device names /dev/video0, /dev/video1, /dev/video2...
<p />
FreeBSD has a different naming of devices. When you build Motion for FreeBSD the default device name is /dev/bktr0. Under FreeBSD a TV card has a special device for controlling the tuner (e.g. /dev/tuner0). The option tunerdevice is only valid when Motion is built and running under FreeBSD. For Linux do not include this option in the config file (remove or comment out).
<p />
<strong>USB cameras</strong> take a lot of bandwidth. A USB camera connected to a USB 1.1 port or hub consumes all the bandwidth. Even with a small framesize and low framerate you should not expect to have more than one camera per USB 1.1 controller. If you need more than 1 USB camera add extra USB PCI cards to your computer. There exists cards that have 4 inputs each with their own controller and with full bandwidth. Many 4-input cards only have 1 controller. USB cameras do not have the feature of selecting input channels. <em>To disable the input selection the option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionInput">input</a> must be set to the value 8 for USB cameras.</em>
<p />
<strong>Composite video cards</strong> are normally made with a chip called BT878 (older cards have a BT848). They all use the Linux driver called 'bttv'.
<p />
There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer which input is selected with the config option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionInput">input</a>. Input channel numbers start at 0 (which is why the value 8 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 thread config files with the same videodevice name but different input numbers Motion automatically goes into round robin mode. See the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument#RoundRobin" class="foswikiCurrentTopicLink">round robin</a> section for more information. Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. For video capture cards input 1 is normally the composite video input.
<p />
Some capture cards are specially made for surveillance with for example 4 inputs. Others have a TV tuner, a composite input (phono socket) and perhaps also a S-VHS input. For all these cards the inputs are numbered. The numbering varies from card to card so the easiest is to experiment for 5 minutes with a program that can show the videostream. Use a program such as Camstream or xawtv to experiment with the values.
<p />
If you use the TV tuner input you also need to set the frequency of the TV channel using the option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a>. Otherwise set 'frequency' to 0.
<p />
Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).
<p />
If the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">netcam_url</a> option is defined all the video4linux options are ignored so make sure the netcam_url option is commented out if you do not need it.
<p />
<strong>These are the parameters used for video4linux devices</strong>
<p />
<p />
<p />
<h3><a name="auto_brightness"></a> auto_brightness </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">Option Topic</a>
</li></ul>
<p />
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness
<p />
Motion will try to adjust the brightness of the video device if the images captured are too dark or too light. This option will be most useful for video devices like web cams, which sometimes don't have such an option in hardware.
<p />
The auto_brightness feature will adjust the brightness of the device up or down until the value defined by the option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> is reached (1 = dark, 255 = bright). If <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionBrightness">brightness</a> is zero auto_brightness will try to adjust to the average brightness level 128.
<p />
You need to know if the camera supports auto brightness. Most cameras have auto everything. If your video device already does this for you this option might cause oscillations. If you do not know assume that it has and do not use the Motion auto brightness feature. At least not to start with.
<p />
<p />
<p />
<p />
<p />
<h3><a name="brightness"></a> brightness </h3> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionBrightness">Option Topic</a>
</li></ul>
<p />
The brightness level for the video device.
<p />
Value 0 means that Motion does not set the brightness value but leaves it unchanged.
<p />
If this setting is used in conjunction with the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionAutoBrightness">auto_brightness</a> feature then this setting is the average brightness level in the range 1 (dark) to 255 (bright) that the auto_brightness feature will try to achieve by adjusting the device brightness up and down.
<p />
<p />
<p />
<p />
<h3><a name="contrast"></a> contrast </h3> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionContrast">Option Topic</a>
</li></ul>
<p />
The contrast level for the video device.
<p />
Disabled (Value 0) means that Motion does not set the contrast value.
<p />
<p />
<p />
<p />
<h3><a name="framerate"></a> framerate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 2 - 100
</li> <li> Default: 100 (no limit)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFramerate">Option Topic</a>
</li></ul>
<p />
Maximum number of frames to be captured from the camera per second.
<p />
The faster you fetch pictures from the camera the more CPU load you get and the more pictures get included when Motion is detected.
<p />
Motion will stop storing pictures if the framerate is set to less than 2.
<p />
Set this parameter to the maximum number of images per second that you want to store either as images or as mpeg films.
<p />
To set intervals longer than one second use the 'minimum_gap' option instead.
<p />
<p />
<p />
<p />
<h3><a name="frequency"></a> frequency </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 999999
</li> <li> Default: 0 (Not set)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFrequency">Option Topic</a>
</li></ul>
<p />
The frequency to set the tuner to (kHz). Valid range: per tuner spec, default: 0 (Don't set it)
<p />
This option is only relevant if you have a TV tuner card where you can select the tuner frequency. Your tuner card must support this feature.
<p />
<p />
<p />
<p />
<h3><a name="height"></a> height </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: Device Dependent
</li> <li> Default: 288
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHeight">Option Topic</a>
</li></ul>
<p />
The height of each frame in pixels.
<p />
The height of the image in pixels. Motion does not scale so should be set to the actual size of the v4l device. In case of a net camera motion sets the height to the height of the first image read.
<p />
Motion actually set the size of the image coming from the video4linux device.
<p />
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.
<p />
For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.
<p />
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Ths is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
<p />
<p />
<p />
<p />
<h3><a name="hue"></a> hue </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHue">Option Topic</a>
</li></ul>
<p />
The hue level for the video device.
<p />
Normally only relevant for NTSC cameras.
<p />
<p />
<p />
<p />
<h3><a name="input"></a> input </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 7, 8 = disabled
</li> <li> Default: 8 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionInput">Option Topic</a>
</li></ul>
<p />
Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras.
<p />
This parameter is really used only with video capture cards that has more than one input.
<p />
However if you set the input number to e.g. 1 for a USB camera (ov511 or pwc driver) motion writes an error message back. If you set it to 8 it does not give you any warning.
<p />
If you have a video capture card you can define the channel to tune to using this option. If you are using a USB device, network camera or a capture card without tuner you should set the value to the default 8.
<p />
Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. It is recommended to set the parameter to 8 for USB cameras as your first try. For video capture cards input 1 is normally the composite video input.
<p />
<p />
<p />
<p />
<h3><a name="minimum_frame_time"></a> minimum_frame_time </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMinimumFrameTime">Option Topic</a>
</li></ul>
<p />
Minimum time in seconds between the capturing picture frames from the camera. Default: 0 = disabled - the capture rate is given by the camera framerate.
<p />
This option is used when you want to capture images at a rate lower than 2 per second.
<p />
When this is enabled the framerate option is used only to set the pace the Motion service the webcam port etc. Running Motion at framerate 2 is normally fine.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This feature is introduced in Motion 3.2.7
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="norm"></a> norm </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)
</li> <li> Default: 0 (PAL)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNorm">Option Topic</a>
</li></ul>
<p />
Select the norm of the video device. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
<p />
This value is only used for capture cards using the <a href="http://bytesex.org/bttv/index.html" rel="nofollow" target="_top">BTTV driver</a>.
<p />
<p />
<p />
<p />
<h3><a name="rotate"></a> rotate </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0, 90, 180, 270
</li> <li> Default: 0 (not rotated)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRotate">Option Topic</a>
</li></ul>
<p />
Rotate image the given number of degrees. The rotation affects all saved images as well as mpeg movies.
<p />
The rotation feature is used when the camera is hanging upside down (180 degrees) or if you choose a picture format in portrait instead of the normal landscape (90 or 270 degrees).
<p />
Note that the CPU load increases when using this feature with a value other than 0. Also note that Motion automatically swaps width and height if you rotate 90 or 270 degrees, so you don't have to touch these options.
<p />
<p />
<p />
<p />
<h3><a name="saturation"></a> saturation </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSaturation">Option Topic</a>
</li></ul>
<p />
The colour saturation level for the video device.
<p />
<p />
<p />
<p />
<p />
<p />
<h3><a name="tunerdevice"></a> tunerdevice </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: /dev/tuner0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTunerdevice">Option Topic</a>
</li></ul>
<p />
The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>.
<p />
Make sure to remove or comment out this option when running Motion under Linux.
<p />
<p />
<p />
<p />
<h3><a name="v4l2_palette"></a> v4l2_palette </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 8
</li> <li> Default: 8
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionV4L2Palette">Option Topic</a>
</li></ul>
<p />
Allow to choose preferable palette to be use by motion
to capture from those supported by your videodevice. ( new in 3.2.10 )
<p />
<!--
Add Additional Description Below
-->
<p />
i.ex if your videodevice supports <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_SBGGR8 and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_MJPEG by default motion will use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_MJPEG so set v4l2_palette 1 to force motion use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/V4L2">V4L2</a> _PIX_FMT_SBGGR8 instead.
<p />
Values :
<pre>V4L2_PIX_FMT_SN9C10X : 0 'S910'
V4L2_PIX_FMT_SBGGR8 : 1 'BA81'
V4L2_PIX_FMT_MJPEG : 2 'MJPEG'
V4L2_PIX_FMT_JPEG : 3 'JPEG'
V4L2_PIX_FMT_RGB24 : 4 'RGB3'
V4L2_PIX_FMT_UYVY : 5 'UYVY'
V4L2_PIX_FMT_YUYV : 6 'YUYV'
V4L2_PIX_FMT_YUV422P : 7 '422P'
V4L2_PIX_FMT_YUV420 : 8 'YU12'
</pre>
<p />
<p />
<p />
<p />
<h3><a name="videodevice"></a> videodevice </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: /dev/video0 (<a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a>: /dev/bktr0)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionVideodevice">Option Topic</a>
</li></ul>
<p />
The video device to be used for capturing. Default for Linux is /dev/video0. for <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FreeBSD">FreeBSD</a> the default is /dev/bktr0.
<p />
This is the video4linux device name. Ignore this for net cameras.
<p />
<p />
<p />
<p />
<h3><a name="width"></a> width </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: Device Dependent
</li> <li> Default: 352
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWidth">Option Topic</a>
</li></ul>
<p />
The width in pixels of each frame. Valid range is camera dependent.
<p />
Motion does not scale so should be set to the actual size of the v4l device.
<p />
In case of a net camera motion sets the height to the height of the first image read.
<p />
Motion actually set the size of the image coming from the video4linux device.
<p />
Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.
<p />
For some device drivers like pwc (driver for Philips USB cameras) setting the size to a non-standard value makes the driver create an image of the nearest smaller size and create a gray band around the image to fit the size given by motion. Note that it is the driver and not motion that generates the gray band. Motion will try to detect motion in the entire image including the gray band.
<p />
Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Ths is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.
<p />
<p />
<p />
<h2><a name="Network_Cameras"></a> Network Cameras </h2>
Motion can connect to a network camera through a normal TCP socket. All you need to give it is the URL. The URL given must return either one single jpeg picture or an mjpeg stream. For the time being Motion cannot connect to a video stream such a mpeg, mpeg4, divx. The URL must return one single jpeg image or an mjpeg stream! You can connect through a proxy server.
<p />
Also watch out that you do not use a URL that create an HTML page with an embedded jpg. What must be returned is the jpg picture itself or the raw mjpeg stream.
<p />
When the netcam_url is defined all the video4linux options above are ignored!!
<p />
If the connection to a network camera is lost - Motion will reuse the last good image for approx 30 seconds. AFter 30 seconds the image is replaced by a grey image with a text telling that the signal is lost and when the connection was lost. <em>This text and its date format is not configurable and there are no plans to make it configurable in order to keep the number config options under control.</em>
<p />
Note that Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Ths is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.
<p />
<em>The network camera feature has been completely re-written in Motion 3.2.2. We believe the netcam feature is much more stable now that it was in previous versions. Motion tries to reconnect to the camera if the connection is lost. There is no official standard for mjpeg and we know that there are probably still some cameras that are not yet supported. If you run into a problem please file a <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReports">Bug Report</a> with as much information about the format as possible. A binary raw dump of the first 2-3 frames with headers and boundary strings is very useful. You can see how to make it on the special topic <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/NetcamMjpegStreamDumps">NetcamMjpegStreamDumps</a>. When you have the file you can upload it to the same topic.</em>
<p />
<p />
<p />
<h3><a name="netcam_http"></a> netcam_http </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 1.0, keep_alive, 1.1
</li> <li> Default: 1.0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamHttp">Option Topic</a>
</li></ul>
<p />
The setting for keep-alive of network socket, should improve performance on compatible net cameras. ( new in 3.2.10 )
<p />
<p /> <ul>
<li> 1.0: the historical implementation using HTTP/1.0, closing the socket after each http request.
</li> <li> keep_alive: Use HTTP/1.0 requests with keep alive header to reuse the same connection.
</li> <li> 1.1: Use HTTP/1.1 requests that support keep alive as default.
</li></ul>
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="netcam_proxy"></a> netcam_proxy </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamProxy">Option Topic</a>
</li></ul>
<p />
URL to use for a netcam proxy server, if required. The syntax is <a href="http://myproxy:portnumber" rel="nofollow" target="_top">http://myproxy:portnumber</a>
<p />
Use this if you need to connect to a network camera through a proxy server.
<p />
Example of syntax: "http://myproxy.mydomain.com:1024
<p />
If the proxy port number is 80 you can ommit the port number. Then the syntax is use "http://myproxy.mydomain.com" .
<p />
Leave this option undefined if you do not use a proxy server.
<p />
<p />
<p />
<p />
<h3><a name="netcam_tolerant_check"></a> netcam_tolerant_check </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamTolerantCheck">Option Topic</a>
</li></ul>
<p />
Set less strict jpeg checks for network cameras with a poor/buggy firmware.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="netcam_url"></a> netcam_url </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamUrl">Option Topic</a>
</li></ul>
Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera.
<p />
Example of URL: http://www.gate.com/pe1rxq/jeroen.jpg.
<p />
Motion can connect to a network camera through a normal TCP socket. All you need to give it is the URL. The URL given must return either one single jpeg picture or an mjpeg stream. For the time being Motion cannot connect to a video stream such a mpeg, mpeg4, divx. The URL must return one single jpeg image or an mjpeg stream!
<p />
Also watch out that you do not use a URL that create an HTML page with an embedded jpg. What must be returned is the jpg picture itself or the raw mjpeg stream.
<p />
When the netcam_url is defined all the video4linux options are ignored!!
<p />
Motion can also fetch jpeg pictures via ftp. You then use the ftp:// syntax instead.
<p />
<p />
<p />
<p />
<h3><a name="netcam_userpass"></a> netcam_userpass </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNetcamUserpass">Option Topic</a>
</li></ul>
<p />
For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication.
<p />
To use no authentication simply remove this option from the config file comment it out with "#" or ";" in front.
<p />
<p />
<p />
<p />
<a name="RoundRobin"></a>
<h2><a name="Round_Robin_feature"></a> Round Robin feature </h2>
This feature is automatically activated where multiple threads are sharing the same video device (for example /dev/video0). Each thread can then set different input channels to change camera with the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionInput">input</a> option or by tuning the tuner with <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFrequency">frequency</a> option.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Round Robin is not relevant for Network cameras or standard USB web cameras. The Round Robin feature is used with video capture cards which have multiple inputs per video chip.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Note that round robin is not the ideal way to run multiple cameras. When the capture card changes input it takes a little while before the decoder chip has syncronized to the new camera. You can improve this if you have expensive cameras with a syncronize input. Only one camera can be decoded at a time so if you have 4 cameras connected 3 of the camera threads will need to wait for their turn. The fact that cameras have to take turns and the fact that you have to skip a few frames after each turn dramatically lowers the possible framerate. You can get a high framerate by viewing each camera for a long time. But then you may miss the action on one of the inactive cameras. If you can affort it avoid Round Robin and buy the more expensive type of capture cards that has one decoder chip per input. If you only need 2 or 3 cameras you can also simply put 2 or 3 cheap TV cards in the computer. Linux has no problem working with multiple TV cards.
<p /> <ul>
<li> If multiple threads use the same video device, they each can capture <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">roundrobin_frames</a> number of frames before having to share the device with the other threads.
</li> <li> When another thread wants to watch another input or frequency or size the first <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">roundrobin_skip</a> number of frames are skipped to allow the device to settle.
</li> <li> The last option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">switch_filter</a> is supposed to prevent the change of camera from being detected as Motion. Its function is not perfect and sometimes prevents detection of real motion. You should start with having the option disabled and then try with the option enabled to see if you can skip less frames without loosing the detection of the type of motion you normally want to detect.
</li></ul>
<p />
<strong>These are the special Round Robin options</strong>
<p />
<p />
<p />
<h3><a name="roundrobin_frames"></a> roundrobin_frames </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinFrames">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second) is possible.
<p />
The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.
<p />
If multiple threads use the same video device, they each can capture roundrobin_frames number of frames before having to share the device with the other threads.
<p />
<p />
<p />
<p />
<h3><a name="roundrobin_skip"></a> roundrobin_skip </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionRoundrobinSkip">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe).
<p />
The Round Robin feature is automatically activated where multiple threads are sharing the same video device. Each thread can then set different input channels or frequencies to change camera.
<p />
When another thread wants to watch another input or frequency or size the first roundrobin_skip number of frames are skipped to allow the device to settle.
<p />
<p />
<p />
<p />
<h3><a name="switchfilter"></a> switchfilter </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSwitchfilter">Option Topic</a>
</li></ul>
<p />
Turns the switch filter on or off. The filter can distinguish between most switching noise and real motion. With this you can even set roundrobin_skip to 1 without generating much false detection.
<p />
This is a round robin related feature used when you have a capture card with multiple inputs (controlled by the 'input' option) on the same videodevice.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This feature was seriously broken until Motion 3.2.4
<p />
<p />
<p />
<p />
<p />
<h2><a name="Motion_Detection_Settings"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionDetectionSettings">Motion Detection Settings</a> </h2>
These are the options that controls the detection of motion. Further details follows after.
<p />
<p />
<p />
<h3><a name="area_detect"></a> area_detect </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: 1 - 999999999
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionAreaDetect">Option Topic</a>
</li></ul>
<p />
Detect motion center in predefined areas. A script (on_area_detected) is started immediately when motion center is detected in one of the given areas, but only once during an event even if there is motion in a different configured area.
<p />
<!--
Add Additional Description Below
-->
<p />
Areas are numbered like that:
<p />
<pre> 1 2 3
4 5 6
7 8 9
</pre>
<p />
One or more areas can be specified with this option.
<p />
Example: You want to monitor if the center of motion occurrs in the lower third of the image - that is area 7, 8 and 9. Simply set 'area_detect' to '789' and 'on_area_detect' will be executed as soon as the center of motion was detected in area 7, 8 or 9. If you want to monitor area 2, 3, 5 and 6, set '2356'.
<p />
<p />
<p />
<p />
<h3><a name="despeckle"></a> despeckle </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: EedDl
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionDespeckle">Option Topic</a>
</li></ul>
<p />
Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling.
<p />
A way of tuning (by removing or enhancing) noise in the motion image. Options for the despeckle feature are any of 'e', 'E', 'd' or 'D'. This can be combined by a trailing 'l' (letter l) which enables the labeling feature. Default: Not Defined (Don't despeckle and label).
<p />
Wind blowing grass and trees around or poor light conditions can cause a lot of dots (or noise) to appear in the motion image (See the section on Tuning Motion). This feature removes (or enhances!) this noise and so improves the reliability of motion.
<p />
The 'e' option removes diamonds, 'E' removes squares and alternating eE will remove circles. Each e/E you add will shrink the noise by a pixel all the way around. So 'despeckle Ee' will remove circles of radius 2. However, this will also shrink the detection by 2 and will affect the threshold. So to remove noise and then restore the detected motion to its original size try 'despeckle EedD'.
<p />
After the despeckle feature is done you can let the labeling feature search for areas of connected pixels and "label" each area. The program will now trigger motion based on the number of changed pixels in the largest area. In other words, the largest labeled area has to be above the threshold to trigger a motion detected.
<p />
The value EedDl is a good starting point. The possible combinations are endless and it requires many experiments to find the best combination. Just remember that the labeling feature only works as intended if it runs after the despeckle feature. Ie. the letter 'l' must be the last letter and only one 'l'.
<p />
If you have very few problems with false detections leave this option either blank or at EedD which will remove most of the single pixel noise.
A very detailed technical explanation of the despeckle part can be found at the webpage of the author of this feature <a href="http://emit.demon.co.uk/motion/" rel="nofollow" target="_top">Ian McConnell's Webcam: Motion Web Page</a>
<p />
<p />
<p />
<p />
<h3><a name="gap"></a> gap </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 60
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionGap">Option Topic</a>
</li></ul>
<p />
Gap is the seconds of no motion detection that triggers the end of an event. An event is defined as a series of motion images taken within a short timeframe.
<p />
Recommended value is 60 seconds (Default). The value 0 is allowed (but not recommended) and disables events causing all Motion to be written to one single mpeg file and no pre_capture. You can force an event to end and a new to begin using the http control 'http://host:port/thread_number/action/makemovie'. Disabling events has bad side effects on noise_tune and smartmask. Both features can only work properly outside an event. When gap is set to 0, both features don't work properly anymore.
<p />
An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. This option defines how long a pause between detected motions that is needed to be defined as a new event.
<p />
The gap timer starts after the last motion is detected and post_capture images have been saved and appended to open movie mpeg files.
<p />
Any motion detected before the gap timer times out resets the gap timer so it starts counting over again.
<p />
<strong>Detailed Description</strong>
<p />
The option 'gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.
<p />
The way 'gap' works in more technical terms is: <ul>
<li> Gap is a timer that timeout 'gap' seconds after the last video frame with motion is detected.
</li> <li> If 'post_capture' is activated then the gap timer starts counting after the last image of the post_capture buffer has been saved.
</li> <li> The gap timer is reset and starts all over each time new motion is detected, so you will not miss any action by having a short 'gap' value. It will just create more events (e.g. more mpegs files)
</li></ul>
<p />
The gap value impacts many functions in Motion. <ul>
<li> When the gap timer runs out the event number is increased by one next time motion is detected. When you use the %v conversion specifier in filenames or text features this means that the number in filename or text increased by one.
</li> <li> The pre_capture feature only works at the beginning of an event. So if you have a very large 'gap' value pre_capture is not working very often.
</li> <li> When you make mpegs using the ffmpeg features a new mpeg file is started at the beginning of an event when the first motion is detected. When 'gap' seconds has passed without motion (and post_captured frames saved) the mpeg files is completed and closed.
</li> <li> Do not use large gap values to generate one large mpeg4 file. If Motion stops working this mpeg4 file never gets properly completed and closed and you will not be able to view it.
</li> <li> Some of the tracking features sets the camera back to the center position when an event is over.
</li></ul>
<p />
Note that 'gap' and 'minimum_gap' have nothing to do with each other.
<p />
<p />
<p />
<p />
<h3><a name="lightswitch"></a> lightswitch </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 100
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLightswitch">Option Topic</a>
</li></ul>
Ignore sudden massive light intensity changes given as a percentage of the picture area that changed intensity.
<p />
Experiment to see what works best for your application.
<p />
Note: From version 3.1.17 (snap release 2 and on) this option has changed from a boolean (on or off) to a number in percent between 0 and 100. Zero means the option is disabled.
<p />
The value defines the picture areas in percent that will trigger the lightswitch condition. When lightswitch is detected motion detection is disabled for 5 picture frames. This is to avoid false detection when light conditions change and when a camera changes sensitivity at low light.
<p />
<p />
<p />
<p />
<h3><a name="mask_file"></a> mask_file </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaskFile">Option Topic</a>
</li></ul>
<p />
PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format.
<p />
Full path of the PGM (portable gray map) mask file (binary format).
<p />
If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. This file is a picture that you create in your favorite photo editing program. The areas that you want detected must be white. The error that you want ignored must be black. The pgm image must be the same size (number of pixels high and wide) as the pictures that are taken by the camera (video4linux device).
<p />
You can adjust sensitivity by using gray tones.
<p />
If you do not have a mask file disable this option by not having it in the config file or comment it out ("#"or ";" as first character in line).
If you are using the <code>rotate</code> option, note that the mask is applied <em>after</em> the rotation.
<p />
<strong>Detailed Description</strong>
<p />
The mask file must be a pgm format image file (portable gray map). Note that you must choose the BINARY format.
<p />
The feature is simple. Create an image of exact the same size as the ones you get from your video device (camera). Make a purely white picture and paint the areas that you want to mask out black. You can also make gray areas where you want to lower the sensitivity to motion. Normally you will stick to pure black and white.
<p />
One easy method for generating the mask file is as follows.
<p />
You can just take a motion captured picture, edit it with black and white for the mask and save it as a pgm file.
If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with
<p />
<code>djpeg -grayscale -pnm [inputfile] > mask.pgm</code>
<p />
(assuming you have djpeg installed - part of the jpeg lib package).
<p />
Note that the mask file option masks off the detection of motion. The entire picture is still shown on the picture. This means that you cannot use the feature to mask off an area that you do not want people to see.
<p />
Below are an example of a webcam picture and a mask file to prevent the detection cars in the street.
<p />
Normal picture. Notice the street is visible through the hedge.
<p />
<img alt="normal.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/ConfigOptionMaskFile/normal.jpg" />
<p />
Mask file (converted to png format so it can be shown by your web browser)
<p />
<table cellspacing="0" id="table11" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<tbody>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLastCol foswikiLast"> <img alt="mask1.png" src="http://www.lavrsen.dk/foswiki/pub/Motion/ConfigOptionMaskFile/mask1.png" /> </td>
</tr>
</tbody></table>
<p />
<p />
<p />
<p />
<h3><a name="max_mpeg_time"></a> max_mpeg_time </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 (infinite) - 2147483647
</li> <li> Default: 3600
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaxMpegTime">Option Topic</a>
</li></ul>
<p />
The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.
<p />
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="minimum_motion_frames"></a> minimum_motion_frames </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 1 - 1000s
</li> <li> Default: 1
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMinimumMotionFrames">Option Topic</a>
</li></ul>
<p />
Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5.
<p />
Note that the picture frames are buffered by Motion and once motion is detected also the first frames containing motion are saved so you will not miss anything.
<p />
The feature is used when you get many false detections when the camera changes light sensitivity or light changes.
<p />
Experiment for best setting. Even though Motion accepts large values you should set this to a relatively low number (below 10). For each step larger than 1 Motion reserves space in RAM for the picture frame buffer. If you have a large value Motion will miss many frames from the camera while it is processing the all the pictures in the buffer.
<p />
<p />
<p />
<p />
<h3><a name="noise_level"></a> noise_level </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 255
</li> <li> Default: 32
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNoiseLevel">Option Topic</a>
</li></ul>
<p />
The noise level is used as a threshold for distinguishing between noise and motion.
<p />
This is different from the threshold parameter. This is changes at pixel level. The purpose is to eliminate the changes generated by electric noise in the camera. Especially in complete darkness you can see the noise as small grey dots that come randomly in the picture. This noise can create false motion detection. What this parameter means is that the intensity of a pixel must change more than +/- the noise threshold parameter to be counted.
<p />
<p />
<p />
<p />
<h3><a name="noise_tune"></a> noise_tune </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionNoiseTune">Option Topic</a>
</li></ul>
<p />
Activates the automatic tuning of noise level.
<p />
This feature makes Motion continuously adjust the noise threshold for distinguishing between noise and motion. The 'noise_level' setting is ignored when activating this feature. This is a new feature and new algorithm. It may give different results depending on camera and light conditions. Report your experience with it on the Motion mailing list. If it does not work well, deactivate the 'noise_tune' option and use the manual setting of 'noise_level' instead.
<p />
<p />
<p />
<p />
<h3><a name="output_all"></a> output_all </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputAll">Option Topic</a>
</li></ul>
<p />
Picture are saved continuously as if motion was detected all the time.
<p />
This feature is not meant to be the normal mode of operation. Especially not if you have the output_normal or output_motion features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.
<p />
If your frame rate is 10 pictures per second motion will save 10 new picture pr second until the disk is full.
<p />
It does all the normal actions that are done when motion is detected. It saves pictures on the harddisk, execute external scripts, etc as fast as the frame rate of the camera. So it is probably a good idea to run with a low framerate when using this feature and to not use activate all the features that saves files on the disk.
<p />
The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous mpeg films when needed.
<p />
<p />
<p />
<p />
<h3><a name="post_capture"></a> post_capture </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPostCapture">Option Topic</a>
</li></ul>
<p />
Specifies the number of frames to be captured after motion has been detected.
<p />
The purpose of this is mainly to create smooth video clips each time motion is detected. Use it to you personal taste (and disk space)..
<p />
This option is the preferred way to create continuous movies. Post_capture does not consume extra RAM and it does not create pauses in the movie even with large values.
<p />
If you only store mpegs movies and do not have output_normal on, then the recommended post_capture value is what is equivalent to 1-5 seconds of movie.
<p />
<p />
<p />
<p />
<h3><a name="pre_capture"></a> pre_capture </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 100s
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPreCapture">Option Topic</a>
</li></ul>
<p />
Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.
<p />
Motion buffers the number of picture frames defined by 'pre_capture'. When motion is detected the pictures in the buffer are included in the video clip generated by ffmpeg. The effect is that it seems the program knew in advance that the event was going to take place and started the recording before it actually happened. This is a nice feature that give more complete video clips of an event.
<p />
If pre_capture is set to 0 the feature is disabled. Keep this value below 5.
<p />
The recommended value would be approx 0.5 second of video so the value should be defined so it fits the framerate and the desired pre-capture time. E.g. 0.5 second at 20 frames pr second would mean a value of 5. You should never use a value larger than 10.
<p />
You can in theory have up to 100s of pre-captured frames but naturally this makes motion leave a larger footprint in the memory of the computer. More important Motion is processing all the buffered images including saving jpegs, encoding mpegs, writing to databases and executing external programs after the first image is detected as Motion.
<p />
Motion will not grab another image until this is done. This means that even moderate values for pre_capture combined with high framerates will mean that you will miss quite many frames of Motion. It is therefore recommended to use relative small values for pre_capture. Depending on your chosen framerate and depending on the features enabled values from 1-5 are sensible.
<p />
If you wish to create smooth mpegs during events using large pre_capture values will do the opposite! It will create a long pause where a lot of action is missed.
<p />
To get a smooth mpeg use a large value for <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPostCapture">post_capture</a> which does not cost any performance hit or RAM space.
<p />
<p />
<p />
<p />
<h3><a name="smart_mask_speed"></a> smart_mask_speed </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 10
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSmartMaskSpeed">Option Topic</a>
</li></ul>
<p />
Slugginess of the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast.
<p />
Smartmask is a dynamic, self-learning mask. Smartmask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion was. This way smartmask works more reliable when sudden moves occur under windy conditions.
<p />
smart_mask_speed - tunes the slugginess of the mask. It accepts values from 0 (turned off) to 10 (fast). Fast means here that the mask is built quick, but it is also not staying very long with no more motion. Slow means that it takes a while until the mask is built but it also stays longer. A good start value for smart_mask_speed is 5. This setting is independent from the framerate. The attack and decay time is constant over all available framerates.
<p />
When smartmask is enabled and motion is also configured to either write motion-images or motion-mpegs, the current smartmask is copied as an overlay into the black/white motion-pictures/mpegs in red colour. Same thing happens to the webcam stream when Motion runs in <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSetupMode">setup_mode</a>. That way you can easily adjust smart_mask_speed.
<p />
<strong>Detailed Description</strong>
<p />
The <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaskFile">mask_file</a> option provides a static mask to turn off sensitivity in certain areas. This is very usefull to mask a street with cars passing by all day long etc...
<p />
But imagine a scenario with large bushes and big trees where all the leaves are moving in the wind also triggering motion from time to time even with despeckle turned on. Of course you can also define a static mask here, but what if the bushes are growing during spring and summer? Well, you have to adapt the mask from time to time. What if the camera position moves slightly? What if someone grows new plants in your garden? You always have to setup a new static mask.
<p />
The answer to this problem is the smart mask feature introduced in Motion 3.1.18. A dynamic, self-learing mask.
<p />
Smart mask will disable sensitivity in areas with frequent motion (like trees in the wind). Sensitivity is turned on again after some time of no more motion in this area. The built mask is a bit larger at the borders than the actual motion. This way smartmask works more reliably when sudden moves occur under windy conditions.
<p />
<p />
<p />
<p />
<p />
<h3><a name="threshold"></a> threshold </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 2147483647
</li> <li> Default: 1500
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThreshold">Option Topic</a>
</li></ul>
<p />
Threshold for declaring motion. The threshold is the number of changed pixels counted after noise filtering, masking, despeckle, and labelling.
<p />
The 'threshold' option is the most important detection setting. When motion runs it compares the current image frame with the previous and counts the number of changed pixels after having processed the image with noise filtering, masking, despeckle and labeling. If more pixels than defined by 'threshold' have changed we assume that we have detected motion. Set the threshold as low as possible so that you get the motion you want detected but large enough so that you do not get detections from noise and plants moving. Note that the larger your frames are, the more pixels you have. So for large picture frame sizes you need a higher threshold.
<p />
Use the -s (setup mode) command line option and/or the text_changes config file option to experiment to find the right threshold value. If you do not get small movements detected (see the mouse on the kitchen floor) lower the value. If motion detects too many birds or moving trees, increase the number. Practical values would be from a few hundred to 2000 indoors and 1000-10000 outdoors.
<p />
<p />
<p />
<p />
<h3><a name="threshold_tune"></a> threshold_tune </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThresholdTune">Option Topic</a>
</li></ul>
<p />
Activates the automatic tuning of threshold level. ( It's broken )
<p />
This feature makes Motion continuously adjust the threshold for declaring motion.
<p />
The <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> setting is ignored when activating this feature. It may give different results depending on your camera, light conditions, indoor/outdoor, the motion to be detected etc. If it does not work well, deactivate the 'threshold_tune' option and use the manual setting of <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThreshold">threshold</a> instead.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Image_File_Output"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ImageFileOutput">Image File Output</a> </h2>
The following options controls how Motion generates images when detection motion.
<p />
<p />
<p />
<h3><a name="output_motion"></a> output_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputMotion">Option Topic</a>
</li></ul>
<p />
Output pictures with only the moving object. This feature generates the special motion type movies where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red.
<p />
Motion images shows the motion content of the pictures. This is good for tuning and testing but probably not very interesting for the general public.
<p />
Default is not to store motion images. Motion pictures are stored the same place and with the same filename as normal motion triggered pictures except they have an "m" appended at the end of the filename before the .jpg or .ppm. E.g. the name can be 01-20020424232936-00m.jpg.
<p />
<p />
<p />
<p />
<h3><a name="output_normal"></a> output_normal </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: on, off, first, best, center (since 3.2.10)
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOutputNormal">Option Topic</a>
</li></ul>
<p />
Normal image is an image that is stored when motion is detected. It is the same image that was taken by the camera. I.e. not a motion image like defined by output_motion. Default is that normal images are stored.
<p />
If you set the value to 'first' Motion saves only the first motion detected picture per event.
<p />
If you set it to "best" Motion saves the picture with most changed pixels during the event. This is useful if you store mpegs on a webserver and want to present a jpeg to show the content of the mpeg on a webpage. "best" requires a little more CPU power and resources compared to "first".
<p />
Picture with motion nearest center of picture is saved when set to 'center' (since 3.2.10).
<p />
Set to 'off' to not write pictures (jpeg or ppm).
<p />
<p />
<p />
<p />
<h3><a name="ppm"></a> ppm </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPpm">Option Topic</a>
</li></ul>
<p />
Output ppm images instead of jpeg. This uses less CPU time, but causes a LOT of hard disk I/O, and it is generally slower than jpeg.
<p />
The recommendation is to always use jpg except if you have a specific need to store high quality pictures without any quality loss. For web cameras you should always choose jpg. Note that the built in webcam server requires that this parameter is set to off.
<p />
<p />
<p />
<p />
<h3><a name="quality"></a> quality </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 75
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionQuality">Option Topic</a>
</li></ul>
<p />
The quality for the jpeg images in percent.
<p />
100 means hardly compressed. A small number means a much smaller file size but also a less nice quality image to look at. 50 is a good compromise for most.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Tuning_Motion"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TuningMotion">Tuning Motion</a> </h2>
<p />
Motion 3.2 introduces a new feature Setup Mode. This is a great new feature with really make tuning all the settings of Motion much more easy and transparent. In setup mode two things happen:
<p /> <ol>
<li> With 'motion -s' Motion runs in console mode instead of daemon. It outputs a lot of useful information for each frame from the camera. Each message is prefixed by [number] where number is the camera number (thread number).
</li> <li> When you look at the mjpeg webcam stream you see a black image with numbers. What you see is the number of changed pixels, number of labeled areas and noise setting. When something moves you see the pixels detected as Motion in black and white. The largest labelled area (assuming despeckle is enabled and with the 'l' at the end) is blue. It is only the blue areas which is counted as Motion. If smartmask is enabled you see this as red areas.
</li></ol>
<p />
Here is a suggestion how to initially setup Motion.
<p /> <ul>
<li> Disable despeckle (comment it out in motion.conf).
</li> <li> Disable smartmask
</li> <li> Enable both http control and webcam by setting port numbers. Example 8080 for control and 8081 for webcam.
</li> <li> Start Motion in setup mode
</li> <li> View the webcam stream. Either with Cambozola or with Firefox. <a href="http://localhost:8081/" rel="nofollow" target="_top">http://localhost:8081/</a> Firefox often needs to reload the page before it works. Bug in Firefox. Internet Explorer cannot show the stream unless you make a webpage on your Apache with Cambozola applet.
</li> <li> Open new browser window and connect to the http interface. <a href="http://localhost:8080/" rel="nofollow" target="_top">http://localhost:8080/</a> . You can now control and change almost anything while Motion is running. You cannot resize the image. That was too hard to code. To disable a feature enter a space.
</li> <li> Start by experimenting with noise level. Do this both during daylight and during darkness. You will be surprised to see how much noise a camera makes during night. Try using the automatic noise feature. It should work for most.
</li> <li> Now try the despeckle feature. Enable it using the recommended default EedDl. If this is not enough experiment. Remember that the l must be the last letter. It is fun to play with.
</li> <li> Set the threshold to what you want to trigger Motion.
</li></ul>
<p />
In normal mode you can use the same setting with two browser windows and experiment with settings of the camera if needed.
<p />
From the web interface you can ask Motion to write all your changes back to the config files (motion.conf and thread config files). It will even tidy them up for you so they look nice.
<p />
There are two sets of options to adjust. <ul>
<li> The options that controls the camera device: See <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/CaptureDeviceOptions">CaptureDeviceOptions</a>
</li> <li> The options that controls the actual motion detection: <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionDetectionSettings">MotionDetectionSettings</a>
</li></ul>
<p />
<hr />
<p />
Normal picture frame
<p />
<img alt="outputnormal1.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/TuningMotion/outputnormal1.jpg" />
<p />
<hr />
Motion type picture frame with despeckle. Note that the largest area is blue and only this is counted as Motion.
<p />
The Motion image shows how Motion maintains a "reference frame" which is not just the last picture frame but a matematical calculation of the past images. This enlarges real Motion and ensures that it is not easy to sneak in slowly.
<p />
<img alt="outputmotion1.jpg" src="http://www.lavrsen.dk/foswiki/pub/Motion/TuningMotion/outputmotion1.jpg" />
<hr />
<p />
<p />
<h2><a name="Generating_MPEG_films_with_ffmpe"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MpegFilmsFFmpeg">Generating MPEG films with ffmpeg</a> </h2>
The ffmpeg option can generate mpeg films very fast and "on the fly". This means that the mpeg film is growing each time motion is detected.
<p />
Some people on the Motion mailing list have had trouble building the ffmpeg package because they did not have the NASM assembler package installed. So pay attention to this if you run into problems.
<p />
ffmpeg exists as binary packages for most distributions including RPMs and debian packages.
<p />
Ffmpeg is an interesting project. The releases have not been very consistent over time. The official releases are out of date now. So we are forced to take our chance and checkout a version from their CVS server and hope that we are lucky in getting a version that works. See <a href="http://ffmpeg.sourceforge.net" rel="nofollow" target="_top">ffmpeg project page</a>. We encourage the maintaners of such an important project to introduce better release schedules in the near future for the benefit of opensource software.
<p />
In order to help people finding a version of ffmpeg that works we have started testing the Motion package with a selection of binaries and a CVS snapshot. The CVS source snapshot of ffmpeg which is certified with Motion is available on the <a href="http://sourceforge.net/project/showfiles.php?group_id=13468&package_id=116390" rel="nofollow" target="_top">Related projects file area on the Motion Sourceforge project</a>
<p />
Motion works with the following versions of ffmpeg: <ul>
<li> ffmpeg-0.4.8. With this release Motion supports mpeg1, mpeg4 and msmpeg4. Lately newer distributions have problems building this 2003 release of ffmpeg so many of you no longer have this option.
</li> <li> ffmpeg-0.4.9pre1. Is supported starting from Motion version 3.1.18. With this release Motion supports mpeg4 and msmpeg4 but not mpeg1. The reason is that the ffmpeg team has decided no longer to support non-standard framerates in their mpeg1 encoder library. Also ffmpeg-0.4.9pre1 gives people problems on newer distributions.
</li> <li> ffmpeg from CVS. This may work. We cannot continuously monitor and try every time a new source file is checked into ffmpeg. You will have to try.
</li> <li> ffmpeg RPMs. Currently each Motion release is tested with the current Livna ffmpeg rpm package for Fedora. See the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/DownloadFiles">Download Files</a> page for direct links to the version which has been certified with the latest Motion release.
</li> <li> ffmpeg debian binaries. Latest versions from the debian repository for Debian Sarge works fine with Motion.
</li> <li> Certified ffmpeg CVS snapshot for latest Motion release is available from the <a href="http://sourceforge.net/project/showfiles.php?group_id=13468&package_id=116390" rel="nofollow" target="_top">Motion Sourceforge Related Projects file area</a>
</li></ul>
<p />
The timelapse feature always runs mpeg1 with both ffmpeg 0.4.8 and 0.4.9 and newer. Motion simply creates the timelapse film with a standard mpeg1 framerate. <font color="#ff0000"> Note : maximum size for timelapse files is 2GB. </font>
<p />
In principle Motion can be made to support many other formats. It requires additional coding in Motion. You are welcome to submit <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionPatches">patches</a>. All ffmpeg related code is in the source file ffmpeg.c. It is not trivial to do because the ffmpeg libraries not documented at all. All you have is a couple of code examples.
<p />
To build ffpmeg from source follow these steps:
<p />
Download the ffmpeg and untar it to /usr/local/ffmpeg. Then it should be a simple matter of entering the ffmpeg directory and run the commands
<p />
<pre>
cd /usr/local/ffmpeg
./configure --enable-shared
make
make install
</pre>
<p />
This creates the <code>libavcodec.so</code> and <code>libavformat.so</code> libraries under <code>/usr/local/lib</code> and header files under <code>/usr/local/include/ffmpeg</code>.
<p />
You probably need to do one more step.
<p />
Make sure you have 'root' privileges for the next steps.
<p />
Open the file <code>/etc/ld.so.conf</code> in your favorite text editor.
<p />
Add this line of text if it is not already there - otherwise go to the next step (ldconfig).
<p />
<code>/usr/local/lib</code>
Run the command <code>ldconfig</code>.
<p />
Motion should now be able to find the shared libraries for ffmpeg (<code>libavcodec.so</code> and <code>libavformat.so</code>) in <code>/usr/local/lib</code>.
<p />
You can also find a pre-compiled binary package (e.g. rpm or deb) and install this. Normally an rpm will place the <code>libavcodec.so</code> under <code>/usr/lib</code>.
There are various RPMs available from different repositories. Some need additional RPMs that are actually not needed by Motion but need to be installed to satisfy dependencies. The editor has tried different RPMs of ffmpeg-0.4.8 and they all seem to work.
<p />
Motion then need to be built by running <code>./configure</code>, <code>make</code> and <code>make install</code>.
(Note that with earlier versions of motion you had to specify the location of libavcodec. Now configure searches for the shared library in <code>/usr/lib</code> and <code>/usr/local/lib</code> by default.)
<p />
Note that if you install ffmpeg from source and already have ffmpeg installed from an RPM, the Motion configure may very well find the binary library from the rpm instead of the sources. Make sure to uninstall any old ffmpeg RPMs before you install ffmpeg from sources.
<p />
<strong>These are the config file options related to ffmpeg.</strong>
<p />
<p />
<p />
<h3><a name="ffmpeg_bps"></a> ffmpeg_bps </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 9999999
</li> <li> Default: 400000
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegBps">Option Topic</a>
</li></ul>
<p />
Bitrate of mpegs produced by ffmpeg. Bitrate is bits per second. Default: 400000 (400kbps). Higher value mans better quality and larger files. Option requires that ffmpeg libraries are installed.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>.
<p />
Experiment to get the desired quality. The better quality the bigger files. This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled).
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_cap_motion"></a> ffmpeg_cap_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegCapMotion">Option Topic</a>
</li></ul>
<p />
Use ffmpeg libraries to encode motion type mpeg movies where you only see the pixels that changes.
<p />
Works like ffmpeg_cap_new but outputs motion pixel type pictures instead.
<p />
This feature generates the special motion type movie where you only see the pixels that changes as a graytone image. If labelling is enabled you see the largest area in blue. Smartmask is shown in red. The filename given is the same as the normal mpegs except they have an 'm' appended after the filename before the .mpg. E.g. 20040424181525m.mpg
<p />
To use this feature you need to install the FFmpeg Streaming Multimedia System
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_cap_new"></a> ffmpeg_cap_new </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegCapNew">Option Topic</a>
</li></ul>
<p />
Use ffmpeg libraries to encode mpeg movies in realtime.
<p />
Generates a new film at the beginning of each new event and appends to the film for each motion detected within the same event. The current event ends when the time defined by the 'gap' option has passed with no motion detected. At the next detection of motion a new mpeg film is started.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
Must not be included in config file without having ffmpeg installed.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_deinterlace"></a> ffmpeg_deinterlace </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegDeinterlace">Option Topic</a>
</li></ul>
<p />
Use ffmpeg to deinterlace video. Necessary if you use an analog camera and see horizontal combing on moving objects in video or pictures.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
Must not be included in config file without having ffmpeg installed.
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_timelapse"></a> ffmpeg_timelapse </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapse">Option Topic</a>
</li></ul>
<p />
Create a timelapse movie saving a picture frame at the interval in seconds set by this parameter. Set it to 0 if not used.
<p />
This feature uses ffmpegs libavcodec to encode a timelaps movie saving a picture frame at the interval in seconds set by this parameter. Setting this option to 0 disables it.
<p />
The feature gives your viewer the chance to watch the day pass by. It makes a nice effect to film flowers etc closeup during the day. Options like frame_rate, snapshot, gap etc have no impact on the ffmpeg timelapse function.
<p />
Note that the timelapse format is always mpeg1 independent of ffmpeg_video_codec. This is because mpeg1 allows the timelapse to stop and the file to be reopened and more film appended.
<p />
To use this feature you need to install the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>.
<p />
(renamed from ffmpeg_timelaps to ffmpeg_timelapse in 3.1.14)
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_timelapse_mode"></a> ffmpeg_timelapse_mode </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual
</li> <li> Default: daily
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapseMode">Option Topic</a>
</li></ul>
<p />
The file rollover mode of the timelapse video.
<p />
Note that it is important that you use the conversion specifiers in ffmpeg_filename that ensure that the new timelapse file indeed is a new file. If the filename does not change Motion will simply append the timelapse pictures to the existing file.
<p />
The value 'Manual' means that Motion does not automatically rollover to a new filename. You can do it manually using the http control interface by setting the option 'ffmpeg_timelapse' to 0 and then back to your chosen value. Value 'hourly' rolls over on the full hour. Value 'daily' which is the default rolls over at midnight. There are two weekly options because depending on where you come from a week may either start on Sunday or Monday. And 'monthly' naturally rolls over on the 1st of the month.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_variable_bitrate"></a> ffmpeg_variable_bitrate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0, 2 - 31
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVariableBitrate">Option Topic</a>
</li></ul>
<p />
Enables and defines variable bitrate for the ffmpeg encoder. ffmpeg_bps is ignored if variable bitrate is enabled. Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, or the range 2 - 31 where 2 means best quality and 31 is worst.
<p />
Experiment for the value that gives you the desired compromise between size and quality.
<p />
<p />
<p />
<p />
<h3><a name="ffmpeg_video_codec"></a> ffmpeg_video_codec </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: mpeg1 (ffmpeg-0.4.8 only), mpeg4, msmpeg4, swf, flv, ffv1, mov
</li> <li> Default: mpeg4
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegVideoCodec">Option Topic</a>
</li></ul>
<p />
Codec to be used by ffmpeg for the video compression. Timelapse mpegs are always made in mpeg1 format independent from this option.
<p /> <ul>
<li> mpeg1 - gives you mpeg1 files with extension .mpg. It is only supported by the old ffmpeg version 0.4.8. The ffmpeg team decided no longer to support non-standard framerates for mpeg1 from ffmpeg version 0.4.9pre1.
</li> <li> mpeg4 - gives you mpeg4 files with extension .avi
</li> <li> msmpeg4 - also gives you mpeg4 files. It is s recommended for use with Windows Media Player because it requires with no installation of codec on the Windows client.
</li> <li> swf - gives you a flash film with extension .swf
</li> <li> flv - gives you a flash video with extension .flv
</li> <li> ffv1 - FF video codec 1 for Lossless Encoding (experimental)
</li> <li> mov - QuickTime (since 3.2.10).
</li></ul>
<p />
This option does not affect the timelapse feature. Timelapse is always recorded in mpeg1 format because we need to be able to append to an existing file. mpeg4 does not easily allow this.
<p />
<p />
<p />
<hr />
<p />
See also the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a> where the two additional options <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">ffmpeg_filename</a> and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">timelapse_filename</a> are defined.
<p />
If you want to use this feature you can read about the <a href="http://ffmpeg.sourceforge.net/" rel="nofollow" target="_top">FFmpeg Streaming Multimedia System</a>
<p />
<p />
<h2><a name="Snapshots_The_Traditional_Period"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/SnapshotsWebCam">Snapshots - The Traditional Periodic Web Camera</a> </h2>
Motion can also act like a traditional web camera.
<p />
<p />
<p />
<h3><a name="snapshot_interval"></a> snapshot_interval </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotInterval">Option Topic</a>
</li></ul>
<p />
Make automated snapshots every 'snapshot_interval' seconds.
<p />
The snapshots are stored in the target directory + the directory/filename specified by the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> option.
<p />
This is the traditional web camera feature where a picture is taken at a regular interval independently of motion in the picture.
<p />
<p />
<p />
See the also <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">snapshot_filename</a> option in the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a>.
<p />
<p />
<h2><a name="Text_Features"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TextFeatures">Text Features</a> </h2>
Text features are highly flexible. You can taylor the text displayed on the images and films to your taste and you can add your own user defined text.
<p />
This is how the overlayed text is located.
<p />
<table border="1" width="354">
<tr>
<td width="344">
<table cellpadding="0" cellspacing="0" width="344">
<tr>
<td width="216">
<p> <br><br><br><br><br><br> </p>
</td>
<td width="128">
<p align="right"> CHANGES<br><br><br><br><br><br> </p>
</td>
</tr>
<tr>
<td width="216">
<p><br><br>TEXT_LEFT</p>
</td>
<td width="128">
<p align="right">TEXT_RIGHT<br>YYYY-MM-DD<br>HH:MM:SS </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p />
You are allowed to put the text in quotation marks. This allows you to use leading spaces. By combining spaces and new lines '\n' you can place your text anywhere on the picture. Experiment to find your preferred look. When setting the text using http remote control the text must be URL encoded. The browser does this for you. If you need to set it with a command line tool, use a browser first and let it make the encoded URL for you. Then you can copy paste it to your script file or cron line or whatever you want to use.
<p />
Below are the options that controls the display of text. The 'locate' option is not a text feature but described here because it is related to information overlayed on the output images.
<p />
The <code>text_event</code> feature is special in that it defines the conversion specifier %C which can be used both for text display and for filenames.
<p />
<p />
<p />
<h3><a name="locate"></a> locate </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off, preview
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLocate">Option Topic</a>
</li></ul>
<p />
Locate and draw a box around the moving object. Value 'preview' makes Motion only draw a box on a saved preview jpeg image and not on the saved mpeg movie.
<p />
The value 'preview' only works when 'output_normal' is set to either 'first' or 'best'.
<p />
<p />
<p />
<p />
<h3><a name="text_changes"></a> text_changes </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextChanges">Option Topic</a>
</li></ul>
<p />
Turns the text showing changed pixels on/off.
<p />
By setting this option to 'on' the number of pixels that changed compared to the reference frame is displayed in the upper right corner of the pictures. This is good for calibration and test. Maybe not so interesting for a greater public. Set it to your personal taste.
<p />
<p />
<p />
<p />
<h3><a name="text_double"></a> text_double </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li></ul>
<p />
Draw characters at twice normal size on images.
<p />
This option makes the text defined by text_left, text_right and text_changes twice the normal size. This may be useful when using large picture formats such as 640 x 480.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="text_event"></a> text_event </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %Y%m%d%H%M%S
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextEvent">Option Topic</a>
</li></ul>
<p />
This option defines the value of the speciel event conversion specifier %C. You can use any conversion specifier in this option except %C. Date and time values are from the timestamp of the first image in the current event.
<p />
The idea is that %C can be used filenames and text_left/right for creating a unique identifier for each event.
<p />
Option text_event defines the value %C which then can be used in filenames and text_right/text_left. The text_event/%C uses the time stamp for the first image detected in a new event. %C is an empty string when no event is in progress (gap period expired). Pre_captured and minimum_motion_frames images are time stamped before the event happens so %C in text_left/right does not have any effect on those images.
<p />
<p />
<p />
<p />
<h3><a name="text_left"></a> text_left </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextLeft">Option Topic</a>
</li></ul>
<p />
User defined text overlayed on each in the lower left corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %).
<p />
text_left is displayed in the lower left corner of the pictures. If the option is not defined no text is displayed at this position.
<p />
You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
<p />
<strong>Detailed Description</strong>
<p />
A conversion specifier is a code that starts by % (except newline which is \n). The <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features.
<p />
For a full list of conversion specifiers see the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> for Advanced Filename and Text Feature.
<p />
<p />
<p />
<p />
<p />
<h3><a name="text_right"></a> text_right </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %Y-%m-%d\n%T
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextRight">Option Topic</a>
</li></ul>
<p />
User defined text overlayed on each in the lower right corner. Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > , . : - + _ \n and vertical bar and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes starting by a %). Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
<p />
text_right is displayed in the lower right corner of the pictures. If the option is not defined no text is displayed at this position.
<p />
You can place the text in quotation marks to allow leading spaces. With a combination is spaces and newlines you can position the text anywhere on the picture.
<p />
A major difference from text_left is that if this option is undefined the default is %Y-%m-%d\n%T which displays the date in ISO format YYYY-MM-DD and below the time in 24 hour clock HH:MM:SS.
<p />
<strong>Detailed Description</strong>
<p />
A conversion specifier is a code that starts by % (except newline which is \n). The <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
With a combination of text, spaces, new lines \n and conversion specifiers you have some very flexible text features.
<p />
For a full list of conversion specifiers see the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> for Advanced Filename and Text Feature.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Advanced_Filenames"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/AdvancedFilenames">Advanced Filenames</a> </h2>
Motion has a very advanced and flexible automated filenaming feature.
<p />
By using <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> (codes that consist of a '%' followed by a letter) you can build up the filenames including sub directories for pictures and movies using any combination of letters, numbers and conversion specifiers which are codes that represents time, date, event number and frame numbers.
<p />
The option <code>target_dir</code> is the target directory for all snapshots, motion images and normal images. The default is the current working directory (current working directory of the terminal from which motion was started). You will normally always want to specify this parameter.
<p />
Note that the options <code>snapshot_filename</code>, <code>jpeg_filename</code>, <code>ffmpeg_filename</code>, and <code>timelapse_filename</code> all allow specifying directories by using '/' in the filename. These will all be relative to <code>target_dir</code>. This means in principle that you can specify <code>target_dir</code> as '/' and be 100% flexible. It also means that Motion can write files all over your harddisk if you make a mistake. It is recommended to specify the <code>target_dir</code> as deep or detailed as possible for this reason. And note that <code>targer_dir</code> does not allow conversion specifiers.
<p />
The conversion specifier %C which is defined by the option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> is interesting in connection with filenames because it can be used to create files and directories for each event in a very flexible way.
<p />
The convertion specifier %t (thread/camera number) is also very useful. Here is an example of filename definitions in motion.conf:
<p />
<pre>
target_dir /usr/local/webcam
snapshot_filename cam%t/%v-%Y%m%d%H%M%S-snapshot
jpeg_filename cam%t/%v-%Y%m%d%H%M%S-%q
ffmpeg_filename cam%t/%v-%Y%m%d%H%M%S
timelapse_filename cam%t/%Y%m%d%H-timelapse
</pre>
<p />
The smart thing is that this defines the filename of all your camera threads in motion.conf so you do not need to specify target dir and filenames in the thread config files. In the above example an mpegfile for camera thread 3 will be saved as a filename similar to <code>/usr/local/webcam/cam3/28-20051128130840.avi</code>
<p />
NOTE: Unless you use the <code>minimum_gap</code> option to limit the number of shots to less then one per second - you must use the frame modifier %q as part of the <code>jpeg_filename</code>. Otherwise the pictures saved within the same second will overwrite each other. The %q in <code>jpeg_filename</code> ensures that each jpeg (or ppm) picture saved gets a unique filename.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that the flexibility of this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can alter the values of these options and save files anywhere on your server with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> Anyone with local access to the computer and edit rights to the motion.conf file can alter the values of these options and save files anywhere on your server with the same privileges as the user running Motion. Make sure the motion.conf file is maximum readonly to anyone else but the user running Motion.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root.
</li></ul>
<p />
<strong>These are the advanced filename options in motion.conf</strong>
<p />
<p />
<p />
<h3><a name="ffmpeg_filename_now_called_movie"></a> ffmpeg_filename (now called movie_filename) </h3>
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> <font color="#ff0000">This option was renamed to <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMovieFilename">movie_filename</a> in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution.</font>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This option was renamed to movie_filename in 3.2.5 to enable better integration of alternative movie libraries to the current ffmpeg solution.
<p />
Default value is equivalent to legacy 'oldlayout' option
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S
<p />
File extension .mpg or .avi is automatically added so do not include this.
<p />
This option uses <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for 'oldlayout on' and %Y/%m/%d/%H%M%S for 'oldlayout off'.
<p />
<p />
<p />
<p />
<h3><a name="jpeg_filename"></a> jpeg_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S-%q
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionJpegFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered images (jpeg or ppm) relative to target_dir. Value 'preview' makes a jpeg filename with the same name body as the associated saved mpeg movie file.
<p />
Default value is equivalent to legacy 'oldlayout' option. For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-%q
<p />
This option uses <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-%q for 'oldlayout on' and %Y/%m/%d/%H/%M/%S-%q for 'oldlayout off'.
<p />
The value 'preview' only works when 'output_normal' is set to 'best'. It makes Motion name the best preview jpeg file (image with most changed pixels during the event) with the same body name as the mpeg movie created during the same event. The purpose is to create a good single image that represents the saved mpeg moview so you can decide if you want to see it and spend time downloading it from a web page.
<p />
<p />
<p />
<p />
<h3><a name="movie_filename"></a> movie_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMovieFilename">Option Topic</a>
</li></ul>
<p />
File path for motion triggered ffmpeg movies (mpeg) relative to target_dir. This was previously called ffmpeg_filename.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> This option was renamed from ffmpeg_filename to movie_filename in Motion 3.2.5.
<p />
Default value is equivalent to legacy 'oldlayout' option
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H%M%S
<p />
File extension .mpg or .avi is automatically added so do not include this.
<p />
This option uses <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S for 'oldlayout on' and %Y/%m/%d/%H%M%S for 'oldlayout off'.
<p />
<p />
<p />
<p />
<h3><a name="snapshot_filename"></a> snapshot_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d%H%M%S-snapshot
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSnapshotFilename">Option Topic</a>
</li></ul>
<p />
File path for snapshots (jpeg or ppm) relative to target_dir.
<p />
Default value is equivalent to legacy 'oldlayout' option. For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d/%H/%M/%S-snapshot
<p />
File extension .jpg or .ppm is automatically added so do not include this
A symbolic link called lastsnap.jpg (or lastsnap.ppm) created in the target_dir will always point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
<p />
This option uses <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d%H%M%S-snapshot for 'oldlayout on' and %Y/%m/%d/%H/%M/%S-snapshot for 'oldlayout off'.
<p />
For the equivalent of the now obsolete option 'snap_overwrite' use the value 'lastsnap'.
<p />
<p />
<p />
<p />
<h3><a name="target_dir"></a> target_dir </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined = current working directory
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTargetDir">Option Topic</a>
</li></ul>
<p />
Target directory for picture and movie files.
<p />
This is the target directory for all snapshots, images files and movie files. The default is the current working directory (current working directory of the terminal from which motion was started). You will normally always want to specify this parameter as an absolute path.
<p />
Note that the options snapshot_filename, jpeg_filename, ffmpeg_filename, and timelapse_filename all allows specifying directories. These will all be relative to 'target_dir'. This means in principle that you can specify target_dir as '/' and be 100% flexible. It also means that Motion can write files all over your harddisk if you make a mistake. It is recommended to specify the target_dir as deep or detailed as possible for this reason.
<p />
<p />
<p />
<p />
<h3><a name="timelapse_filename"></a> timelapse_filename </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: %v-%Y%m%d-timelapse
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTimelapseFilename">Option Topic</a>
</li></ul>
<p />
File path for timelapse mpegs relative to target_dir (ffmpeg only).
<p />
Default value is equivalent to legacy 'oldlayout' option.
<p />
For Motion 3.0 compatible mode (directories based on date and time) choose: %Y/%m/%d-timelapse
<p />
File extension .mpg is automatically added so do not include this.
<p />
This option uses <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> which are codes that start by % and then a letter. The conversion specifiers used has the same function as for the C function strftime (3). The most commonly used are: <ul>
<li> %Y = year
</li> <li> %m = month as two digits
</li> <li> %d = date
</li> <li> %H = hour
</li> <li> %M = minute
</li> <li> %S = second
</li> <li> %T = HH:MM:SS
</li></ul>
<p />
These are unique to motion <ul>
<li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i = width of motion area
</li> <li> %J = height of motion area
</li> <li> %K = X coordinate of motion center
</li> <li> %L = Y coordinate of motion center
</li> <li> %C = value defined by text_event
</li></ul>
<p />
If you are happy with the directory structures the way they were in earlier versions of motion use %v-%Y%m%d-timelapse for 'oldlayout on' and %Y/%m/%d-timelapse for 'oldlayout off'.
<p />
<p />
<p />
<p />
<p />
<h2><a name="Conversion_Specifiers_for_Advanc"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers for Advanced Filename and Text Features</a> </h2>
The table below shows all the supported Conversion Specifiers you can use in the options <code>text_event</code>, <code>text_left</code>, <code>text_right</code>, <code>sql_query</code>, <code>snapshot_filename</code>, <code>jpeg_filename</code>, <code>ffmpeg_filename</code>, <code>timelapse_filename</code>, <code>on_event_start</code>, <code>on_event_end</code>, <code>on_picture_save</code>, <code>on_movie_start</code>, <code>on_movie_end</code>, and <code>on_motion_detected</code>.
<p />
In <code>text_left</code> and <code>text_right</code> you can additionally use '\n' for new line.
<p />
<table cellspacing="0" id="table12" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=12;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Conversion Specifier</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=12;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Description</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %a </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The abbreviated weekday name according to the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %A </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The full weekday name according to the current locale. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %b </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The abbreviated month name according to the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %B </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The full month name according to the current locale. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %c </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred date and time representation for the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %C </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Text defined by the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTextEvent">text_event</a> feature </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %d </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the month as a decimal number (range 01 to 31). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %D </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Number of pixels detected as Motion. If labelling is enabled the number is the number of pixels in the largest labelled motion area. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %E </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Modifier: use alternative format, see below. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %f </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> File name - used in the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a>, and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> features. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %F </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Equivalent to %Y-%m-%d (the ISO 8601 date format). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %H </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour as a decimal number using a 24-hour clock (range 00 to 23). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %i </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Width of the rectangle containing the motion pixels (the rectangle that is shown on the image when <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> is on). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %I </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour as a decimal number using a 12-hour clock (range 01 to 12). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %j </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the year as a decimal number (range 001 to 366). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %J </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Height of the rectangle containing the motion pixels (the rectangle that is shown on the image when <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionLocate">locate</a> is on). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %k </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %K </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> X coordinate in pixels of the center point of motion. Origin is upper left corner. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %l </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.) </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %L </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Y coordinate in pixels of the center point of motion. Origin is upper left corner and number is positive moving downwards (I may change this soon). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %m </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The month as a decimal number (range 01 to 12). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %M </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The minute as a decimal number (range 00 to 59). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %n </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Filetype as used in the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">on_picture_save</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">on_movie_start</a>, <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a>, and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> features. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %N </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Noise level. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %o </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Threshold. The number of detected pixels required to trigger motion. When <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionThresholdTune">threshold_tune</a> is 'on' this can be used to show the current tuned value of threshold. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %p </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %P </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Like %p but in lowercase: `am' or `pm' or a corresponding string for the current locale. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %q </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Picture frame number within current second. For jpeg filenames this should always be included in the filename if you save more then 1 picture per second to ensure unique filenames. It is not needed in filenames for mpegs. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %Q </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Number of detected labels found by the despeckle feature </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %r </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in a.m. or p.m. notation. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %R </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in 24-hour notation (%H:%M). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %s </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %S </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The second as a decimal number (range 00 to 61). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %t </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Thread number (camera number) </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %T </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time in 24-hour notation (%H:%M:%S). </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %u </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %U </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %v </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> Event number. An event is a series of motion detections happening with less than 'gap' seconds between them. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %V </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also %U and %W. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %w </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %W </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %x </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred date representation for the current locale without the time. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %X </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The preferred time representation for the current locale without the date. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %y </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The year as a decimal number without a century (range 00 to 99). </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %Y </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The year as a decimal number including the century. </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol"> %z </td>
<td bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol"> The time-zone as hour offset from GMT. </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> %Z </td>
<td bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> The time zone or name or abbreviation. </td>
</tr>
</tbody></table>
<p />
<p />
<h2><a name="Webcam_Server"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebcamServer">Webcam Server</a> </h2>
Motion has simple webcam server built in. The video stream is in mjpeg format.
<p />
Each thread can have its own webcam server. If you enable the webcam server (option webcam_port to a number different from 0) and you have more than one camera, you must make sure to include webcam_port in each thread config file and set webcam_port to different and unique port numbers or zero (disable). Otherwise each webcam server will use the setting from the motion.conf file and try to bind to the same port. If the webcam_port numbers are not different from each other Motion will disable the webcam feature.
<p />
Note: The webcam server feature requires that the option <code>ppm</code> is set to <strong>off</strong>.
<p />
The <code>webcam_maxrate</code> and <code>webcam_quality</code> options are important to limit the load on your server and link. Don't set them too high unless you only use it on the localhost or on an internal LAN. The option <code>webcam_quality</code> is equivalent to the quality level for jpeg pictures.
<p />
The <code>webcam_limit</code> option prevents people from loading your Network connection by streaming for hours and hours. The options defines the number of picture frames sent as mjpeg Motion will allow without re-connecting (e.g. clicking refresh in the browser).
<p />
The option <code>webcam_localhost</code> is a security feature. When enabled you can only access the webserver on the same machine as Motion is running on. If you want to present a live webcam on your web site this feature must be disabled.
<p />
The webserver generates a stream in "multipart jpeg" format (mjpeg). You cannot watch the stream with most browsers. Only certain versions of Netscape works. Mozilla and Firefox brosers can view the mjpeg stream but you often have to refresh the page once to get the streaming going. Internet Explorer cannot show the mjpeg stream. For public viewing this is not very useful. There exists a java applet called <a href="http://www.charliemouse.com/code/cambozola/" rel="nofollow" target="_top">Cambozola</a> which enabled any Java capable browser to show the stream. To enable the feature to a broad audience you should use this applet or similar.
<p />
To use the webcam feature with Cambozola is actually very simple.
<p />
<strong>1.</strong> Create a html page in which you will want the streamed picture.
<p />
<strong>2.</strong> In the html page include this code
<p />
<pre>
<applet code=com.charliemouse.cambozola.Viewer
archive=cambozola.jar width="320" height="240" style="border-width:1; border-color:gray; border-style:solid;">
<param name=url value="http://www.myurl.com:8081">
</applet>
</pre>
<p />
Where the width and height is the image size of the video stream.
<p />
Replace www.myurl.com:8081 by the real url and port number of your choice.
<p />
<strong>3.</strong> In the same directory you place the cambozola.jar file. No need to build the java applet from source. Simply use the applet in the package.
<p />
<strong>4.</strong> Enable the feature in motion.conf.
<p />
You can also view the live webcam stream using <a href="http://www.mplayerhq.hu/" rel="nofollow" target="_top">MPlayer</a> like this:
<p />
<pre>mplayer -demuxer lavf http://www.myurl.com:8081/stream.mjpg</pre>
<p />
Note that the <code>stream.mjpg</code> part is important, without it you will get a <code>LAVF_check: no clue about this gibberish!</code> error from libavformat.
<p />
<strong>These are the special webcam parameters.</strong>
<p />
<p />
<p />
<h3><a name="webcam_limit"></a> webcam_limit </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 2147483647
</li> <li> Default: 0 (unlimited)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamLimit">Option Topic</a>
</li></ul>
<p />
Limit the number of frames to number frames. After 'webcam_limit' number of frames the connection will be closed by motion. The value 0 means unlimited.
<p />
Number can be defined by multiplying actual webcam rate by desired number of seconds. Actual webcam rate is the smallest of the numbers <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFramerate">framerate</a> and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">webcam_maxrate</a>.
<p />
<p />
<p />
<p />
<h3><a name="webcam_localhost"></a> webcam_localhost </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamLocalhost">Option Topic</a>
</li></ul>
<p />
Limits the access to the webcam to the localhost.
<p />
By setting this to on, the webcam can only be accessed on the same machine on which Motion is running.
<p />
<p />
<p />
<p />
<h3><a name="webcam_maxrate"></a> webcam_maxrate </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 1
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamMaxrate">Option Topic</a>
</li></ul>
<p />
Limit the framerate of the webcam in frames per second. Default is 1. Set the value to 100 for practically unlimited.
<p />
Don't set 'webcam_maxrate' too high unless you only use it on the localhost or on an internal LAN.
<p />
<p />
<p />
<p />
<h3><a name="webcam_motion"></a> webcam_motion </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamMotion">Option Topic</a>
</li></ul>
<p />
If set to 'on' Motion sends slows down the webcam stream to 1 picture per second when no motion is detected. When motion is detected the stream runs as defined by webcam_maxrate. When 'off' the webcam stream always runs as defined by webcam_maxrate.
<p />
Use this option to save bandwidth when there is not anything important to see from the camera anyway.
<p />
Note that this feature was greatly improved from Motion version 3.2.2. Before 3.2.2 the option stopped the webcam stream except when Motion was detected. This made the feature not very useful because it made it difficult to connect to the webcam stream and most mjpeg viewers would timeout and give an error message. From 3.2.2 the feature has been greatly improved and actually quite recommendable.
<p />
<p />
<p />
<p />
<h3><a name="webcam_port"></a> webcam_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamPort">Option Topic</a>
</li></ul>
<p />
TCP port on which motion will listen for incoming connects with its webcam server.
<p />
Note that each camera thread must have its own unique port number and it must also be different from the control_port number.
<p />
A good value to select is 8081 for camera 1, 8082 for camera 2, 8083 for camera 3 etc etc.
<p />
<p />
<p />
<p />
<h3><a name="webcam_quality"></a> webcam_quality </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 1 - 100
</li> <li> Default: 50
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionWebcamQuality">Option Topic</a>
</li></ul>
<p />
Quality setting in percent for the mjpeg picture frames transferred over the webcam connection. Keep it low to restrict needed bandwidth.
<p />
The mjpeg stream consists of a header followed by jpeg frames separated by content-length and boundary string. The quality level defines the size of the individual jpeg pictures in the mjpeg stream. If you set it too high you need quite a high bandwidth to view the stream.
<p />
<p />
<p />
<h2><a name="Remote_Control_with_http"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RemoteControlHttp">Remote Control with http</a> </h2>
<p />
Motion can be remote controlled via a simple http interface. http is the language a normal web browser talks when it requests a web page. The web server answers back with some simple http headers followed by a webpage coded in HTML.
<p />
Most Motion config options can be changed while Motion is running except options related to the size of the captured images and mask files which are loaded only when Motion starts. So only your fantasy sets the limit to what you can change combining cron and the remote control interface for Motion.
<p />
So the most obvious tool to use to remote control Motion is any web browser. All commands are sent using the http GET method which simply means that the information is sent via the URL and maybe a query string. You can use any browser (Firefox, Mozilla, Internet Explorer, Konquerer, Opera etc). You can also use the text based browser lynx to control Motion from a console. It navigates fine through the very simple and minimalistic http control interface of Motion.
<p />
The details about how to control Motion via the URL is described in detail in the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionHttpAPI">Motion http API</a> topic.
<p />
But it is probably simpler to connect to the control port with a browser, navigate to the function you want, and copy the URL from the browser URL entry line. If your <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlPort">control_port</a> is 8080 and you browse from the same machine on which Motion runs simply look up <a href="http://localhost:8080/" rel="nofollow" target="_top">http://localhost:8080/</a> and navigate around. Connecting from a remote machine is done by using a domain name (example <a href="http://mydomain.com:8080/" rel="nofollow" target="_top">http://mydomain.com:8080/</a>) or the IP address of the machine (example <a href="http://192.168.1.4:8080/" rel="nofollow" target="_top">http://192.168.1.4:8080/</a>). The option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">control_localhost</a> must be off to allow connection from a remote machine.
<p />
If you want to use a script or cron to automatically change Motion settings while Motion runs you use a program that can fetch a webpage. We simply just throw away the html page that Motion returns. Programs commonly available on Linux machines are wget and lwp-request. Here is an example of how to start and stop motion detection via cron. These two lines are added to /etc/crontab.
<p />
<pre>
0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null
0 18 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/pause > /dev/null
</pre>
<p />
If you want to use the http remote control from your own software (for example your own PHP front end) you can set the new motion.conf option html_output off. Then Motion answers back with very basic text only and no html around it. A bit like the xmlrpc interface did.
<p />
To remote control Motion from a web pages you can for example use PHP. In PHP it takes this simple code line to send a remote commend to Motion. Here we pause motion detection for camera 2
<p />
<code>readfile('http://localhost:8080/2/detection/pause');</code>
<p />
What happened to XMLRPC?
<p />
XMLRPC is replaced by a simpler http remote control interface. It is still being worked on but it is absolutely useable now and much nicer to work with than xmlrpc. Another advantage is that you do not need to install xmlrpc libraries. It is all written in standard C.
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can alter the values of any options and save files anywhere on your server with the same privileges as the user running Motion. They can execute any command on your computer with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> If you limit control port to localhost you still need to take care of any user logging into the server with any kind of terminal session.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root!!
</li></ul>
<p />
<strong>These are the config file options that control Motion.</strong>
<p />
These must be placed in motion.conf and not in a thread config file.
<p />
<p />
<p />
<h3><a name="control_authentication"></a> control_authentication </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4096 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlAuthentication">Option Topic</a>
</li></ul>
<p />
To protect HTTP Control by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication. This option must be placed in motion.conf and not in a thread config file.
<p />
By setting this to on, the control using http (browser) can only be accessed using login and password ( following the Basic Authentication defined in HTTP RFC).
<p />
<p />
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="control_html_output"></a> control_html_output </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlHtmlOutput">Option Topic</a>
</li></ul>
<p />
Enable HTML in the answer sent back to a browser connecting to the control_port. This option must be placed in motion.conf and not in a thread config file.
<p />
The recommended value for most is "on" which means that you can navigate and control Motion with a normal browser. By setting this option to "off" the replies are in plain text which may be easier to parse for 3rd party programs that control Motion.
<p />
<p />
<p />
<p />
<h3><a name="control_localhost"></a> control_localhost </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlLocalhost">Option Topic</a>
</li></ul>
<p />
Limits the http (html) control to the localhost. This option must be placed in motion.conf and not in a thread config file.
<p />
By setting this to on, the control using http (browser) can only be accessed on the same machine on which Motion is running.
<p />
<p />
<p />
<p />
<h3><a name="control_port"></a> control_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0 (disabled)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionControlPort">Option Topic</a>
</li></ul>
<p />
Sets the port number for the http (html using browser) based remote control. This option must be placed in motion.conf and not in a thread config file.
<p />
This sets the TCP/IP port number to be used for control of motion using http (browser). Port numbers below 1024 normally requires that you have root privileges. Port 8080 is a fine choice of port to use for the purpose.
<p />
<p />
<p />
<p />
-- <a href="http://www.lavrsen.dk/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> - 12 Apr 2005
<p />
<h2><a name="External_Commands"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ExternalCommands">External Commands</a> </h2>
Motion can execute external commands based on the motion detection and related events. They are all described in this section. The option <code>quiet</code> is also included in this section.
<p />
A redesign of the external commands was due. They were not very easy to understand, not all were flexible enough and some were missing. So a new external command feature set was made for 3.2.1 and on.
<p />
This is how the new script commands look like:
<p />
<table cellspacing="0" id="table13" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th bgcolor="#687684" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=0;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Function</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol1"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=1;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Old Option</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol2"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=2;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">New Option</font></a> </th>
<th bgcolor="#687684" valign="top" class="foswikiTableCol3 foswikiLastCol"> <a rel="nofollow" href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument;sortcol=3;table=13;up=0#sorted_table" title="Sort by this column"><font color="#ffffff">Argument Appended</font></a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Start of event (first motion) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> execute </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_event_start </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> None </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> End of event (no motion for gap seconds) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> <em>New!</em> </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2"> on_event_end </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol"> None </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Picture saved (jpg or ppm) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> onsave </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_picture_save </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of picture </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Movie starts (mpeg file opened) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1"> onmpeg </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2"> on_movie_start </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of movie </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Movie ends (mpeg file closed) </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol1"> onffmpegclose </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol2"> on_movie_end </td>
<td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol"> Filename of movie </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> Motion detected (each single frame with Motion detected) </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol1 foswikiLast"> <em>New!</em> </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol2 foswikiLast"> on_motion_detected </td>
<td bgcolor="#edf4f9" valign="top" class="foswikiTableCol3 foswikiLastCol foswikiLast"> None </td>
</tr>
</tbody></table>
<p />
Mail and sms has been removed because they were not configurable. If you want to send event-based mails or sms, just use one of those commands above and send the mail from that script. See <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument#MailSMS" class="foswikiCurrentTopicLink">What happened to mail and sms?</a>
<p />
<p />
<img src="http://www.lavrsen.dk/foswiki/pub/System/DocumentGraphics/warning.gif" alt="ALERT!" title="ALERT!" width="16" height="16" border="0" /> Security Warning! Note that this feature also means you have to pay attention to the following. <ul>
<li> Anyone with access to the remote control port (http) can execute any command on your computer with the same privileges as the user running Motion. Anyone can access your control port if you have not either limited access to localhost or limited access using firewalls in the server. You should always have a router between a machine running Motion with remote control enabled and the Internet and make sure the Motion control port is not accessible from the outside.
</li> <li> If you limit control port to localhost you still need to take care of any user logging into the server with any kind of GUI or terminal session. All it takes is a browser or single command line execution to change settings in Motion.
</li> <li> It is a good idea to run Motion as a harmless user. Not as root!!
</li></ul>
<p />
<strong>These are the options</strong>
<p />
<p />
<p />
<h3><a name="on_area_detected"></a> on_area_detected </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnAreaDetected">Option Topic</a>
</li></ul>
<p />
Command to be executed when motion in a predefined area is detected. Check option area_detect.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="on_camera_lost"></a> on_camera_lost </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnCameraLost">Option Topic</a>
</li></ul>
<p />
Command to be executed when a camera can't be opened or if it is lost. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command. (new in 3.2.10)
<p />
<!--
Add Additional Description Below
-->
<p />
NOTE: There is situations when motion don't detect a lost camera!<br /> It depends on the driver, some drivers dosn't detect a lost camera at all<br /> Some hangs the motion thread. Some even hangs the PC!
<p />
<p />
<p />
<p />
<h3><a name="on_event_end"></a> on_event_end </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnEventEnd">Option Topic</a>
</li></ul>
<p />
Command to be executed when an event ends after a period of no motion. The period of no motion is defined by option gap. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.
<p />
<p />
<p />
<p />
<h3><a name="on_event_start"></a> on_event_start </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnEventStart">Option Topic</a>
</li></ul>
<p />
Command to be executed when an event starts. An event starts at first motion detected after a period of no motion defined by gap. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">ConversionSpecifiers</a> and spaces as part of the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event starts. I.e. the first motion is detected since the last event.
<p />
This option replaces the former options 'mail', 'sms' and 'execute'.
<p />
<p />
<p />
<p />
<h3><a name="on_motion_detected"></a> on_motion_detected </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMotionDetected">Option Topic</a>
</li></ul>
<p />
Command to be executed when a motion frame is detected. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command.
<p />
Do not write "none" if you do not want to execute commands. Simply do not include the option in the file or comment it out by placing a "#" or ";" as the first character on the line before the execute command.
<p />
<p />
<p />
<h3><a name="on_movie_end"></a> on_movie_end </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">Option Topic</a>
</li></ul>
<p />
Command to be executed when an ffmpeg movie is closed at the end of an event. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script.
<p />
The command is run when an event is over. I.e. the number of seconds defined by the time 'gap' has passed since the last detection of motion and motion closes the mpeg file.
<p />
This option was previously called onffmpegclose.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="on_movie_start"></a> on_movie_start </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieStart">Option Topic</a>
</li></ul>
<p />
Command to be executed when an mpeg movie is created. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the ACL and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/user/bin/perl) as the first line of the script. When you use ffmpeg the film is generated on the fly and on_movie_start then runs when the new mpeg file is created. Often you will want to use the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnMovieEnd">on_movie_end</a> option which runs when the mpeg file is closed and the event is over.
<p />
This option was previously called onmpeg.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="on_picture_save"></a> on_picture_save </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionOnPictureSave">Option Topic</a>
</li></ul>
<p />
Command to be executed when an image is saved. You can use <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">Conversion Specifiers</a> and spaces as part of the command. Use %f for passing filename (with full path) to the command.
<p />
Full path name of the program/script.
<p />
This can be any type of program or script. Remember to set the execution bit in the file access control list (chmod) and if it is a script type program such as perl or bash also remember the shebang line (e.g. #!/usr/bin/perl) as the first line of the script.
<p />
Note that from Motion 3.2.4 the path name of the picture file is no longer appended to the command. Instead you can use the conversion specifier %f to insert the picture filename (full path) anywhere in the command.
<p />
Most common <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
<p />
<p />
<h3><a name="quiet"></a> quiet </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionQuiet">Option Topic</a>
</li></ul>
<p />
Be quiet, don't output beeps when detecting motion.
<p />
Only works in non-daemon mode.
<p />
<p />
<p />
<p />
<a name="MailSMS"></a>
<h3><a name="What_happened_to_mail_and_sms"></a> What happened to mail and sms? </h3>
The 6 new on_xxxxx options replace the former execute, mail and sms options.
<p />
They are quite generic and flexible. These small bash scripts gives to the same functionality as mail and sms BUT you have all the flexibility you want to extend the messages, change the 'from' email address etc.
<p />
<h4><a name="Sending_email_at_start_of_event"></a> Sending email at start of event </h4>
<em>Script written by <a href="http://www.lavrsen.dk/foswiki/bin/view/Main/JoergWeber">JoergWeber</a></em>
<pre>
#!/bin/sh
# Motion sample script to send an e-mail at start of an event.
# Replaces the former 'mail' option.
# Just define this script as 'on_event_start'-script in motion.conf like that:
# on_event_start send_mail "%Y-%m-%d %T"
#change to suit your needs:
#location of 'mail' binary
MAIL="/usr/bin/mail"
#Destination e-mail address
TO="root@localhost"
#Subject of the e-mail
SUBJECT="Motion detected"
#Don't change anything below this line
echo -e "This is an automated message generated by motion.\n\nMotion detected: $1\n\n" | $MAIL -s "$SUBJECT" $TO
</pre>
<p />
<h4><a name="Sending_SMS_at_start_of_event"></a> Sending SMS at start of event </h4>
<em>Script written by <a href="http://www.lavrsen.dk/foswiki/bin/view/Main/JoergWeber">JoergWeber</a></em>
<p />
If you uncomment the line <code>#/usr/local/bin/send_mail $1</code> you can combine both sending email and sms.
<pre>
#!/bin/sh
# Motion sample script to send an sms at start of an event.
# Replaces the former 'sms' option.
# Just define this script as 'on_event_start'-script in motion.conf like that:
# on_event_start send_sms "%Y-%m-%d %T"
#
# If you want to send an e-mail message here as well, just uncomment the last
# line of this script.
#change to suit your needs:
#location of 'sms-client' binary
SMS_CLIENT="/usr/bin/sms_client"
#Destination sms number
TO="12345"
#Don't change anything below this line
$SMS_CLIENT $TO "Motion detected $1"
#/usr/local/bin/send_mail $1
</pre>
<p />
<p />
<p />
<h1><a name="Motion_Guide_Special_Features"></a> Motion Guide - Special Features </h1>
<p />
<h2><a name="Tracking_Control"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/TrackingControl">Tracking Control</a> </h2>
This is still at the experimental stage. Read more about it <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionTracking">motion tracking</a> page.
<p />
<h3><a name="Tracking_Feature_with_Logitech_Q"></a> Tracking Feature with Logitech Quickcam Sphere/Orbit </h3>
Motion supports controlling the pan and tilt feature of a Logitech Quickcam Sphere/Orbit.
<p />
Motion can move the camera to a fixed position given in degrees pan (left-right) and tilt (down-up). Movement can be set with absolute coordinates or relative to current position. There is also an auto tracking feature for the Logitech Quickcam Sphere/Orbit but it is not very mature. It is fun to play with but not very useful yet. See this topic of how <a href="http://www.lavrsen.dk/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> controls his Sphere: <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/LogitechSphereControl">LogitechSphereControl</a>.
<p />
For a detailed description of http remote control see the section <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/RemoteControlHttp">Remote Control with http</a>.
<p />
<strong>List of tracking options</strong>
<p />
<p />
<h3><a name="track_auto"></a> track_auto </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackAuto">Option Topic</a>
</li></ul>
<p />
Enable auto tracking
<p />
Requires a tracking camera type supported by Motion.
<p />
<p />
<p />
<p />
<h3><a name="track_iomojo_id"></a> track_iomojo_id </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackIomojoId">Option Topic</a>
</li></ul>
<p />
Use this option if you have an iomojo smilecam connected to the serial port instead of a general stepper motor controller.
<p />
Only used for iomojo camera.
<p />
<p />
<p />
<p />
<h3><a name="track_maxx"></a> track_maxx </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMaxx">Option Topic</a>
</li></ul>
<p />
The maximum position for servo x.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_maxy"></a> track_maxy </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMaxy">Option Topic</a>
</li></ul>
<p />
The maximum position for servo y.
<p />
Only used for stepper motor tracking.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_motorx"></a> track_motorx </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMotorx">Option Topic</a>
</li></ul>
<p />
The motor number that is used for controlling the x-axis.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_motory"></a> track_motory </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 0
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMotory">Option Topic</a>
</li></ul>
<p />
The motor number that is used for controlling the y-axis.
<p />
Only used for stepper motor tracking.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_move_wait"></a> track_move_wait </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 10
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackMoveWait">Option Topic</a>
</li></ul>
<p />
Delay during which tracking is disabled after auto tracking has moved the camera. Delay is defined as number of picture frames.
<p />
The actual delay is depending on the chosen framerate. If you want the camera to move maximum once every 2 seconds and the framerate is 10 then you need to set the track_move_wait value to 2 * 10 = 20.
<p />
<p />
<p />
<p />
<h3><a name="track_port"></a> track_port </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackPort">Option Topic</a>
</li></ul>
<p />
This is the device name of the serial port to which the stepper motor interface is connected.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_speed"></a> track_speed </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 255
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackSpeed">Option Topic</a>
</li></ul>
<p />
Speed to set the motor to.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_step_angle_x"></a> track_step_angle_x </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0-90
</li> <li> Default: 10
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleX">Option Topic</a>
</li></ul>
<p />
Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras.
<p />
Requires a tracking camera type pwc.
<p />
<p />
<p />
<p />
<h3><a name="track_step_angle_y"></a> track_step_angle_y </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0-40
</li> <li> Default: 10
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepAngleY">Option Topic</a>
</li></ul>
<p />
Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras.
<p />
Requires a tracking camera type pwc.
<p />
<!--
Add Additional Description Below
-->
<p />
<p />
<p />
<p />
<h3><a name="track_stepsize"></a> track_stepsize </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 255
</li> <li> Default: 40
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackStepsize">Option Topic</a>
</li></ul>
<p />
Number of steps to make.
<p />
Only used for stepper motor tracking.
<p />
<p />
<p />
<p />
<h3><a name="track_type"></a> track_type </h3>
<p /> <ul>
<li> Type: Discrete Strings
</li> <li> Range / Valid values: 0 (none), 1 (stepper), 2 (iomojo), 3 (pwc), 4 (generic), 5 (uvcvideo)
</li> <li> Default: 0 (None)
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionTrackType">Option Topic</a>
</li></ul>
<p />
Type of tracker.
<p />
Motion has special tracking options which use either a serial stepper motor controller, an iomojo smile cam or a Philips <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebCam">WebCam</a> driver compatible pan/tilt camera such as the Logitech Quickcam Sphere or Orbit.
<p />
To disable tracking, set this to 0 and the other track options are ignored.
<p />
Value 1 is for the special <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionTracking">Motion Tracking</a> project using a stepper motor and a home made controller.
<p />
Value 2 is for the iomojo smilecam
<p />
Value 3 is for pwc type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit which is driven by the pwc (Philips <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/WebCam">WebCam</a>) driver. To use this camera your version of pwc must be at least 8.12.
<p />
Value 4 is the generic track type. Currently it has no other function than enabling some of the internal Motion features related to tracking. Eventually more functionality will be implemented for this type.
<p />
Value 5 is for uvcvideo type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit MP (new Model) which is driven by the <a href="http://linux-uvc.berlios.de/" rel="nofollow" target="_top">uvcvideo</a> driver. This option was added in Motion 3.2.8.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Using_Databases"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/UsingDatabases">Using Databases</a> </h2>
Motion can be compiled with both MySQL and PostgreSQL database support. When enabled Motion adds a record to a table in the database as specified by the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a>. The query contains the fields that are used and the value are given by using <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a> for dynamic data like filename, time, number of detected pixels etc. Motion does not place any binary images in the database and it cannot remove old records.
<p />
Motion only adds records to the database when files are created. The database contains records of saved files which means to get a record in the database the feature that enables for example motion detection, timelapse, snapshots etc must be enabled. The sql_log options defines which types of files are logged in the database.
<p />
The following sql_log options are common to both MySQL and PostgreSQL.
<p />
<p />
<p />
<h3><a name="sql_log_image"></a> sql_log_image </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogImage">Option Topic</a>
</li></ul>
<p />
Log to the database when creating motion triggered image file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_mpeg"></a> sql_log_mpeg </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogMpeg">Option Topic</a>
</li></ul>
<p />
Log to the database when creating motion triggered mpeg file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_snapshot"></a> sql_log_snapshot </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: on
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogSnapshot">Option Topic</a>
</li></ul>
<p />
Log to the database when creating a snapshot image file.
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_log_timelapse"></a> sql_log_timelapse </h3>
<p /> <ul>
<li> Type: Boolean
</li> <li> Range / Valid values: on, off
</li> <li> Default: off
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlLogTimelapse">Option Topic</a>
</li></ul>
<p />
Log to the database when creating timelapse mpeg file
<p />
Configuration option common to MySQL and PostgreSQL. Motion must be built with MySQL or PostgreSQL support to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="sql_query"></a> sql_query </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">Option Topic</a>
</li></ul>
<p />
SQL query string that is sent to the database. The values for each field are given by using <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">convertion specifiers</a>
<p />
Most common <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConversionSpecifiers">conversion specifiers</a>
<p /> <ul>
<li> %Y = year, %m = month, %d = date
</li> <li> %H = hour, %M = minute, %S = second
</li> <li> %v = event
</li> <li> %q = frame number
</li> <li> %t = thread (camera) number
</li> <li> %D = changed pixels
</li> <li> %N = noise level
</li> <li> %i and %J = width and height of motion area
</li> <li> %K and %L = X and Y coordinates of motion center
</li> <li> %C = value defined by text_event
</li> <li> %f = filename with full path
</li> <li> %n = number indicating filetype
</li></ul>
<p />
<p />
<p />
See the "MySQL" section for detailed information about the database itself.
<p />
<h2><a name="MySQL"></a> MySQL </h2>
You can use the MySQL database to register each file that is stored by motion.
<p />
You need to generate a new database with a name of your own choice. You must enter this name in the config file (mysql_db option). The default value for the option <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> requires that you create a new database in MySQL with a new table called "security" with the following fields:
<p />
insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
<p /> <ul>
<li> camera (int) - camera (thread) number
</li> <li> filename (char60) - filename (full path)
</li> <li> frame (int) - the number of the picture frame
</li> <li> file_type (int) - file type as a number - see table below.
</li> <li> time_stamp (timestamp) - timestamp for the picture in native database format
</li> <li> text_event (timestamp) - The text from the text_event option which by default is compatible with timestamps in SQL.
</li></ul>
<p />
Note from version 3.2.4 the introduction of <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionSqlQuery">sql_query</a> completely redefines the way you setup the SQL feature. It is now 100% flexible and can easily be made compatible with your existing Motion database from earlier versions of Motion.
<p />
These are the file type descriptions and the file type numbers stored in the database.
<p />
<table cellspacing="0" id="table14" cellpadding="0" class="foswikiTable" rules="rows" border="1">
<tbody>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Normal image </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 1 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Snapshot image </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 2 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Motion image (showing only pixels defined as motion) </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 4 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Normal mpeg image </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 8 </td>
</tr>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td width="400" bgcolor="#ffffff" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol"> Motion mpeg (showing only pixels defined as motion) </td>
<td width="70" bgcolor="#ffffff" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol"> 16 </td>
</tr>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1">
<td width="400" bgcolor="#edf4f9" align="left" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> Timelapse mpeg </td>
<td width="70" bgcolor="#edf4f9" align="center" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> 32 </td>
</tr>
</tbody></table>
<p />
You can create the table using the following SQL statement.
<p />
<code>CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), text_event timestamp(14));</code>
<p />
If you choose to use text_event for a non-timestamp value you can instead define something like.
<p />
<code>CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), text_event char(40));</code>
<p />
<p />
Remember to update grant table to give access to the mysql username you choose for motion.
<p />
It would be too much to go into detail about how to setup and use MySQL. After all this is a guide about Motion. However here are some hints and links.
<p />
<a href="http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/" rel="nofollow" target="_top">Setting Up a MySQL Based Website</a> - A beginners guide from Linux Planet.
<p />
<a href="http://hotwired.lycos.com/webmonkey/99/21/index2a.html" rel="nofollow" target="_top">Webmonkey PHP/!MySQL tutorial</a> - Entertaining and easy to read.
<p />
The <a href="http://www.phpmyadmin.net/" rel="nofollow" target="_top">phpMyAdmin homepage</a>. The best and simplest tool to use MySQL (editors opinion). Requires Apache/PHP.
<p />
<strong>The options for MySQL</strong>
<p />
<p />
<p />
<h3><a name="mysql_db"></a> mysql_db </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlDb">Option Topic</a>
</li></ul>
<p />
Name of the MySQL database.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
If you compiled motion with MySQL support you will need to set the mysql options if you want motion to log events to the database.
<p />
<p />
<p />
<p />
<h3><a name="mysql_host"></a> mysql_host </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: localhost
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlHost">Option Topic</a>
</li></ul>
<p />
IP address or domain name for the MySQL server. Use "localhost" if motion and MySQL runs on the same server.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="mysql_password"></a> mysql_password </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlPassword">Option Topic</a>
</li></ul>
<p />
The MySQL password.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="mysql_user"></a> mysql_user </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMysqlUser">Option Topic</a>
</li></ul>
<p />
The MySQL user name.
<p />
MySQL CONFIG FILE OPTION. Motion must be built with MySQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h2><a name="PostgreSQL"></a> PostgreSQL </h2>
Same/similar as for MySQL above.
<p />
<strong>The options for PostgreSQL</strong>
<p />
<p />
<p />
<h3><a name="pgsql_db"></a> pgsql_db </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlDb">Option Topic</a>
</li></ul>
<p />
Name of the PostgreSQL database.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
If you compiled motion with PostgreSQL support you will need to set all the pgsql_ options if you want motion to log events to the database.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_host"></a> pgsql_host </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: localhost
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlHost">Option Topic</a>
</li></ul>
<p />
IP address or domain name for the PostgreSQL server. Use "localhost" if motion and PostgreSQL runs on the same server.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with pgsql_db libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_password"></a> pgsql_password </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlPassword">Option Topic</a>
</li></ul>
<p />
The PostgreSQL password.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_port"></a> pgsql_port </h3>
<p /> <ul>
<li> Type: Integer
</li> <li> Range / Valid values: 0 - 65535
</li> <li> Default: 5432
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlPort">Option Topic</a>
</li></ul>
<p />
The PostgreSQL server port number.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<h3><a name="pgsql_user"></a> pgsql_user </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionPgsqlUser">Option Topic</a>
</li></ul>
<p />
The PostgreSQL user name.
<p />
PostgreSQL CONFIG FILE OPTION. Motion must be built with PostgreSQL libraries to use this feature.
<p />
<p />
<p />
<p />
<p />
<p />
<h2><a name="Video4Linux_Loopback_Device"></a> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/LoopbackDevice">Video4Linux Loopback Device</a> </h2>
You can use this driver for looking at motion in realtime. The video4linux driver is written by the same author that first created Motion. You can find the source and a brief description at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice">video4linux loopback device web page</a>.
<p />
The video4linux device is a Kernel module which installs itself as a video pipe. It has an input and an output. The module simply takes anything that comes on its input and send it out at the output. The purpose of this is to create a standard video4linux type video device that other programs can then use. You may now ask: "What do I need that for?".
<p />
Only one program can access a video device at a time. When motion is using a camera - no other program can access the same camera. But motion is made to be able to feed a video signal to the video loopback device. This way an additional program such as Camstream, Xawtv, a video stream server etc can watch the signal from a camera that motion uses already. What you see is not the live camera stream but the exact same picture that motion uses for detecting motion and the same pictures that are saved/streamed. You can also choose to see the "motion" type images where you see the pixels that are changing - live. Originally the video4linux pipe was used as an interface between Motion and a Webcam server. Since version 2.9 Motion has had its own webserver so this usage is no longer very relevant.
<p />
When you install the video loopback device it will create an input - for example /dev/video5 and an output - for example /dev/video6. You can then tell motion to "pipe" the video signal to the /dev/video5 and look at the pictures live using e.g. Camstream on /dev/video6. Camstream is "fooled" to think it is looking at a real camera.
<p />
<strong>Installing</strong>
<p />
Installing the video loopback device is not difficult. At least not when you have this document available.
<p />
First you must prepare your system for more video devices. You will need two extra devices for each video pipe that you want.
<p />
For example if you have 4 cameras they will probably run at /dev/video0, /dev/video1, /dev/video2, and /dev/video3. So you will need additional 8 video devices. This is easy to do.
<p />
<pre>
mknod /dev/video4 c 81 4
mknod /dev/video5 c 81 5
mknod /dev/video6 c 81 6
mknod /dev/video7 c 81 7
mknod /dev/video8 c 81 8
mknod /dev/video9 c 81 9
mknod /dev/video10 c 81 10
mknod /dev/video11 c 81 11
</pre>
<p />
Note that the video device number is the same as the last parameter given on each line.
<p />
You may need to set the ownership and permissions (chown and chmod) to be the same as the video devices that were already there.
<p />
Now you need to install the video loopback device.
<p />
Download the latest <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice" target="_top">video4linux loopback device</a> . Place the file in a place of your own choice.
<p />
Untar and uncompress the file to the place you want the program installed. Editor recommends /usr/local/vloopback.
<p />
<code>cd /usr/local</code>
<p />
<code>tar -xvzf /path/to/vloopback-1.1-rc1.tar.gz</code>
<p />
You now have a directory called vloopback-1.1-rc1. You can rename it to vloopback (mv vloopback-1.1-rc1 vloopback). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different versions simply by changing the link.
<p />
<code>ln -s vloopback-1.1-rc1 vloopback</code>
<p />
Now change to the new directory
<p />
<code>cd vloopback</code>
<p />
Build the code
<p />
<code>make</code>
<p />
There is a good chance that the make will not work and give you a long list of errors. To run make the following must be available on you machine. <ul>
<li> The kernel source files must be installed.
</li> <li> The source files must be available at /usr/src/linux.<br />E.g. the new Red Hat 7.3 does not have a link to the sources called linux. Instead there is a link called linux-2.4. This is easy to fix. Just create a link to the real source tree. Do not rename! Add a link using this command (replacing the kernel version number with the one you have on your machine)<br /> <code>ln -s /usr/src/linux-2.4.18-4 /usr/src/linux</code>
</li> <li> Alternatively you can change the vloopback makefile so that the "LINUXSRC=/usr/src/linux" line is changed to the actual path. I recommend the link solution since this may solve other similar problems that you can get when installing other software.
</li></ul>
<p />
When compiling on a newer Linux distribution you may get a warning about a header file malloc.h. To remove this warning simply change the header reference as suggested by the warning.
<p />
In vloopback.c you replace the line
<p />
<code>#include <linux/malloc.h></code>
<p />
with the line
<p />
<code>#include <linux/slab.h></code>
<p />
Install the code you built as a Kernel module. There are two options: pipes should be set to the number of video loopbacks that you want. Probably one for each camera. The dev_offset defines which video device number will be the first. If dev_offset is not defined the vloopback module will install itself from the first available video device. If you want the cameras to be assigned to the lower video device numbers you must either load vloopback after loading the video device modules OR use the dev_offset option when loading vloopback. Vloopback then installs itself in the sequence input 0, output 0, input 1, output 1, input 2, output 2 etc. Here is shown the command for our example of 4 cameras and 4 loopback devices and the first loopback device offset to /dev/video4.
<p />
<code>/sbin/insmod /usr/local/vloopback/vloopback.o pipes=4 dev_offset=4</code>
<p />
When you run the command you may get a warning about tainting the Kernel. Just ignore this.
You can choose to copy the vloopback.o file into a directory in the /lib/modules tree where the insmod/modprobe programs are already looking for modules. Then the command gets simpler (/sbin/insmod vloopback pipes=.....).
<p />
If you want the loopback device to load during boot, you can place the call in one of the bootup scripts such as /etc/rc.d/rc.local. Vloopback should be loaded before you start motion.
<p />
To activate the vloopback device in motion set the 'video_pipe' option in the motion.conf file. You can also view the special motion pictures where you see the changed pixels by setting the option 'motion_video_pipe' in motion.conf. When setting the video_pipe and/or motion_video_pipe options either specify the input device as e.g. /dev/video4. You can also set the parameter to '-' which means that motion will find the first vacant video loopback device input. If you have more than one camera you may want to control which loopback device each thread uses. Then you need to define the specific device name in motion.conf for the first camera and in each thread config file for the other cameras. If you set the video_pipe parameter to '-' in the motion.conf file and not setting it in the thread config files, motion automatically assign video devices in the same sequence as the threads are loaded. You can combine both video_pipe and motion_video_pipe but then naturally you will need twice as many pipes.
<p />
De-activating should be done with this command
<p />
<code>/sbin/modprobe -r vloopback</code>
<p />
<strong>Description of the motion.conf options related to video loopback device.</strong>
<p />
<p />
<p />
<h3><a name="motion_video_pipe"></a> motion_video_pipe </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMotionVideoPipe">Option Topic</a>
</li></ul>
<p />
The video4linux video loopback input device for motion images. If a particular pipe is to be used then use the device filename of this pipe, if a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe. Default: not set
<p />
Using this you can view the results in real time. E.g. by using the program <a href="http://www.smcc.demon.nl/camstream/" rel="nofollow" target="_top">camstream</a>. The difference between this option and the video-pipe option is that this option shows the motion version of the images instead of the normal images.
<p />
Disable this option by not having it in the config file (or comment it out with "#" or ";").
<p />
<p />
<p />
<p />
<p />
<h3><a name="video_pipe"></a> video_pipe </h3>
<p /> <ul>
<li> Type: String
</li> <li> Range / Valid values: Max 4095 characters
</li> <li> Default: Not defined
</li> <li> <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionVideoPipe">Option Topic</a>
</li></ul>
<p />
The video4linux video loopback input device for normal images. If a particular pipe is to be used then use the device filename of this pipe. If a dash '-' is given motion will use /proc/video/vloopback/vloopbacks to locate a free pipe.
<p />
Using this you can view the results in real time. E.g. by using the program <a href="http://www.smcc.demon.nl/camstream/" rel="nofollow" target="_top">camstream</a>.
<p />
Disable this option by not having it in the config file (or comment it out with "#" or ";").
<p />
<p />
<p />
<p />
<p />
<p />
<p />
-- <a href="http://www.lavrsen.dk/foswiki/bin/view/Main/KennethLavrsen">KennethLavrsen</a> - 13 Apr 2005
|