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 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925
|
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<link href="motion.png" rel="icon" type="image/png">
<title>Motion</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="motion_stylesheet.css" media="screen">
<script>
function fnc_topnav() {
var x = document.getElementById("id_topnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
function fnc_subnav() {
var x = document.getElementById("id_subnav");
if (x.className === "subnav") {
x.className += " responsive";
} else {
x.className = "subnav";
}
}
</script>
</head>
<body>
<div class="topnav" id="id_topnav">
<img class="logoimg" src="motion.gif">
<a class="topnav-d" href="https://motion-project.github.io/motion_support.html">Support</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-d" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_support.html">Support</a>
<a href="javascript:void(0);" class="icon" onclick="fnc_topnav()">☰</a>
</div>
<section class="page-header">
<h1>
Configuration
</h1>
</section>
<div class="subnav" id="id_subnav">
<div class="dropdown">
<button class="dropbtn">Basic Setup</button>
<div class="dropdown-content">
<a href="#top">General</a>
<a href="#basic_setup_v4l2">V4L2 Devices</a>
<a href="#basic_setup_network">Network Cameras</a>
<a href="#basic_setup_picam">Pi Camera</a>
<a href="#basic_setup_composite">Composite Cards</a>
<a href="#basic_setup_static">Static Files</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Commands/Files</button>
<div class="dropdown-content">
<a href="#commandlineoptions">Command Line</a>
<a href="#configfiles">Configuration Files </a>
<a href="#Signals_Sent">Signals</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Options-List</button>
<div class="dropdown-content">
<a href="#Configuration_OptionsAlpha" >Sorted alphabetically</a>
<a href="#Configuration_OptionsTopic" >Sorted by topic</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">General/Cameras</button>
<div class="dropdown-content">
<a href="#OptTopic_System_Processing">System Processing</a>
<a href="#conversion_specifiers">Conversion Specifiers</a>
<a href="#OptTopic_Video4Linux_Devices">Video4Linux Devices</a>
<a href="#OptTopic_Network_Cameras">Network Cameras</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Processing/Output</button>
<div class="dropdown-content">
<a href="#OptTopic_Image_Processing">Image Processing</a>
<a href="#OptTopic_Motion_Detection">Motion Detection</a>
<a href="#OptTopic_Scripts">Script Execution</a>
<a href="#OptTopic_Pictures">Pictures</a>
<a href="#OptTopic_Movies">Movies</a>
<a href="#OptTopic_Pipe">Pipe Output</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Webcontrol/Streams</button>
<div class="dropdown-content">
<a href="#OptTopic_Webcontrol">Webcontrol</a>
<a href="#OptTopic_Stream">Live Stream</a>
<a href="#OptTopic_Database">Database Options</a>
<a href="#OptTopic_Tracking">Tracking Options</a>
</div>
</div>
<a href="javascript:void(0);" class="icon" onclick="fnc_subnav()">menu⇓   </a>
</div>
<section class="main-content">
<h2><a name="Basic_Setup"></a> Basic Setup </h2>
<ul>
<p></p>
Motion is able to process images from many different types of cameras. The following is brief overview
of the process to set up the Motion software.
<ul>
<li>Determine the type of camera
<ul>
<li> <a href="#basic_setup_v4l2" >v4l2 devices</a> which are most webcams</li>
<li> <a href="#basic_setup_composite" >Composite capture cards</a> </li>
<li> <a href="#basic_setup_network" >Network or IP cameras</a> </li>
<li> <a href="#basic_setup_picam" >The PI camera</a> </li>
<li> <a href="#basic_setup_static" >Static movie files</a>.
</ul>
<li>Specify the camera in the <a href="#configfiles" >configuration files</a>.</li>
<li>Start Motion from a terminal via the <a href="#commandlineoptions" >command line</a></li>
<li>Review the messages to ensure camera was found and press cntrl-c to exit</li>
<li>Specify a <a href="#target_dir" >target_dir</a> in the configuration file.</li>
<li>Enable the <a href="#OptDetail_Stream" >web stream</a> in the configuration file </li>
<ul>
<li> Specify a <a href="#stream_port" >stream_port</a></li>
<li> Optionally turn off <a href="#stream_localhost" >stream_localhost</a> if you want to view
the stream from a different computer</li>
<li> Optionally adjust the number of persistent connections of your browser. By default many browsers
limit the number of simultaneous connections (usually to something like 5). Since Motion uses
connections for each camera, it is possible that only the first 5 cameras are displayed on the all
cameras home pages. To get around this, some browsers allow the user to specify a different(higher)
number of simultaneous streams. For some browsers, this is specified via the
network.http.max-persistent-connections-per-server option. For other browsers, users are not permitted
to customize the settings. For these browsers, users will need to specify a different port for
each camera stream. The connection limit is based upon the server:port combination therefore specifying
a different port for each camera avoids the limitation.
</ul>
<li>Enable the <a href="#OptDetail_Webcontrol" >web control</a> in the configuration file </li>
<ul>
<li> Specify a <a href="#webcontrol_port" >webcontrol_port</a></li>
<li> Optionally turn off <a href="#webcontrol_localhost" >webcontrol_localhost</a> if you want to view
the webcontrol from a different computer</li>
<li> Specify which parameters to show on the webcontrol via <a href="#webcontrol_parms" >webcontrol_parms</a></li>
<li> Optionally specify a <a href="#stream_preview_method" >stream_preview_method</a></li>
</ul>
</ul>
The above should allow users to get Motion running and being able to view images via the stream. The
next steps refine and finish a basic setup.
<ul>
<li> Refine how the image is captured with the <a href="#OptTopic_Image_Processing" >image processing</a> parameters</li>
<li> Specify the <a href="#OptTopic_Motion_Detection" >motion detection</a> parameters</li>
<li>
<a href="#OptTopic_Scripts" >Execute scripts</a>, Save
<a href="#OptTopic_Pictures" >pictures</a> or
<a href="#OptTopic_Movies" >movies</a>.
</li>
</ul>
The most difficult step in the above process will be the motion detection settings and specifying them
to minimize the false positives. To assist this process, Motion provides the
<a href="#stream_preview_method" >stream_preview_method</a> option 3 which allows users to see side
by side images of where the motion is occurring next to the regular image.
<ul>
<li> Specify <a href="#stream_preview_method" >stream_preview_method 3</a></li>
<li> Specify <a href="#webcontrol_parms" >webcontrol_parms 2</a> </li>
<li> Start Motion and in a web browser navigate to the webcontrol port</li>
<li> Try adjusting the
<a href="#threshold" >threshold</a>,
<a href="#noise_level" >noise_level</a>,
<a href="#despeckle_filter" >despeckle_filter</a> and
<a href="#smart_mask_speed" >smart_mask_speed</a>
</li>
<li> Make sure to write configuration to file in order to save any changes.</li>
</ul>
Motion also includes a <a href="#setup_mode" >setup_mode</a> which provides more values reported
on the motion images and in the log to assist the setup.
<p></p>
The following are some additional topics which may be of interest during the initial setup.
<ul>
<li>Run automatically at start (Run as <a href="#basic_setup_service" >service</a>)</li>
<li>Remove deprecated parameters warnings (<a href="#config_deprecated" >Remove deprecated</a>)</li>
<li>List/include all possible configuration parameters (<a href="#config_listall" >All parameters</a>)</li>
</ul>
<p></p>
<a name="basic_setup_v4l2"></a>
<strong>Video4linux devices</strong> must be installed per the requirements of the camera. It is
out of the scope of this document to tell you how to do this and it depends on which type of camera. Once
the camera is installed it will have the device name(s) of /dev/video0, /dev/video1, /dev/video2...
<p></p>
FreeBSD has a different naming scheme for pci devices that use the bktr subsystem. The bktr subsystem will report
devices using a naming scheme of /dev/bktr0, /dev/bktr1, etc. These device may also need to use the other
special device for the tuner. The tuner will need to be specified with the tunerdevice option as /dev/tuner0.
<p></p>
USB cameras take a lot of bandwidth. A USB camera connected to a USB2 port or hub consumes virtually
all the bandwidth that the port can handle. Even with a small framesize and low framerate you should not expect to have
more than one camera per USB controller. If you need more than one USB camera it is possible to add extra USB PCI cards
to your computer. It is also possible that your computer has more than one controller for different USB slots. For
example, if the computer has six USB ports, the three on the left may be on controller A versus the three on the right
may be on controller B. In this situation, connecting two cameras to ports only on the left would not work due to
excessive bandwidth. However connecting one camera to port on the right and the other to the port on the left
may work since they are on different controllers.
<p></p>
Motion permits the use of video cards that have discreet input channels. Since USB cameras do not have input channels,
the option <a href="#input" >input</a> must be set to the value -1 for USB cameras.
<p></p>
<a name="basic_setup_network"></a>
<strong>Network cameras</strong> are set up via the
<a href="#netcam_url" >netcam_url</a> parameter.
The latest versions of Motion support rtsp format which many cameras now stream. Some users have requested
a list of the network cameras that will work with Motion. Since Motion can now process RTSP streams, almost
all cameras are supported. Simply review the specifications of the camera and validate that
RTSP or RTMP is listed. The cameras that will not work are those specifically sold to be integrated into
proprietary software monitoring systems. When determining cameras, consider carefully before selecting a
wireless camera. Cameras require a solid consistent signal and use a lot of bandwidth. Inconsistencies in
the wireless signal can result in a poor user experience so the use of a hardwired camera is recommended.
<p></p>
The URL connection string to enter is specific to the camera and is
usually provided by the manufacturer. The connection string is the same as what would be used by other
video playing software such as VLC. If the camera does not stream via RTSP and instead uses a MJPEG, then Motion
can also view that format. See the option <a href="#netcam_url" >netcam_url</a> for
additional options.
<p></p>
<a name="basic_setup_picam"></a>
<strong>The raspberry Pi camera</strong> is set up via an application called
<i><small><code>libcamera</code></small></i>. <i><small><code>libcamera</code></small></i> provides
access to the camera as a v4l2 device but this interface is only available when using a special
application. Users must run Motion using the
command <i><small><code>libcamerify motion</code></small></i> and
then specify the /dev/videoX device in the Motion configuration file.
<p></p>
With just one camera connected to the Pi, the device name should normally be
<i><small><code>/dev/video0</code></small></i>. With multiple cameras connected, e.g. a regular
USB web and the Pi camera, you will need to determine the device associated with the
Pi camera and the USB camera. The list of devices can be seen using the command
(<i><small><code>v4l2-ctl --list-devices</code></small></i>).
<p></p>
<a name="basic_setup_composite"></a>
<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></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="#input" >input</a>. Input channel numbers start at 0
(which is why the value -1 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 camera config files with the
same video device name but different input numbers Motion automatically
goes into round robin mode.
<p></p>
Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3.
Others 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></p>
Some capture cards are specially made for surveillance with for example 4 inputs.
Others have a TV tuner, a composite input and perhaps also a S-Video input.
For all these cards the inputs are numbered. The numbering varies from card to card so the easiest
is to experiment with a program such as VLC that can show the video stream.
<p></p>
If you use the TV tuner input you also need to set the frequency of the TV channel using the
option <a href="#frequency" >frequency</a>. Otherwise
set <a href="#frequency" >frequency</a> to 0.
<p></p>
Finally you need to set the TV <a href="#norm" >norm</a>.
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></p>
<a name="basic_setup_static"></a>
<strong>Static files</strong> can also be processed by Motion in one of two ways. The first method
is by using the <a href="#netcam_url" >netcam_url</a> option and using a prefix of file:\\. With
this method, Motion will process the file at the speed specified by
<a href="#framerate" >framerate</a>. This allows the user to either speed up or slow down the video
processing to suit the particular need.
<p></p>
The second option for processing a static file requires a bit of additional setup and uses a
v4l2loopback device. To set this up, first install the loopback software as described in the
<a href="#OptDetail_Pipe" >Output - Pipe Options</a>
section of this guide to create a /dev/videoX device and then use software such as ffmpeg to stream
the static file into the v4l2 device. e.g.
<code> ffmpeg -re -i mymovie.mp4 -f v4l2 /dev/video0 </code> Then in a separate terminal, start Motion
with it set to use the <code>/dev/video0</code> device as input. This method can can also be used to
reformat the content to a different format. The following outputs the original movie into a gray pixel format.
<code> ffmpeg -re -i mymovie.mp4 -f v4l2 -pix_fmt gray /dev/video0 </code>
This can be helpful as a interim process where ffmpeg supports a particular input but that format is not yet supported
by Motion.
<p></p>
<a name="basic_setup_service"></a>
<strong>Run as Service</strong>
<p></p>
The following instructions are only applicable to Debian and Ubuntu based systems. For other distributions, users
should consult their distribution documentation and provide pull requests to the Motion developers so that this
section can be updated with their distribution.
<p></p>
Motion can be set up to run as a service which means that it will start automatically whenever the computer
is started. When setting up Motion to run as a service, it should be done only after all the other configuration
has been completed. It is much easier to edit and revise the parameters when Motion is just running
in a terminal rather than as a service. Motion now uses the systemctl and when running as a service,
the option <a href="#daemon" >daemon</a> must be set as <code>off</code>
<p></p>
The following commands control the Motion service.
<ul>
<li>Start the Motion service<code>sudo systemctl start motion</code></li>
<li>Stop the Motion service<code>sudo systemctl stop motion</code></li>
</ul>
<p></p>
When running as a service, Motion runs as the user <code>motion</code> and this user is automatically
added to the user group of <code>video</code>. By only be included in this user group, when Motion is
run, it will only have limited permissions. It is NOT recommended that this user get added to the
<code>sudo</code> group. Instead, only add this user to groups that are specifically required.
<p></p>
<p></p>
</ul>
<h2><a name="commandlineoptions"></a> Command Line Options </h2>
<ul>
<p></p>
SYNOPSIS
<code>motion [ -hbnsm ] [ -c config file path ] [ -d level ] [ -k level ] [ -p pid_file ] [ -l log_file ]</code>
<p></p>
<ul>
<li>-c : Full path and filename of config file.</li>
<li>-h : Show help screen</li>
<li>-b : Run in daemon mode</li>
<li>-n : Run in non-daemon mode</li>
<li>-s : Run in setup mode. Also forces non-daemon mode.</li>
<li>-d : Run with message log level 1 - 9</li>
<li>-k : Run with message log type 1 - 9</li>
<li>-l : Full path and file name for log file</li>
<li>-p : Full path and file name for the process id file</li>
<li>-m : Start in pause mode</li>
</ul>
<p></p>
<p></p>
</ul>
<h2><a name="configfiles"></a> The Configuration Files </h2>
<ul>
<p></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></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></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 /etc/motion)</li>
</ol>
If you have write access to /usr/local/etc/motion then the editor recommends having only one motion.conf file
in the default /usr/local/etc/motion directory.
<p></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/motion directory.
<p></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 working motion.conf file does not accidentally get overwritten when
you re-install or upgrade to a newer version of Motion.
<p></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 at the same time. The motion.conf file establishes global parameters that apply to all
cameras and separate camera.conf files that specify the parameters that apply to
each specific camera. The camera.conf files are specified at the bottom of the motion.conf file. If you only
have one camera you only need the motion.conf file but if you have more than one camera, then you will
need to have
<strong>one camera config file per camera</strong> plus the motion.conf file.
<p></p>
If you have for example two cameras you need motion.conf
<strong>and two</strong> camera config files. So a total of <strong>three</strong> config files.
<p></p>
An option that is common to all cameras can be placed in motion.conf. (You can also put all parameters in the
camera files but that makes a lot of editing when you change a common thing).
<p></p>
An option that is unique to a camera must be specified in each camera file.
<p></p>
The first camera is defined in the first camera file called from motion.conf. The 2nd camera is defined in the
2nd camera file called from motion.conf etc.
<p></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 camera config file.
<p></p>
To make it clear, the camera files format and syntax is the same as motion.conf. An example of what you might want
in a camera file as follows: assume you have two cameras, attached to one system. Create files camera0.conf and
camera1.conf. At the end of motion.conf, uncomment out the lines that refer to them. The full contents of the
camera files can be as simple as
<p></p>
<p></p>
camera0.conf:
<br /><code> video_device /dev/video0</code>
<p></p>
<p></p>
camera1.conf:
<br /><code> video_device /dev/video1</code>
<p></p>
<p></p>
<p></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 "camera" is defined in motion.conf, the camera 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 camera config file.</li>
<li> Motion reads the command line option again overruling any previously defined options.</li>
</ol>
So always call the camera config files in the end of the motion.conf file. If you define options in motion.conf
AFTER the camera file calls, the same options in the camera files will never be used. So always put the camera
file call at the end of motion.conf.
<p></p>
Nearly all config options can be unique for a specific camera and placed in a camera config file.
There are a few options that must be in motion.conf and cannot be in a camera config
file: webcontrol_* , daemon, and camera.
<p></p>
If motion is built without specific features such as ffmpeg, mysql etc it will ignore the options that
belong to those features.
<p></p>
<a name="config_deprecated"></a>
<p></p>
<strong>Deprecated Parameters</strong>
<p></p>
Over the years, Motion has added many new configuration parameters and changed the name
of a few of them so that there is some consistency to the parameter names. Since version
3.4.1, when a configuration parameter has a new name or additional functionality, Motion will
try to interpret the value specified for the old parameter and translate it to the new parameter.
These translations will be reported in the log as Motion is started. To eliminate these warnings,
ensure that a <a href="#webcontrol_port" >webcontrol_port</a> is specified and that the
<a href="#webcontrol_interface" >webcontrol_interface</a> is specified as 0 (or not listed). Then start
motion, open a browser and navigate to the webcontrol port. When on that page, select
<code>write configuration</code>. This will re-write the configuration files with all the current
parameters to Motion. Note that depending upon where the configuration files are located, Motion
may need to be started using <code>sudo</code>.
<p></p>
<a name="config_listall"></a>
<p></p>
<strong>Parameters in distributed configuration files</strong>
<p></p>
As of this writing, Motion includes over 150 parameters. With this volume of parameters, navigating
the configuration file with every possible has become onerous. Starting with version 4.2, the distributed
configuration files only include a limited subset of the configuration parameters. Users can add to the
files as needed the parameters that are applicable to their set up. Users that wish to have every parameter
listed and included in the configuration file can follow the process described immediately above in
the <a href="#config_deprecated" >Remove deprecated</a> section.
i.e. Use the webcontrol interface to write out the configuration file.
<p></p>
Extended descriptions / documentation are not included in the configuration file. This guide
should be consulted for documentation of the configuration parameters.
<p></p>
<p></p>
</ul>
<h2><a name="Signals_Sent"></a> Signals (sent with e.g. kill command) </h2>
<ul>
<p></p>
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></p>
<div class="tblsignal">
<table border="1" class="fixed" >
<colgroup>
<col width="30%">
<col width="30%">
<col width="30%">
</colgroup>
<thead >
<tr >
<th bgcolor="#edf4f9" word-wrap:break-word > Signal </th>
<th bgcolor="#edf4f9" word-wrap:break-word > Description </th>
<th bgcolor="#edf4f9" word-wrap:break-word > Editors comment </th>
</tr>
</thead>
<tbody>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGHUP </td>
<td bgcolor="#edf4f9" word-wrap:break-word > The config file will be reread. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > This is a very useful signal when you experiment with settings in the config file. </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGTERM </td>
<td bgcolor="#edf4f9" word-wrap:break-word > If needed motion will create an movie file of the last event and exit </td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
<tr>
<td bgcolor="#edf4f9" word-wrap:break-word > SIGUSR1 </td>
<td bgcolor="#edf4f9" word-wrap:break-word > Motion will create an movie file of the current event. </td>
<td bgcolor="#edf4f9" word-wrap:break-word > </td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p></p>
</ul>
<h2><a name="Configuration_OptionsAlpha"></a> Configuration Options-Listed Alphabetically </h2>
<ul>
<p></p>
These are the options that can be used in the config file.
<p></p>
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p></p>
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL, SQLite, FFMPEG, etc).
<p></p>
<p></p>
<style>
@media screen and (max-width: 48em) {
.tblalpha td:nth-of-type(1):before {content: "v4.1"; padding-right: 10px;}
.tblalpha td:nth-of-type(2):before {content: "v4.2"; padding-right: 10px;}
.tblalpha td:nth-of-type(3):before {content: "v4.3"; padding-right: 10px;}
.tblalpha td:nth-of-type(4):before {content: "Cur."; padding-right: 10px;}
}
</style>
<div class="tblalpha">
<table cellspacing="0" border="0">
<colgroup width="15%"></colgroup>
<colgroup width="25%"></colgroup>
<colgroup width="25%"></colgroup>
<colgroup width="25%"></colgroup>
<tr>
<td align="left"><b>Version 4.2</b></td>
<td align="left"><b>Version 4.3</b></td>
<td align="left"><b>Version 4.4</b></td>
<td align="left"><b>Current Version</b></td>
</tr>
<tr>
<td align="left">area_detect</td>
<td align="left">area_detect</td>
<td align="left">area_detect</td>
<td align="left"><a href="#area_detect" >area_detect</a></td>
</tr>
<tr>
<td height="17" align="left">auto_brightness</td>
<td align="left">auto_brightness</td>
<td align="left">auto_brightness</td>
<td align="left"><a href="#auto_brightness" >auto_brightness</a></td>
</tr>
<tr>
<td align="left">camera</td>
<td align="left">camera</td>
<td align="left">camera</td>
<td align="left"><a href="#camera" >camera</a></td>
</tr>
<tr>
<td align="left">camera_dir</td>
<td align="left">camera_dir</td>
<td align="left">camera_dir</td>
<td align="left"><a href="#camera_dir" >camera_dir</a></td>
</tr>
<tr>
<td align="left">camera_id</td>
<td align="left">camera_id</td>
<td align="left">camera_id</td>
<td align="left"><a href="#camera_id" >camera_id</a></td>
</tr>
<tr>
<td align="left">camera_name</td>
<td align="left">camera_name</td>
<td align="left">camera_name</td>
<td align="left"><a href="#camera_name" >camera_name</a></td>
</tr>
<tr>
<td align="left">daemon</td>
<td align="left">daemon</td>
<td align="left">daemon</td>
<td align="left"><a href="#daemon" >daemon</a></td>
</tr>
<tr>
<td align="left">database_busy_timeout</td>
<td align="left">database_busy_timeout</td>
<td align="left">database_busy_timeout</td>
<td align="left"><a href="#database_busy_timeout" >database_busy_timeout</a></td>
</tr>
<tr>
<td align="left">database_dbname</td>
<td align="left">database_dbname</td>
<td align="left">database_dbname</td>
<td align="left"><a href="#database_dbname" >database_dbname</a></td>
</tr>
<tr>
<td align="left">database_host</td>
<td align="left">database_host</td>
<td align="left">database_host</td>
<td align="left"><a href="#database_host" >database_host</a></td>
</tr>
<tr>
<td align="left">database_password</td>
<td align="left">database_password</td>
<td align="left">database_password</td>
<td align="left"><a href="#database_password" >database_password</a></td>
</tr>
<tr>
<td align="left">database_port</td>
<td align="left">database_port</td>
<td align="left">database_port</td>
<td align="left"><a href="#database_port" >database_port</a></td>
</tr>
<tr>
<td align="left">database_type</td>
<td align="left">database_type</td>
<td align="left">database_type</td>
<td align="left"><a href="#database_type" >database_type</a></td>
</tr>
<tr>
<td align="left">database_user</td>
<td align="left">database_user</td>
<td align="left">database_user</td>
<td align="left"><a href="#database_user" >database_user</a></td>
</tr>
<tr>
<td align="left">despeckle_filter</td>
<td align="left">despeckle_filter</td>
<td align="left">despeckle_filter</td>
<td align="left"><a href="#despeckle_filter" >despeckle_filter</a></td>
</tr>
<tr>
<td align="left">emulate_motion</td>
<td align="left">emulate_motion</td>
<td align="left">emulate_motion</td>
<td align="left"><a href="#emulate_motion" >emulate_motion</a></td>
</tr>
<tr>
<td align="left">event_gap</td>
<td align="left">event_gap</td>
<td align="left">event_gap</td>
<td align="left"><a href="#event_gap" >event_gap</a></td>
</tr>
<tr>
<td align="left">flip_axis</td>
<td align="left">flip_axis</td>
<td align="left">flip_axis</td>
<td align="left"><a href="#flip_axis" >flip_axis</a></td>
</tr>
<tr>
<td align="left">framerate</td>
<td align="left">framerate</td>
<td align="left">framerate</td>
<td align="left"><a href="#framerate" >framerate</a></td>
</tr>
<tr>
<td align="left">height</td>
<td align="left">height</td>
<td align="left">height</td>
<td align="left"><a href="#height" >height</a></td>
</tr>
<tr>
<td align="left">lightswitch_frames</td>
<td align="left">lightswitch_frames</td>
<td align="left">lightswitch_frames</td>
<td align="left"><a href="#lightswitch_frames" >lightswitch_frames</a></td>
</tr>
<tr>
<td align="left">lightswitch_percent</td>
<td align="left">lightswitch_percent</td>
<td align="left">lightswitch_percent</td>
<td align="left"><a href="#lightswitch_percent" >lightswitch_percent</a></td>
</tr>
<tr>
<td align="left">locate_motion_mode</td>
<td align="left">locate_motion_mode</td>
<td align="left">locate_motion_mode</td>
<td align="left"><a href="#locate_motion_mode" >locate_motion_mode</a></td>
</tr>
<tr>
<td align="left">locate_motion_style</td>
<td align="left">locate_motion_style</td>
<td align="left">locate_motion_style</td>
<td align="left"><a href="#locate_motion_style" >locate_motion_style</a></td>
</tr>
<tr>
<td align="left">log_file</td>
<td align="left">log_file</td>
<td align="left">log_file</td>
<td align="left"><a href="#log_file" >log_file</a></td>
</tr>
<tr>
<td align="left">log_level</td>
<td align="left">log_level</td>
<td align="left">log_level</td>
<td align="left"><a href="#log_level" >log_level</a></td>
</tr>
<tr>
<td align="left">log_type</td>
<td align="left">log_type</td>
<td align="left">log_type</td>
<td align="left"><a href="#log_type" >log_type</a></td>
</tr>
<tr>
<td align="left">mask_file</td>
<td align="left">mask_file</td>
<td align="left">mask_file</td>
<td align="left"><a href="#mask_file" >mask_file</a></td>
</tr>
<tr>
<td align="left">mask_privacy</td>
<td align="left">mask_privacy</td>
<td align="left">mask_privacy</td>
<td align="left"><a href="#mask_privacy" >mask_privacy</a></td>
</tr>
<tr>
<td align="left">minimum_frame_time</td>
<td align="left">minimum_frame_time</td>
<td align="left">minimum_frame_time</td>
<td align="left"><a href="#minimum_frame_time" >minimum_frame_time</a></td>
</tr>
<tr>
<td align="left">minimum_motion_frames</td>
<td align="left">minimum_motion_frames</td>
<td align="left">minimum_motion_frames</td>
<td align="left"><a href="#minimum_motion_frames" >minimum_motion_frames</a></td>
</tr>
<tr>
<td align="left">movie_bps</td>
<td align="left">movie_bps</td>
<td align="left">movie_bps</td>
<td align="left"><a href="#movie_bps" >movie_bps</a></td>
</tr>
<tr>
<td align="left">movie_codec</td>
<td align="left">movie_codec</td>
<td align="left">movie_codec</td>
<td align="left"><a href="#movie_codec" >movie_codec</a></td>
</tr>
<tr>
<td align="left">ffmpeg_duplicate_frames</td>
<td align="left">ffmpeg_duplicate_frames</td>
<td align="left">movie_duplicate_frames</td>
<td align="left"><a href="#movie_duplicate_frames" >movie_duplicate_frames</a></td>
</tr>
<tr>
<td align="left">movie_extpipe</td>
<td align="left">movie_extpipe</td>
<td align="left">movie_extpipe</td>
<td align="left"><a href="#movie_extpipe" >movie_extpipe</a></td>
</tr>
<tr>
<td align="left">movie_extpipe_use</td>
<td align="left">movie_extpipe_use</td>
<td align="left">movie_extpipe_use</td>
<td align="left"><a href="#movie_extpipe_use" >movie_extpipe_use</a></td>
</tr>
<tr>
<td align="left">movie_filename</td>
<td align="left">movie_filename</td>
<td align="left">movie_filename</td>
<td align="left"><a href="#movie_filename" >movie_filename</a></td>
</tr>
<tr>
<td align="left">movie_max_time</td>
<td align="left">movie_max_time</td>
<td align="left">movie_max_time</td>
<td align="left"><a href="#movie_max_time" >movie_max_time</a></td>
</tr>
<tr>
<td align="left">movie_output</td>
<td align="left">movie_output</td>
<td align="left">movie_output</td>
<td align="left"><a href="#movie_output" >movie_output</a></td>
</tr>
<tr>
<td align="left">movie_output_motion</td>
<td align="left">movie_output_motion</td>
<td align="left">movie_output_motion</td>
<td align="left"><a href="#movie_output_motion" >movie_output_motion</a></td>
</tr>
<tr>
<td align="left">movie_passthrough</td>
<td align="left">movie_passthrough</td>
<td align="left">movie_passthrough</td>
<td align="left"><a href="#movie_passthrough" >movie_passthrough</a></td>
</tr>
<tr>
<td align="left">movie_quality</td>
<td align="left">movie_quality</td>
<td align="left">movie_quality</td>
<td align="left"><a href="#movie_quality" >movie_quality</a></td>
</tr>
<tr>
<td align="left">native_language</td>
<td align="left">native_language</td>
<td align="left">native_language</td>
<td align="left"><a href="#native_language" >native_language</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">netcam_high_params</td>
<td align="left"><a href="#netcam_high_params" >netcam_high_params</a></td>
</tr>
<tr>
<td align="left">netcam_highres</td>
<td align="left">netcam_highres</td>
<td align="left">netcam_high_url</td>
<td align="left"><a href="#netcam_high_url" >netcam_high_url</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left">netcam_decoder</td>
<td align="left">netcam_params</td>
<td align="left"><a href="#netcam_params" >netcam_params</a></td>
</tr>
<tr>
<td align="left">netcam_keepalive</td>
<td align="left">netcam_keepalive</td>
<td align="left">netcam_params</td>
<td align="left"><a href="#netcam_params" >netcam_params</a></td>
</tr>
<tr>
<td align="left">netcam_proxy</td>
<td align="left">netcam_proxy</td>
<td align="left">netcam_params</td>
<td align="left"><a href="#netcam_params" >netcam_params</a></td>
</tr>
<tr>
<td align="left">netcam_tolerant_check</td>
<td align="left">netcam_tolerant_check</td>
<td align="left">netcam_params</td>
<td align="left"><a href="#netcam_params" >netcam_params</a></td>
</tr>
<tr>
<td align="left">netcam_use_tcp<br /></td>
<td align="left">netcam_use_tcp</td>
<td align="left">netcam_params</td>
<td align="left"><a href="#netcam_params" >netcam_params</a></td>
</tr>
<tr>
<td align="left">netcam_url</td>
<td align="left">netcam_url</td>
<td align="left">netcam_url</td>
<td align="left"><a href="#netcam_url" >netcam_url</a></td>
</tr>
<tr>
<td align="left">netcam_userpass</td>
<td align="left">netcam_userpass</td>
<td align="left">netcam_userpass</td>
<td align="left"><a href="#netcam_userpass" >netcam_userpass</a></td>
</tr>
<tr>
<td align="left">noise_level</td>
<td align="left">noise_level</td>
<td align="left">noise_level</td>
<td align="left"><a href="#noise_level" >noise_level</a></td>
</tr>
<tr>
<td align="left">noise_tune</td>
<td align="left">noise_tune</td>
<td align="left">noise_tune</td>
<td align="left"><a href="#noise_tune" >noise_tune</a></td>
</tr>
<tr>
<td align="left">on_area_detected</td>
<td align="left">on_area_detected</td>
<td align="left">on_area_detected</td>
<td align="left"><a href="#on_area_detected" >on_area_detected</a></td>
</tr>
<tr>
<td align="left">on_camera_found</td>
<td align="left">on_camera_found</td>
<td align="left">on_camera_found</td>
<td align="left"><a href="#on_camera_found" >on_camera_found</a></td>
</tr>
<tr>
<td align="left">on_camera_lost</td>
<td align="left">on_camera_lost</td>
<td align="left">on_camera_lost</td>
<td align="left"><a href="#on_camera_lost" >on_camera_lost</a></td>
</tr>
<tr>
<td align="left">on_event_end</td>
<td align="left">on_event_end</td>
<td align="left">on_event_end</td>
<td align="left"><a href="#on_event_end" >on_event_end</a></td>
</tr>
<tr>
<td align="left">on_event_start</td>
<td align="left">on_event_start</td>
<td align="left">on_event_start</td>
<td align="left"><a href="#on_event_start" >on_event_start</a></td>
</tr>
<tr>
<td align="left">on_motion_detected</td>
<td align="left">on_motion_detected</td>
<td align="left">on_motion_detected</td>
<td align="left"><a href="#on_motion_detected" >on_motion_detected</a></td>
</tr>
<tr>
<td align="left">on_movie_end</td>
<td align="left">on_movie_end</td>
<td align="left">on_movie_end</td>
<td align="left"><a href="#on_movie_end" >on_movie_end</a></td>
</tr>
<tr>
<td align="left">on_movie_start</td>
<td align="left">on_movie_start</td>
<td align="left">on_movie_start</td>
<td align="left"><a href="#on_movie_start" >on_movie_start</a></td>
</tr>
<tr>
<td align="left">on_picture_save</td>
<td align="left">on_picture_save</td>
<td align="left">on_picture_save</td>
<td align="left"><a href="#on_picture_save" >on_picture_save</a></td>
</tr>
<tr>
<td align="left"><br /></td>
<td align="left"></td>
<td align="left">pause</td>
<td align="left"><a href="#pause" >pause</a></td>
</tr>
<tr>
<td align="left">picture_exif<br /></td>
<td align="left">picture_exif</td>
<td align="left">picture_exif</td>
<td align="left"><a href="#picture_exif" >picture_exif</a></td>
</tr>
<tr>
<td align="left">picture_output</td>
<td align="left">picture_output</td>
<td align="left">picture_output</td>
<td align="left"><a href="#picture_output" >picture_output</a></td>
</tr>
<tr>
<td align="left">picture_output_motion</td>
<td align="left">picture_output_motion</td>
<td align="left">picture_output_motion</td>
<td align="left"><a href="#picture_output_motion" >picture_output_motion</a></td>
</tr>
<tr>
<td align="left">picture_filename</td>
<td align="left">picture_filename</td>
<td align="left">picture_filename</td>
<td align="left"><a href="#picture_filename" >picture_filename</a></td>
</tr>
<tr>
<td align="left">picture_type</td>
<td align="left">picture_type</td>
<td align="left">picture_type</td>
<td align="left"><a href="#picture_type" >picture_type</a></td>
</tr>
<tr>
<td align="left">picture_quality</td>
<td align="left">picture_quality</td>
<td align="left">picture_quality</td>
<td align="left"><a href="#picture_quality" >picture_quality</a></td>
</tr>
<tr>
<td align="left">pid_file</td>
<td align="left">pid_file</td>
<td align="left">pid_file</td>
<td align="left"><a href="#pid_file" >pid_file</a></td>
</tr>
<tr>
<td align="left">post_capture</td>
<td align="left">post_capture</td>
<td align="left">post_capture</td>
<td align="left"><a href="#post_capture" >post_capture</a></td>
</tr>
<tr>
<td align="left">pre_capture</td>
<td align="left">pre_capture</td>
<td align="left">pre_capture</td>
<td align="left"><a href="#pre_capture" >pre_capture</a></td>
</tr>
<tr>
<td align="left">quiet</td>
<td align="left">quiet</td>
<td align="left">quiet</td>
<td align="left"><a href="#quiet" >quiet</a></td>
</tr>
<tr>
<td align="left">rotate</td>
<td align="left">rotate</td>
<td align="left">rotate</td>
<td align="left"><a href="#rotate" >rotate</a></td>
</tr>
<tr>
<td align="left">roundrobin_frames</td>
<td align="left">roundrobin_frames</td>
<td align="left">roundrobin_frames</td>
<td align="left"><a href="#roundrobin_frames" >roundrobin_frames</a></td>
</tr>
<tr>
<td align="left">roundrobin_skip</td>
<td align="left">roundrobin_skip</td>
<td align="left">roundrobin_skip</td>
<td align="left"><a href="#roundrobin_skip" >roundrobin_skip</a></td>
</tr>
<tr>
<td align="left">roundrobin_switchfilter</td>
<td align="left">roundrobin_switchfilter</td>
<td align="left">roundrobin_switchfilter</td>
<td align="left"><a href="#roundrobin_switchfilter" >roundrobin_switchfilter</a></td>
</tr>
<tr>
<td align="left">setup_mode</td>
<td align="left">setup_mode</td>
<td align="left">setup_mode</td>
<td align="left"><a href="#setup_mode" >setup_mode</a></td>
</tr>
<tr>
<td align="left">smart_mask_speed</td>
<td align="left">smart_mask_speed</td>
<td align="left">smart_mask_speed</td>
<td align="left"><a href="#smart_mask_speed" >smart_mask_speed</a></td>
</tr>
<tr>
<td align="left">snapshot_filename</td>
<td align="left">snapshot_filename</td>
<td align="left">snapshot_filename</td>
<td align="left"><a href="#snapshot_filename" >snapshot_filename</a></td>
</tr>
<tr>
<td align="left">snapshot_interval</td>
<td align="left">snapshot_interval</td>
<td align="left">snapshot_interval</td>
<td align="left"><a href="#snapshot_interval" >snapshot_interval</a></td>
</tr>
<tr>
<td align="left">sql_log_movie</td>
<td align="left">sql_log_movie</td>
<td align="left">sql_log_movie</td>
<td align="left"><a href="#sql_log_movie" >sql_log_movie</a></td>
</tr>
<tr>
<td align="left">sql_log_picture</td>
<td align="left">sql_log_picture</td>
<td align="left">sql_log_picture</td>
<td align="left"><a href="#sql_log_picture" >sql_log_picture</a></td>
</tr>
<tr>
<td align="left">sql_log_snapshot</td>
<td align="left">sql_log_snapshot</td>
<td align="left">sql_log_snapshot</td>
<td align="left"><a href="#sql_log_snapshot" >sql_log_snapshot</a></td>
</tr>
<tr>
<td align="left">sql_log_timelapse</td>
<td align="left">sql_log_timelapse</td>
<td align="left">sql_log_timelapse</td>
<td align="left"><a href="#sql_log_timelapse" >sql_log_timelapse</a></td>
</tr>
<tr>
<td align="left">sql_query</td>
<td align="left">sql_query</td>
<td align="left">sql_query</td>
<td align="left"><a href="#sql_query" >sql_query</a></td>
</tr>
<tr>
<td align="left">sql_query_start</td>
<td align="left">sql_query_start</td>
<td align="left">sql_query_start</td>
<td align="left"><a href="#sql_query_start" >sql_query_start</a></td>
</tr>
<tr>
<td align="left">sql_query_stop</td>
<td align="left">sql_query_stop</td>
<td align="left">sql_query_stop</td>
<td align="left"><a href="#sql_query_stop" >sql_query_stop</a></td>
</tr>
<tr>
<td align="left">stream_auth_method</td>
<td align="left">stream_auth_method</td>
<td align="left">stream_auth_method</td>
<td align="left"><a href="#stream_auth_method" >stream_auth_method</a></td>
</tr>
<tr>
<td align="left">stream_authentication</td>
<td align="left">stream_authentication</td>
<td align="left">stream_authentication</td>
<td align="left"><a href="#stream_authentication" >stream_authentication</a></td>
</tr>
<tr>
<td align="left">stream_cors_header</td>
<td align="left">stream_cors_header</td>
<td align="left">stream_header_params</td>
<td align="left"><a href="#stream_header_params" >stream_header_params</a></td>
</tr>
<tr>
<td align="left">stream_grey</td>
<td align="left">stream_grey</td>
<td align="left">stream_grey</td>
<td align="left"><a href="#stream_grey" >stream_grey</a></td>
</tr>
<tr>
<td align="left">stream_localhost</td>
<td align="left">stream_localhost</td>
<td align="left">stream_localhost</td>
<td align="left"><a href="#stream_localhost" >stream_localhost</a></td>
</tr>
<tr>
<td align="left">stream_maxrate</td>
<td align="left">stream_maxrate</td>
<td align="left">stream_maxrate</td>
<td align="left"><a href="#stream_maxrate" >stream_maxrate</a></td>
</tr>
<tr>
<td align="left">stream_motion</td>
<td align="left">stream_motion</td>
<td align="left">stream_motion</td>
<td align="left"><a href="#stream_motion" >stream_motion</a></td>
</tr>
<tr>
<td align="left">stream_port</td>
<td align="left">stream_port</td>
<td align="left">stream_port</td>
<td align="left"><a href="#stream_port" >stream_port</a></td>
</tr>
<tr>
<td align="left">stream_preview_method</td>
<td align="left">stream_preview_method</td>
<td align="left">stream_preview_method</td>
<td align="left"><a href="#stream_preview_method" >stream_preview_method</a></td>
</tr>
<tr>
<td align="left">stream_preview_newline</td>
<td align="left">stream_preview_newline</td>
<td align="left">stream_preview_newline</td>
<td align="left"><a href="#stream_preview_newline" >stream_preview_newline</a></td>
</tr>
<tr>
<td align="left">stream_preview_scale</td>
<td align="left">stream_preview_scale</td>
<td align="left">stream_preview_scale</td>
<td align="left"><a href="#stream_preview_scale" >stream_preview_scale</a></td>
</tr>
<tr>
<td align="left">stream_quality</td>
<td align="left">stream_quality</td>
<td align="left">stream_quality</td>
<td align="left"><a href="#stream_quality" >stream_quality</a></td>
</tr>
<tr>
<td align="left">stream_tls</td>
<td align="left">stream_tls</td>
<td align="left">stream_tls</td>
<td align="left"><a href="#stream_tls" >stream_tls</a></td>
</tr>
<tr>
<td align="left">target_dir</td>
<td align="left">target_dir</td>
<td align="left">target_dir</td>
<td align="left"><a href="#target_dir" >target_dir</a></td>
</tr>
<tr>
<td align="left">text_changes</td>
<td align="left">text_changes</td>
<td align="left">text_changes</td>
<td align="left"><a href="#text_changes" >text_changes</a></td>
</tr>
<tr>
<td align="left">text_event</td>
<td align="left">text_event</td>
<td align="left">text_event</td>
<td align="left"><a href="#text_event" >text_event</a></td>
</tr>
<tr>
<td align="left">text_left</td>
<td align="left">text_left</td>
<td align="left">text_left</td>
<td align="left"><a href="#text_left" >text_left</a></td>
</tr>
<tr>
<td align="left">text_right</td>
<td align="left">text_right</td>
<td align="left">text_right</td>
<td align="left"><a href="#text_right" >text_right</a></td>
</tr>
<tr>
<td align="left">text_scale</td>
<td align="left">text_scale</td>
<td align="left">text_scale</td>
<td align="left"><a href="#text_scale" >text_scale</a></td>
</tr>
<tr>
<td align="left">threshold</td>
<td align="left">threshold</td>
<td align="left">threshold</td>
<td align="left"><a href="#threshold" >threshold</a></td>
</tr>
<tr>
<td align="left">threshold_maximum</td>
<td align="left">threshold_maximum</td>
<td align="left">threshold_maximum</td>
<td align="left"><a href="#threshold_maximum" >threshold_maximum</a></td>
</tr>
<tr>
<td align="left">threshold_tune</td>
<td align="left">threshold_tune</td>
<td align="left">threshold_tune</td>
<td align="left"><a href="#threshold_tune" >threshold_tune</a></td>
</tr>
<tr>
<td align="left">timelapse_codec</td>
<td align="left">timelapse_codec</td>
<td align="left">timelapse_codec</td>
<td align="left"><a href="#timelapse_codec" >timelapse_codec</a></td>
</tr>
<tr>
<td align="left">timelapse_filename</td>
<td align="left">timelapse_filename</td>
<td align="left">timelapse_filename</td>
<td align="left"><a href="#timelapse_filename" >timelapse_filename</a></td>
</tr>
<tr>
<td align="left">timelapse_fps</td>
<td align="left">timelapse_fps</td>
<td align="left">timelapse_fps</td>
<td align="left"><a href="#timelapse_fps" >timelapse_fps</a></td>
</tr>
<tr>
<td align="left">timelapse_interval</td>
<td align="left">timelapse_interval</td>
<td align="left">timelapse_interval</td>
<td align="left"><a href="#timelapse_interval" >timelapse_interval</a></td>
</tr>
<tr>
<td align="left">timelapse_mode</td>
<td align="left">timelapse_mode</td>
<td align="left">timelapse_mode</td>
<td align="left"><a href="#timelapse_mode" >timelapse_mode</a></td>
</tr>
<tr>
<td align="left">track_auto</td>
<td align="left">track_auto</td>
<td align="left">track_auto</td>
<td align="left"><a href="#track_auto" >track_auto</a></td>
</tr>
<tr>
<td align="left">track_generic_move</td>
<td align="left">track_generic_move</td>
<td align="left">track_generic_move</td>
<td align="left"><a href="#track_generic_move" >track_generic_move</a></td>
</tr>
<tr>
<td align="left">track_iomojo_id</td>
<td align="left">track_iomojo_id</td>
<td align="left">track_iomojo_id</td>
<td align="left"><a href="#track_iomojo_id" >track_iomojo_id</a></td>
</tr>
<tr>
<td align="left">track_maxx</td>
<td align="left">track_maxx</td>
<td align="left">track_maxx</td>
<td align="left"><a href="#track_maxx" >track_maxx</a></td>
</tr>
<tr>
<td align="left">track_maxy</td>
<td align="left">track_maxy</td>
<td align="left">track_maxy</td>
<td align="left"><a href="#track_maxy" >track_maxy</a></td>
</tr>
<tr>
<td align="left">track_motorx</td>
<td align="left">track_motorx</td>
<td align="left">track_motorx</td>
<td align="left"><a href="#track_motorx" >track_motorx</a></td>
</tr>
<tr>
<td align="left">track_motory</td>
<td align="left">track_motory</td>
<td align="left">track_motory</td>
<td align="left"><a href="#track_motory" >track_motory</a></td>
</tr>
<tr>
<td align="left">track_move_wait</td>
<td align="left">track_move_wait</td>
<td align="left">track_move_wait</td>
<td align="left"><a href="#track_move_wait" >track_move_wait</a></td>
</tr>
<tr>
<td align="left">track_port</td>
<td align="left">track_port</td>
<td align="left">track_port</td>
<td align="left"><a href="#track_port" >track_port</a></td>
</tr>
<tr>
<td align="left">track_speed</td>
<td align="left">track_speed</td>
<td align="left">track_speed</td>
<td align="left"><a href="#track_speed" >track_speed</a></td>
</tr>
<tr>
<td align="left">track_step_angle_x</td>
<td align="left">track_step_angle_x</td>
<td align="left">track_step_angle_x</td>
<td align="left"><a href="#track_step_angle_x" >track_step_angle_x</a></td>
</tr>
<tr>
<td align="left">track_step_angle_y</td>
<td align="left">track_step_angle_y</td>
<td align="left">track_step_angle_y</td>
<td align="left"><a href="#track_step_angle_y" >track_step_angle_y</a></td>
</tr>
<tr>
<td align="left">track_stepsize</td>
<td align="left">track_stepsize</td>
<td align="left">track_stepsize</td>
<td align="left"><a href="#track_stepsize" >track_stepsize</a></td>
</tr>
<tr>
<td align="left">track_type</td>
<td align="left">track_type</td>
<td align="left">track_type</td>
<td align="left"><a href="#track_type" >track_type</a></td>
</tr>
<tr>
<td align="left">tunerdevice</td>
<td align="left">tunerdevice</td>
<td align="left">tuner_device</td>
<td align="left"><a href="#tuner_device" >tuner_device</a></td>
</tr>
<tr>
<td align="left">frequency</td>
<td align="left">frequency</td>
<td align="left">video_params</td>
<td align="left"><a href="#video_params" >video_params</a></td>
</tr>
<tr>
<td align="left">input</td>
<td align="left">input</td>
<td align="left">video_params</td>
<td align="left"><a href="#video_params" >video_params</a></td>
</tr>
<tr>
<td align="left">norm</td>
<td align="left">norm</td>
<td align="left">video_params</td>
<td align="left"><a href="#video_params" >video_params</a></td>
</tr>
<tr>
<td align="left">v4l2_palette</td>
<td align="left">v4l2_palette</td>
<td align="left">video_params</td>
<td align="left"><a href="#video_params" >video_params</a></td>
</tr>
<tr>
<td align="left">vid_control_params</td>
<td align="left">vid_control_params</td>
<td align="left">video_params</td>
<td align="left"><a href="#video_params" >video_params</a></td>
</tr>
<tr>
<td align="left">videodevice</td>
<td align="left">videodevice</td>
<td align="left">video_device</td>
<td align="left"><a href="#video_device" >video_device</a></td>
</tr>
<tr>
<td align="left">video_pipe</td>
<td align="left">video_pipe</td>
<td align="left">video_pipe</td>
<td align="left"><a href="#video_pipe" >video_pipe</a></td>
</tr>
<tr>
<td align="left">video_pipe_motion</td>
<td align="left">video_pipe_motion</td>
<td align="left">video_pipe_motion</td>
<td align="left"><a href="#video_pipe_motion" >video_pipe_motion</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">watchdog_tmo</td>
<td align="left"><a href="#watchdog_tmo" >watchdog_tmo</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">watchdog_kill</td>
<td align="left"><a href="#watchdog_kill" >watchdog_kill</a></td>
</tr>
<tr>
<td align="left">webcontrol_auth_method</td>
<td align="left">webcontrol_auth_method</td>
<td align="left">webcontrol_auth_method</td>
<td align="left"><a href="#webcontrol_auth_method" >webcontrol_auth_method</a></td>
</tr>
<tr>
<td align="left">webcontrol_authentication</td>
<td align="left">webcontrol_authentication</td>
<td align="left">webcontrol_authentication</td>
<td align="left"><a href="#webcontrol_authentication" >webcontrol_authentication</a></td>
</tr>
<tr>
<td align="left">webcontrol_cert</td>
<td align="left">webcontrol_cert</td>
<td align="left">webcontrol_cert</td>
<td align="left"><a href="#webcontrol_cert" >webcontrol_cert</a></td>
</tr>
<tr>
<td align="left">webcontrol_cors_header</td>
<td align="left">webcontrol_cors_header</td>
<td align="left">webcontrol_header_params</td>
<td align="left"><a href="#webcontrol_header_params" >webcontrol_header_params</a></td>
</tr>
<tr>
<td align="left">webcontrol_interface</td>
<td align="left">webcontrol_interface</td>
<td align="left">webcontrol_interface</td>
<td align="left"><a href="#webcontrol_interface" >webcontrol_interface</a></td>
</tr>
<tr>
<td align="left">webcontrol_ipv6</td>
<td align="left">webcontrol_ipv6</td>
<td align="left">webcontrol_ipv6</td>
<td align="left"><a href="#webcontrol_ipv6" >webcontrol_ipv6</a></td>
</tr>
<tr>
<td align="left">webcontrol_key</td>
<td align="left">webcontrol_key</td>
<td align="left">webcontrol_key</td>
<td align="left"><a href="#webcontrol_key" >webcontrol_key</a></td>
</tr>
<tr>
<td align="left">webcontrol_localhost</td>
<td align="left">webcontrol_localhost</td>
<td align="left">webcontrol_localhost</td>
<td align="left"><a href="#webcontrol_localhost" >webcontrol_localhost</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">webcontrol_lock_attempts</td>
<td align="left"><a href="#webcontrol_lock_attempts" >webcontrol_lock_attempts</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">webcontrol_lock_max_ips</td>
<td align="left"><a href="#webcontrol_lock_max_ips" >webcontrol_lock_max_ips</a></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left">webcontrol_lock_minutes</td>
<td align="left"><a href="#webcontrol_lock_minutes" >webcontrol_lock_minutes</a></td>
</tr>
<tr>
<td align="left">webcontrol_parms</td>
<td align="left">webcontrol_parms</td>
<td align="left">webcontrol_parms</td>
<td align="left"><a href="#webcontrol_parms" >webcontrol_parms</a></td>
</tr>
<tr>
<td align="left">webcontrol_port</td>
<td align="left">webcontrol_port</td>
<td align="left">webcontrol_port</td>
<td align="left"><a href="#webcontrol_port" >webcontrol_port</a></td>
</tr>
<tr>
<td align="left">webcontrol_tls</td>
<td align="left">webcontrol_tls</td>
<td align="left">webcontrol_tls</td>
<td align="left"><a href="#webcontrol_tls" >webcontrol_tls</a></td>
</tr>
<tr>
<td align="left">width</td>
<td align="left">width</td>
<td align="left">width</td>
<td align="left"><a href="#width" >width</td>
</tr>
<tr>
<td align="left">mmalcam_name</td>
<td align="left">mmalcam_name</td>
<td align="left">mmalcam_name</td>
<td align="left">removed</td>
</tr>
<tr>
<td align="left">mmalcam_control_params</td>
<td align="left">mmalcam_control_params</td>
<td align="left">mmalcam_params</td>
<td align="left">removed</td>
</tr>
</table>
</div>
</ul>
<h2><a name="Configuration_OptionsTopic"></a> Configuration Options-Listed by Topic </h2>
<ul>
<p></p>
These are the options that can be used in the config file.
<p></p>
All number values are integer numbers (no decimals allowed). Boolean options can be on or off.
<p></p>
Some configuration options are only used if Motion is built on a system that has the matching software libraries installed (MySQL, PostgreSQL, SQLite, FFMPEG, etc).
<p></p>
<p></p>
<a name="OptTopic_System_Processing" ></a>
<a href="#OptDetail_System_Processing" >System Processing-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#daemon" >daemon</a> </td>
<td bgcolor="#edf4f9" ><a href="#setup_mode" >setup_mode</a> </td>
<td bgcolor="#edf4f9" ><a href="#pid_file" >pid_file</a> </td>
<td bgcolor="#edf4f9" ><a href="#log_file" >log_file</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#log_level" >log_level</a> </td>
<td bgcolor="#edf4f9" ><a href="#log_type" >log_type</a> </td>
<td bgcolor="#edf4f9" ><a href="#quiet" >quiet</a> </td>
<td bgcolor="#edf4f9" ><a href="#native_language" >native_language</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#camera_name" >camera_name</a> </td>
<td bgcolor="#edf4f9" ><a href="#camera_id" >camera_id</a> </td>
<td bgcolor="#edf4f9" ><a href="#camera" >camera</a> </td>
<td bgcolor="#edf4f9" ><a href="#camera_dir" >camera_dir</a> </td>
</tr>
<td bgcolor="#edf4f9" ><a href="#target_dir" >target_dir</a> </td>
<td bgcolor="#edf4f9" ><a href="#watchdog_tmo" >watchdog_tmo</a> </td>
<td bgcolor="#edf4f9" ><a href="#watchdog_kill" >watchdog_kill</a> </td>
<tr>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Video4Linux_Devices" ></a>
<a href="#OptDetail_Video4Linux_Devices" >Video4Linux Devices-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#video_device" >video_device</a> </td>
<td bgcolor="#edf4f9" ><a href="#video_params" >video_params</a> </td>
<td bgcolor="#edf4f9" ><a href="#auto_brightness" >auto_brightness</a> </td>
<td bgcolor="#edf4f9" ><a href="#tuner_device" >tuner_device</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#roundrobin_frames" >roundrobin_frames</a> </td>
<td bgcolor="#edf4f9" ><a href="#roundrobin_skip" >roundrobin_skip</a> </td>
<td bgcolor="#edf4f9" ><a href="#roundrobin_switchfilter" >roundrobin_switchfilter</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Network_Cameras" ></a>
<a href="#OptDetail_Network_Cameras" >Network Cameras-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#netcam_url" >netcam_url</a> </td>
<td bgcolor="#edf4f9" ><a href="#netcam_params" >netcam_params</a> </td>
<td bgcolor="#edf4f9" ><a href="#netcam_high_url" >netcam_high_url</a> </td>
<td bgcolor="#edf4f9" ><a href="#netcam_high_params" >netcam_high_params</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#netcam_userpass" >netcam_userpass</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Image_Processing" ></a>
<a href="#OptDetail_Image_Processing" >Image Processing-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#width" >width</a> </td>
<td bgcolor="#edf4f9" ><a href="#height" >height</a> </td>
<td bgcolor="#edf4f9" ><a href="#framerate" >framerate</a> </td>
<td bgcolor="#edf4f9" ><a href="#minimum_frame_time" >minimum_frame_time</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#rotate" >rotate</a> </td>
<td bgcolor="#edf4f9" ><a href="#flip_axis" >flip_axis</a> </td>
<td bgcolor="#edf4f9" ><a href="#locate_motion_mode" >locate_motion_mode</a> </td>
<td bgcolor="#edf4f9" ><a href="#locate_motion_style" >locate_motion_style</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#text_left" >text_left</a> </td>
<td bgcolor="#edf4f9" ><a href="#text_right" >text_right</a> </td>
<td bgcolor="#edf4f9" ><a href="#text_changes" >text_changes</a> </td>
<td bgcolor="#edf4f9" ><a href="#text_scale" >text_scale</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#text_event" >text_event</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Motion_Detection" ></a>
<a href="#OptDetail_Motion_Detection" >Motion Detection-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#emulate_motion" >emulate_motion</a> </td>
<td bgcolor="#edf4f9" ><a href="#pause" >pause</a> </td>
<td bgcolor="#edf4f9" ><a href="#threshold" >threshold</a> </td>
<td bgcolor="#edf4f9" ><a href="#threshold_maximum" >threshold_maximum</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#threshold_tune" >threshold_tune</a> </td>
<td bgcolor="#edf4f9" ><a href="#noise_level" >noise_level</a> </td>
<td bgcolor="#edf4f9" ><a href="#noise_tune" >noise_tune</a> </td>
<td bgcolor="#edf4f9" ><a href="#despeckle_filter" >despeckle_filter</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#area_detect" >area_detect</a> </td>
<td bgcolor="#edf4f9" ><a href="#mask_file" >mask_file</a> </td>
<td bgcolor="#edf4f9" ><a href="#mask_privacy" >mask_privacy</a> </td>
<td bgcolor="#edf4f9" ><a href="#smart_mask_speed" >smart_mask_speed</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#lightswitch_percent" >lightswitch_percent</a> </td>
<td bgcolor="#edf4f9" ><a href="#lightswitch_frames" >lightswitch_frames</a> </td>
<td bgcolor="#edf4f9" ><a href="#minimum_motion_frames" >minimum_motion_frames</a> </td>
<td bgcolor="#edf4f9" ><a href="#event_gap" >event_gap</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#pre_capture" >pre_capture</a> </td>
<td bgcolor="#edf4f9" ><a href="#post_capture" >post_capture</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Scripts" ></a>
<a href="#OptDetail_Scripts" >Script Execution-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#on_event_start" >on_event_start</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_event_end" >on_event_end</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_picture_save" >on_picture_save</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_motion_detected" >on_motion_detected</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#on_area_detected" >on_area_detected</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_movie_start" >on_movie_start</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_movie_end" >on_movie_end</a> </td>
<td bgcolor="#edf4f9" ><a href="#on_camera_lost" >on_camera_lost</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#on_camera_found" >on_camera_found</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Pictures" ></a>
<a href="#OptDetail_Pictures" >Pictures-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#picture_output" >picture_output</a> </td>
<td bgcolor="#edf4f9" ><a href="#picture_output_motion" >picture_output_motion</a> </td>
<td bgcolor="#edf4f9" ><a href="#picture_type" >picture_type</a> </td>
<td bgcolor="#edf4f9" ><a href="#picture_quality" >picture_quality</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#picture_exif" >picture_exif</a> </td>
<td bgcolor="#edf4f9" ><a href="#picture_filename" >picture_filename</a> </td>
<td bgcolor="#edf4f9" ><a href="#snapshot_interval" >snapshot_interval</a> </td>
<td bgcolor="#edf4f9" ><a href="#snapshot_filename" >snapshot_filename</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Movies" ></a>
<a href="#OptDetail_Movies" >Movies-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#movie_output" >movie_output</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_output_motion" >movie_output_motion</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_max_time" >movie_max_time</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_bps" >movie_bps</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#movie_quality" >movie_quality</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_codec" >movie_codec</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_duplicate_frames" >movie_duplicate_frames</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_passthrough" >movie_passthrough</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#movie_filename" >movie_filename</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_extpipe_use" >movie_extpipe_use</a> </td>
<td bgcolor="#edf4f9" ><a href="#movie_extpipe" >movie_extpipe</a> </td>
<td bgcolor="#edf4f9" ><a href="#timelapse_filename" >timelapse_filename</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#timelapse_interval" >timelapse_interval</a> </td>
<td bgcolor="#edf4f9" ><a href="#timelapse_mode" >timelapse_mode</a> </td>
<td bgcolor="#edf4f9" ><a href="#timelapse_codec" >timelapse_codec</a> </td>
<td bgcolor="#edf4f9" ><a href="#timelapse_fps" >timelapse_fps</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Pipe" ></a>
<a href="#OptDetail_Pipe" >Pipes-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#video_pipe" >video_pipe</a> </td>
<td bgcolor="#edf4f9" ><a href="#video_pipe_motion" >video_pipe_motion</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Webcontrol" ></a>
<a href="#OptDetail_Webcontrol" >Webcontrol-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#webcontrol_port" >webcontrol_port</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_ipv6" >webcontrol_ipv6</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_localhost" >webcontrol_localhost</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_parms" >webcontrol_parms</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#webcontrol_interface" >webcontrol_interface</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_auth_method" >webcontrol_auth_method</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_authentication" >webcontrol_authentication</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_tls" >webcontrol_tls</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#webcontrol_cert" >webcontrol_cert</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_key" >webcontrol_key</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_header_params" >webcontrol_header_params</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_lock_attempts" >webcontrol_lock_attempts</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#webcontrol_lock_minutes" >webcontrol_lock_minutes</a> </td>
<td bgcolor="#edf4f9" ><a href="#webcontrol_lock_max_ips" >webcontrol_lock_max_ips</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Stream" ></a>
<a href="#OptDetail_Stream" >Live Stream-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#stream_port" >stream_port</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_localhost" >stream_localhost</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_auth_method" >stream_auth_method</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_authentication" >stream_authentication</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#stream_tls" >stream_tls</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_header_params" >stream_header_params</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_preview_scale" >stream_preview_scale</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_preview_newline" >stream_preview_newline</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#stream_preview_method" >stream_preview_method</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_quality" >stream_quality</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_grey" >stream_grey</a> </td>
<td bgcolor="#edf4f9" ><a href="#stream_maxrate" >stream_maxrate</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#stream_motion" >stream_motion</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Database" ></a>
<a href="#OptDetail_Database" >Database-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#database_type" >database_type</a> </td>
<td bgcolor="#edf4f9" ><a href="#database_dbname" >database_dbname</a> </td>
<td bgcolor="#edf4f9" ><a href="#database_host" >database_host</a> </td>
<td bgcolor="#edf4f9" ><a href="#database_port" >database_port</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#database_user" >database_user</a> </td>
<td bgcolor="#edf4f9" ><a href="#database_password" >database_password</a> </td>
<td bgcolor="#edf4f9" ><a href="#database_busy_timeout" >database_busy_timeout</a> </td>
<td bgcolor="#edf4f9" ><a href="#sql_log_picture" >sql_log_picture</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#sql_log_snapshot" >sql_log_snapshot</a> </td>
<td bgcolor="#edf4f9" ><a href="#sql_log_movie" >sql_log_movie</a> </td>
<td bgcolor="#edf4f9" ><a href="#sql_log_timelapse" >sql_log_timelapse</a> </td>
<td bgcolor="#edf4f9" ><a href="#sql_query" >sql_query</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#sql_query_start" >sql_query_start</a> </td>
<td bgcolor="#edf4f9" ><a href="#sql_query_stop" >sql_query_stop</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<a name="OptTopic_Tracking" ></a>
<a href="#OptDetail_Tracking" >Tracking-General Info</a>
<ul>
<table class="tbldetail" border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="250px">
<col width="250px">
<col width="250px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" ><a href="#track_type" >track_type</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_auto" >track_auto</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_port" >track_port</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_motorx" >track_motorx</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#track_motorx_reverse" >track_motorx_reverse</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_motory" >track_motory</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_motory_reverse" >track_motory_reverse</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_maxx" >track_maxx</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#track_minx" >track_minx</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_maxy" >track_maxy</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_miny" >track_miny</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_homex" >track_homex</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#track_homey" >track_homey</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_iomojo_id" >track_iomojo_id</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_step_angle_x" >track_step_angle_x</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_step_angle_y" >track_step_angle_y</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" ><a href="#track_move_wait" >track_move_wait</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_speed" >track_speed</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_stepsize" >track_stepsize</a> </td>
<td bgcolor="#edf4f9" ><a href="#track_generic_move" >track_generic_move</a> </td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p></p>
</ul>
<p></p>
</ul>
<h2><a name="Configuration_OptionsDetail"></a> Configuration Options-Detail Descriptions </h2>
<ul>
<p></p>
<p></p>
The following section provides detailed descriptions of each of the configuration options.
<p></p>
<h3><a name="conversion_specifiers"></a>Conversion Specifiers</h3>
<ul>
<div class="tblconvr">
<table border="1" class="fixed" >
<colgroup>
<col width="50px">
<col width="300px">
<col width="50px">
<col width="300px">
<col width="50px">
<col width="300px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" >%Y </a> </td>
<td bgcolor="#edf4f9" >year</a> </td>
<td bgcolor="#edf4f9" >%m </a> </td>
<td bgcolor="#edf4f9" >month</a> </td>
<td bgcolor="#edf4f9" >%d </a> </td>
<td bgcolor="#edf4f9" >day</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%H </a> </td>
<td bgcolor="#edf4f9" >hour</a> </td>
<td bgcolor="#edf4f9" >%M </a> </td>
<td bgcolor="#edf4f9" >minute</a> </td>
<td bgcolor="#edf4f9" >%S </a> </td>
<td bgcolor="#edf4f9" >second</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%T </a> </td>
<td bgcolor="#edf4f9" >HH:MM:SS </a> </td>
<td bgcolor="#edf4f9" >%v </a> </td>
<td bgcolor="#edf4f9" >event</a> </td>
<td bgcolor="#edf4f9" >%q </a> </td>
<td bgcolor="#edf4f9" >frame number</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%t</a> </td>
<td bgcolor="#edf4f9" >camera id number</a> </td>
<td bgcolor="#edf4f9" >%D </a> </td>
<td bgcolor="#edf4f9" >changed pixels</a> </td>
<td bgcolor="#edf4f9" >%N </a> </td>
<td bgcolor="#edf4f9" >noise level</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%w </a> </td>
<td bgcolor="#edf4f9" >width of the image</a> </td>
<td bgcolor="#edf4f9" >%h </a> </td>
<td bgcolor="#edf4f9" >height of the image</a> </td>
<td bgcolor="#edf4f9" >%i </a> </td>
<td bgcolor="#edf4f9" >width of motion area</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%J </a> </td>
<td bgcolor="#edf4f9" >height of motion area</a> </td>
<td bgcolor="#edf4f9" >%K </a> </td>
<td bgcolor="#edf4f9" >X coordinates of motion center</a> </td>
<td bgcolor="#edf4f9" >%L </a> </td>
<td bgcolor="#edf4f9" >Y coordinates of motion center</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%C </a> </td>
<td bgcolor="#edf4f9" >value defined by text_event</a> </td>
<td bgcolor="#edf4f9" >%f</a> </td>
<td bgcolor="#edf4f9" >filename with full path</a> </td>
<td bgcolor="#edf4f9" >%n </a> </td>
<td bgcolor="#edf4f9" >number indicating filetype</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%o</a> </td>
<td bgcolor="#edf4f9" >threshold</a> </td>
<td bgcolor="#edf4f9" >%Q</a> </td>
<td bgcolor="#edf4f9" >Number of labels from despeckle</a> </td>
<td bgcolor="#edf4f9" >%{eventid}</a> </td>
<td bgcolor="#edf4f9" >Unique identifier for event (cam id + date/time)</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%$</a> </td>
<td bgcolor="#edf4f9" >camera name</a> </td>
<td bgcolor="#edf4f9" >%{fps}</a> </td>
<td bgcolor="#edf4f9" >current frames per second</a> </td>
<td bgcolor="#edf4f9" >%{host}</a> </td>
<td bgcolor="#edf4f9" >name of computer running Motion</a> </td>
</tr>
<tr>
<td bgcolor="#edf4f9" >%{ver}</a> </td>
<td bgcolor="#edf4f9" >The version of Motion</a> </td>
</tr>
</tbody>
</table>
</div>
<p></p>
The use of quotation marks around string is permitted. In addition to the above, the conversion
specifiers include the same options as for the C function strftime (3).
<p></p>
</ul>
<h3><a name="OptDetail_System_Processing"></a>System Processing</h3>
<ul>
<p></p>
<h3><a name="daemon"></a> daemon </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
When Motion is started, immediately go to daemon mode and release the terminal. Set
the option to off when running Motion as a service.
<p></p>
<h3><a name="setup_mode"></a> setup_mode </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
When this option is turned on, Motion starts in setup mode so that the
parameters can be set more easily. In setup mode two things happen:
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 id number.
When you look at the 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
labeled 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.
Here is a suggestion how to initially setup Motion. (There are other ways to accomplish this.)
<p></p>
<ul>
<li> Disable despeckle (comment it out in motion.conf).</li>
<li> Disable smartmask</li>
<li> Enable both the webcontrol and streams make sure to specify the webcontrol_parms. The below
assumes that the webcontrol is specified as port 8080 and the stream as 8081
</li>
<li> Start Motion in setup mode</li>
<li> Open a browser and connect to the webcontrol 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. 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.</li>
<li> Set the threshold to what you want to trigger Motion.</li>
</ul>
In normal mode you can use the same setting with two browser tabs and experiment with
settings of the camera if needed.
From the web interface you can ask Motion to write all your changes back to the config files
(motion.conf and camera config files).
<p></p>
<h3><a name="pid_file"></a> pid_file </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Specify the full path and file name in order to store the pid for processing.
<p></p>
<h3><a name="log_file"></a> log_file </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Use this option to specify the full path and filename to use
for logging of the messages generated from Motion. If this option
is not defined, the stderr and syslog is used. Note that Motion
can generate a LOT of messages and as a result, this option should
be considered if the log_level is at any of the higher levels.
<p></p>
<h3><a name="log_level"></a> log_level </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 9 </li>
<li> Default: 6</li>
</ul>
<p></p>
This option specifies the level of verbosity of the messages sent from Motion.
At a level of 8(DBG), there are a LOT of messages. At a level of 1(EMR) virtually no
messages will be output.
<p></p>
The various levels are [1..9] (EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).
<p></p>
When reporting any issues or errors associated with the Motion application,
use the INF level.
<p></p>
<p></p>
<h3><a name="log_type"></a> log_type </h3>
<p></p>
<ul>
<li> Type: Discreet Strings </li>
<li> Range / Valid values: See Below</li>
<li> Default: ALL</li>
</ul>
<p></p>
The different components of Motion use different log types. This option allows the
user to only show the messages from particular components. The choices for this option
are: COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL
<p></p>
<h3><a name="quiet"></a> quiet </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
Be quiet, don't output beeps when detecting motion.
Only works in non-daemon mode.
<p></p>
<h3><a name="native_language"></a> native_language</h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
Enable native language for Motion webcontrol and log messages.
<p></p>
Motion will use the locale variable LANGUAGE for determining the webcontrol and log messages. If
messages or the webcontrol still display in English, then the messages / words have not yet been translated.
<p></p>
Please consider helping the developers by submitting pull requests to add new translations and correcting
any inaccurate translations.
<p></p>
When this option is specified as 'off', the webcontrol and log messages will be provided in English.
<p></p>
<h3><a name="camera_name"></a> camera_name </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This option specifies a camera name to be used in the format
specifiers as well as on the web interface.
<p></p>
<h3><a name="camera_id"></a> camera_id </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 32000</li>
<li> Default: The sequence that the camera file is read</li>
</ul>
<p></p>
This option is useful for situations where there are multiple cameras being
used by Motion. This option allows for the assignment of a numeric id number
that can be used in database queries, format specifiers as well as for the web
interface and streams.
<p></p>
If this option is not specified, the thread number as determined by Motion is used. The
number assigned to each camera must be unique.
<p></p>
When using multiple cameras, the default for the main thread is 0 (zero) but this can be
overridden as needed by specifying a camera_id in the motion.conf file even though there
are not any cameras running on this thread.
<p></p>
<h3><a name="camera"></a> camera </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name for the camera file.
Motion allows for this line to be listed in the motion.conf file multiple
times. These specifications should be the LAST lines in the
motion.conf file.
See the <a href="#configfiles">Configuration Files</a> section within
this guide for a complete discussion of what to put into the
camera0.conf, camera1.conf, cameraX.conf files that would be specified
in this option.
<p></p>
<h3><a name="camera_dir"></a> camera_dir </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This option specifies a directory to contain the individual camera configuration files.
Any files ending in '.conf' in this directory will be read as a camera config file.
<br />Users can disable a camera (config file) by renaming it so it does not end with '.conf'.
<p></p>
<h3><a name="target_dir"></a> target_dir </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined = current directory</li>
</ul>
<p></p>
The full path for the target directory for picture and movie files to be saved.
The default is the current directory. This is the target directory for all snapshots,
picture files and movie files.
You will normally always want to specify this parameter as an absolute path.
<p></p>
Note that the file name options are all saved relative to this target_dir
This means in principle that you can specify target_dir as '/' and be 100% flexible. But this is
NOT recommended. It is recommended that this directory be specified as deep as possible.
<p></p>
<h3><a name="watchdog_tmo"></a>watchdog_tmo</h3>
<p></p>
<ul>
<li> Type: int</li>
<li> Range / Valid values: Integer</li>
<li> Default: 30</li>
</ul>
<p></p>
The number of seconds a camera can be non-responsive before Motion attempts to stop the camera gracefully.
<p></p>
<h3><a name="watchdog_kill"></a>watchdog_kill</h3>
<p></p>
<ul>
<li> Type: int</li>
<li> Range / Valid values: Integer</li>
<li> Default: 30</li>
</ul>
<p></p>
The number of seconds after the timeout has expired until Motion forcefully kills the camera that is unresponsive.
<p></p>
</ul>
<h3><a name="OptDetail_Video4Linux_Devices"></a>Video4Linux Device</h3>
<ul>
<p></p>
Please refer to the <a href="#Basic_Setup">Basic Setup</a> section of this guide for an additional discussion
of Video4Linux devices and how to test and specify them correctly for Motion.
<h3><a name="video_device"></a> video_device </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: /dev/video0 </li>
</ul>
<p></p>
The video device to be used for capturing. Default is /dev/video0.
See the <a href="#Basic_Setup">Basic Setup</a>
section of this guide for an additional discussion of this option.
<p></p>
This option is the usual method to specify the video4linux device name. If the camera does
not work when specifying it with this option, it is also possible to specify the device
in the <a href="#netcam_url" >netcam_url</a> with the v4l2 prefix option. The
<a href="#netcam_url" >netcam_url</a> option uses an alternative method to open and operate the
device which may work with this option fails. If the <a href="#netcam_url" >netcam_url</a> is used for
either this alternative method or for a normal network camera, the video_device option is ignored.
<p></p>
Since the exact device number is set by the kernel upon boot, when there is more than one video device
it is possible that the particular cameras that were assigned to /dev/video0 and /dev/video1 may switch. In
order to set up Motion so that a particular camera is always assigned the same way, users can set up
a symbolic link using udev rules. To do this a unique attribute must be identified for each camera. The
camera attributes can be viewed by using the command
<code>udevadm info -a -p $(udevadm info -q path -n /dev/video0) </code> while the camera is attached. Usually
a serial number can be used. ("Usually" because some cameras have been observed to have the same serial
number for different cameras)
<p></p>
Once a unique attribute has been identified for each camera, edit or create the file
<code>/etc/udev/rules.d/99-local.rules</code>.
<p></p>
Assuming that the unique attribute for the camera was name and was
<code>ATTR{name}=="Philips SPC 900NC webcam"</code> you would add the following line to the
99-local.rules file:
<code> KERNEL=="video[0-9]*", ATTR{name}=="Philips\ SPC\ 900NC*", SYMLINK+="video-webcam0"</code>
<p></p>
Once the change has been made and saved, reboot the computer and there should now be a "sticky" device called
/dev/video-webcam0
<p></p>
<h3><a name="video_params"></a>video_params</h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
For most devices the configuration options are automatically assigned but devices also usually allow
the user to change certain settings to suit their needs. The options that the camera manufacturer permits
the user to change are called "controls". The <a href="#video_params" >video_params</a> option allows users
to specify values for these controls when Motion runs.
<p></p>
The <a href="#video_params" >video_params</a> option also allows users to specify some Motion specific
parameters that are used to open the camera. In previous versions of Motion, these options were the
frequency, input, norm and v4l2_palette options. These options have now been embedded into the
<a href="#video_params" >video_params</a> option to provide consistency.
<p></p>
The following is the list of previous Motion options that have now been replaced by the
<a href="#video_params" >video_params</a> option.
<ul>
<li> brightness</li>
<li> contrast</li>
<li> hue</li>
<li> power_line_frequency</li>
<li> saturation</li>
<li> frequency</li>
<li> input</li>
<li> norm</li>
<li> v4l2_palette</li>
</ul>
<p></p>
While it always recommended that users remove older configuration options and only use the new options,
if users have within the configuration file any of the deprecated options list above, Motion will
continue to read those values and upgrade them into the new <a href="#video_params" >video_params</a>
option. The resulting pictures from the device may however may not be comparable due to different
interpretations of the values.
<p></p>
It is therefore highly recommended that users remove the old configuration values and calibrate their devices
only using this new configuration option.
<p></p>
To use this parameter, users will need to first identify the name or ID description of the particular control.
Next, simply specify the control/id followed by an equal sign and then the desired value. The specification
of multiple controls can be specified by separating them with a comma.
<p></p>
Since the name of some controls can include a comma or spaces, names can also be specified by enclosing them
in double quotes. To help users know which controls are available for their device, the Motion log will
report the available controls, associated IDs and minimum/maximum values permitted when the
<a href="#log_level" >log_level</a> is specified as INF or higher.
<p></p>
e.g. Change the <a href="#log_level" >log_level</a>
to INF, start up Motion with the device attached and specified, let it report items to the log and then
shut Motion down. Within the Motion log, it will list which controls the device has that can be adjusted.
<p></p>
The following is a sample output from the log and examples of how to specify the parameters
<p></p>
<ul style="list-style: none;">
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ---------Controls---------</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: V4L2 ID Name and Range</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963776 Brightness, 0 to 127</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963777 Contrast, 0 to 63</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963778 Saturation, -100 to 100</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963788 White Balance, Automatic, 0 to 4</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 0 Indoor (Incandescant Lighting)</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 1 Outdoor (Sunlight) Mode</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 2 Indoor (Fluorescent Lighting) M</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 3 Manual Mode</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 4 Auto Mode</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963790 Red Balance, 0 to 255</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963791 Blue Balance, 0 to 255</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963792 Gamma, 0 to 31</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963793 Exposure, 0 to 255</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963794 Gain, Automatic, 0 to 1</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963795 Gain, 0 to 63</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963804 Backlight Compensation, 0 to 1</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963807 Color Effects, 0 to 1</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 0 None</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: menu item: Value 1 Black & White</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID09963809 Band-Stop Filter, 0 to 1</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025216 Auto contour, 0 to 1</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025217 Contour, 0 to 63</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025218 Dynamic Noise Reduction, 0 to 3</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025219 Auto White Balance Speed, 1 to 32</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025220 Auto White Balance Delay, 0 to 63</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025221 Save User Settings, 0 to 0</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025222 Restore User Settings, 0 to 0</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: ID10025223 Restore Factory Settings, 0 to 0</li>
<li>[1:ml1:c1] [INF] [VID] v4l2_ctrls_list: --------------------------</li>
</ul>
<p></p>
Example 1: Set the gain to manual, then the gain to 50 and the brightness to 30
<p></p>
<code>video_params "Gain, Automatic"=1,ID09963795=50, brightness=30</code>
<p></p>
a equally valid alternative method for specifying this example would be
<p></p>
<code>video_params ID09963794=1,ID09963795=50, ID09963776=30</code>
<p></p>
or another way of specifying it could be
<p></p>
<code>video_params ID09963794=1,"Gain"=50, "brightness"=30</code>
<p></p>
Example 2: Set the saturation to 50 and the contrast to 100
<p></p>
<code>video_params saturation=50,contrast=100</code>
<p></p>
As can be seen in these examples, the specification can use either the control ID or the name of the
control. If the control name has embedded blanks or commas, then it must be enclosed in quotes. Special
care should be taken when using the name. As shown above, there is a comma that separates the name
of the control versus the valid range of values. That comma is NOT part of the control name and only
delimits the end of the name for the Motion log.
<p></p>
<h4> palette </h4>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 20</li>
<li> Default: 17</li>
</ul>
<p></p>
The palette option is specified in the <a href="#video_params" >video_params</a> option and
allows the user to specify the preferred palette for Motion to use. If the video device does not
support this preferred format, Motion will loop through the available palettes to try to find one
that is supported by both Motion and the device.
<p></p>
Motion will report the supported palettes of the device when Motion starts when the
<a href="#log_level" >log_level</a> is specified as NTC or higher.
<p></p>
The default of 17 is highly preferred over <u>all</u> other formats since this the native
format that Motion uses internally.
<p></p>
The following are each of the palette options. For the Motion configuration,
specify the numeric value as the Motion option.
<p></p>
<div class="tblpaltte">
<table border="1" class="fixed" >
<colgroup>
<col width="250px">
<col width="200px">
<col width="200px">
</colgroup>
<tbody>
<tr>
<td bgcolor="#edf4f9" align="center" > V4l2 Option</td>
<td bgcolor="#edf4f9" align="center" > FOURCC</td>
<td bgcolor="#edf4f9" align="center" > v4l2_palette option </td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SN9C10X</td>
<td bgcolor="#edf4f9" align="center" >S910</td>
<td bgcolor="#edf4f9" align="center" >0</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SBGGR16</td>
<td bgcolor="#edf4f9" align="center" >BYR2</td>
<td bgcolor="#edf4f9" align="center" >1</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SBGGR8</td>
<td bgcolor="#edf4f9" align="center" >BA81</td>
<td bgcolor="#edf4f9" align="center" >2</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SPCA561</td>
<td bgcolor="#edf4f9" align="center" >S561</td>
<td bgcolor="#edf4f9" align="center" >3</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SGBRG8</td>
<td bgcolor="#edf4f9" align="center" >GBRG</td>
<td bgcolor="#edf4f9" align="center" >4</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_SGRBG8</td>
<td bgcolor="#edf4f9" align="center" >GRBG</td>
<td bgcolor="#edf4f9" align="center" >5</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" >V4L2_PIX_FMT_PAC207</td>
<td bgcolor="#edf4f9" align="center" >P207</td>
<td bgcolor="#edf4f9" align="center" >6</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_PJPG</td>
<td bgcolor="#edf4f9" align="center" >PJPG</li>
<td bgcolor="#edf4f9" align="center" >7</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_MJPEG</td>
<td bgcolor="#edf4f9" align="center" >MJPG</li>
<td bgcolor="#edf4f9" align="center" >8</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_JPEG</td>
<td bgcolor="#edf4f9" align="center" >JPEG</li>
<td bgcolor="#edf4f9" align="center" >9</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_RGB24</td>
<td bgcolor="#edf4f9" align="center" >RGB3</li>
<td bgcolor="#edf4f9" align="center" >10</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_SPCA501</td>
<td bgcolor="#edf4f9" align="center" >S501</li>
<td bgcolor="#edf4f9" align="center" >11</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_SPCA505</td>
<td bgcolor="#edf4f9" align="center" >S505</li>
<td bgcolor="#edf4f9" align="center" >12</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_SPCA508</td>
<td bgcolor="#edf4f9" align="center" >S508</li>
<td bgcolor="#edf4f9" align="center" >13</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_UYVY</td>
<td bgcolor="#edf4f9" align="center" >UYVY</li>
<td bgcolor="#edf4f9" align="center" >14</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_YUYV</td>
<td bgcolor="#edf4f9" align="center" >YUYV</li>
<td bgcolor="#edf4f9" align="center" >15</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_YUV422P</td>
<td bgcolor="#edf4f9" align="center" >422P</li>
<td bgcolor="#edf4f9" align="center" >16</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_YUV420</td>
<td bgcolor="#edf4f9" align="center" >YU12</li>
<td bgcolor="#edf4f9" align="center" >17</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_Y10</td>
<td bgcolor="#edf4f9" align="center" >Y10</li>
<td bgcolor="#edf4f9" align="center" >18</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_Y12</td>
<td bgcolor="#edf4f9" align="center" >Y12</li>
<td bgcolor="#edf4f9" align="center" >19</td>
</tr>
<tr>
<td bgcolor="#edf4f9" align="left" > V4L2_PIX_FMT_GREY</td>
<td bgcolor="#edf4f9" align="center" >GREY</li>
<td bgcolor="#edf4f9" align="center" >20</td>
</tr>
</tbody>
</table>
</div>
<p></p>
It is possible that after looping through all of the palette options for the camera, Motion will not
find a palette that is acceptable for processing. In this situation, it may be possible to be the
camera to work using the <a href="#netcam_url" >netcam_url</a> option with the v4l2 prefix.
<p></p>
<h4> input </h4>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: -1, 0 - ? </li>
<li> Default: -1 </li>
</ul>
<p></p>
The input option is specified in the <a href="#video_params" >video_params</a> option and
allows the user to specify the input channel to use for the device.
<p></p>
For USB cameras, the input option should specify -1.
<p></p>
For other devices such as capture cards, the input option is device dependent but usually starts
with zero. Using an external application such as VLC can allow for easier specification
of the input associated with the camera.
<p></p>
<h4> norm </h4>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)</li>
<li> Default: 0 (PAL) </li>
</ul>
<p></p>
The norm option is specified in the <a href="#video_params" >video_params</a> option and
allows the user to specify the television norm to use for the device.
<p></p>
<h4>frequency </h4>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 999999</li>
<li> Default: 0 (Not set)</li>
</ul>
<p></p>
The frequency option is specified in the <a href="#video_params" >video_params</a> option and
allows the user to specify the frequency to use for the device.
<p></p>
The default is 0 meaning it is not set. This option is only relevant if the device is a TV tuner
card where the frequency can be set.
<p></p>
<h3><a name="auto_brightness"></a> auto_brightness </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 3</li>
<li> Default: 0 </li>
</ul>
<p></p>
Let motion regulate the brightness of a video device. Only recommended for cameras without auto brightness
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 which sometimes don't have such an option in
hardware. The auto_brightness feature will adjust the brightness of the device up or down until the value
is close to a target value.
<p></p>
By default, the target value is the midpoint between the minimum and maximum value permitted for the control
being adjusted. (See methods available below)
<p></p>
Users can specify a different target value by specifying a value for the control in
the <a href="#video_params">video_params</a> option.
<p></p>
Motion allows for three possible methods for adjusting the brightness.
<ul>
<li> 1: Use the brightness control to regulate the brightness (equivalent to specifying on/yes)</li>
<li> 2: Use the exposure control to regulate the brightness</li>
<li> 3: Use the exposure absolute control to regulate the brightness</li>
</ul>
<p></p>
<h3><a name="tuner_device"></a> tuner_device </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: /dev/tuner0 </li>
</ul>
<p></p>
The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled
for FreeBSD with the bktr option.
See the <a href="#Basic_Setup">Basic Setup</a> section of this guide for a additional discussion of this option.
<p></p>
<h3><a name="roundrobin_frames"></a> roundrobin_frames </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 2147483647</li>
<li> Default: 1</li>
</ul>
<p></p>
Specifies the number of frames to capture before switching inputs, this way also slow switching (e.g. every second)
is possible. The Round Robin feature is automatically activated where multiple cameras are sharing the same video
device. Each camera can then set different <a href="#input">input</a> or
<a href="#frequency">frequency</a> options to change camera.
If multiple cameras use the same video device, they each can capture roundrobin_frames number of frames before having
to share the device with the other cameras.
<p></p>
Round Robin is not relevant for Network cameras or standard USB web cameras. It is used with video capture
cards which have multiple inputs per video chip. This is not the ideal way to run multiple cameras.
When the capture card changes input it takes some time before the decoder chip has synchronized to the new camera.
You can improve this if you have expensive cameras with a synchronized input. Only one camera can be decoded
at a time so if you have 4 cameras connected 3 of the cameras 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
afford 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. (or better yet, it multiple cheap network cameras)
If multiple cameras use the same video device, they each can capture
<a href="#roundrobin_frames">roundrobin_frames</a> number of frames
before having to share the device with the other cameras.
When another camera wants to watch another input or frequency or size the first
<a href="#roundrobin_skip">roundrobin_skip</a> number of frames are skipped to allow the
device to settle. The last option
<a href="#roundrobin_switchfilter">roundrobin_switchfilter</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.
<p></p>
<h3><a name="roundrobin_skip"></a> roundrobin_skip </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 2147483647</li>
<li> Default: 1</li>
</ul>
<p></p>
Specifies the number of frames to skip after a switch. (1 if you are feeling lucky, 2 if you want to be safe).
The Round Robin feature is automatically activated where multiple cameras are sharing the same video device.
Each camera can then set different input channels or frequencies to change camera.
When another camera 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>
<h3><a name="roundrobin_switchfilter"></a> roundrobin_switchfilter </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></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.
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 video_device.
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Network_Cameras"></a>Network Cameras</h3>
<ul>
<p></p>
Motion can connect to certain network cameras. Please refer to the <a href="#Basic_Setup">Basic Setup</a> section
of this guide for an additional discussion of network camera and how to test and specify them correctly for Motion.
<p></p>
Motion cannot connect to a video stream such a mpeg, mpeg4, divx to connect to streams such as these
the user may review the static files portion of the <a href="#Basic_Setup">Basic Setup</a>
section of this guide which illustrates some possible work arounds using ffmpeg and v4l2loopback devices.
<p></p>
The URL must return one single jpeg image, a mjpeg stream
a RTSP stream, RTMP stream, file or ftp. When getting a still image, make sure to validate that
the camera is serving up a actual raw JPG file and not a HTML page with an embedded JPG which Motion
will not be able to process.
When the <a href="#netcam_url" >netcam_url</a> is defined the
<a href="#OptTopic_Video4Linux_Devices" >video4linux</a> options above are mostly ignored.
<p></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.</em>
<h3><a name="netcam_url"></a> netcam_url </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
URL for a network camera.
<p></p>
The list below illustrates some of the more common protocols for network cameras but
Motion does not restrict the protocols to this list. Other protocols that are
available via the ffmpeg libraries can also be specified.
<p></p>
<ul>
<i>http://</i>
<ul>
This prefix uses the traditional http format and opens a netcam that provides a motion jpg image.
<p></p>
When using the rtsp format, Motion will ignore the netcam_keepalive and netcam_tolerant_check options.
</ul>
<p></p>
<i>rtsp://</i>
<ul>
This prefix is the standard for all modern network cameras. It is recommended that users search the
web or the camera manual for the exact connection string to use for their camera.
<p></p>
Once a potential connection string is found, it should be validated as being functional using a
external application such as ffplay or vlc.
<p></p>
The connection string that works for these applications is what needs to be specified for this option.
<p></p>
When using the rtsp format, Motion will ignore the netcam_keepalive and netcam_tolerant_check options.
</ul>
<p></p>
<i>rtmp://</i>
<ul>
This prefix may be available on modern network cameras. It is recommended that users search the
web or the camera manual for the exact connection string to use for their camera.
<p></p>
Once a potential connection string is found, it should be validated as being functional using a
external application such as ffplay or vlc.
<p></p>
The connection string that works for these applications is what needs to be specified for this option.
<p></p>
When using the rtmp format, Motion will ignore the netcam_keepalive and netcam_tolerant_check options.
</ul>
<p></p>
<i>file://</i>
<ul>
This option allows for the processing of a existing movie file. Motion will open the file and
process the file at the framerate specified in the Motion configuration file. Note that since the
file may have been created using a different framerate than specified in the Motion config file,
the file may be processed at either a faster or slower rate than real time.
<p></p>
A sample format for the netcam_url would be <code>netcam_url file:///home/user/cam1/cam1_20180817084027.mkv</code>
<p></p>
This option is useful for "reprocessing" a movie created by Motion to fine tune the detection options.
<p></p>
At the end of the movie file, Motion will restart the movie file at the beginning so that you can
continue to refine the detection parameters.
</ul>
<p></p>
<i>v4l2://</i>
<ul>
This option allows for an alternative method of using a v4l2 device that is not natively supported by Motion.
<p></p>
A sample format for the netcam_url would be <code>v4l2:///dev/video0</code> Internally, this
is equivalent to running the following from the command line <code>ffplay -f v4l2 /dev/video0</code>
<p></p>
</ul>
<p></p>
<i>mjpeg://</i>
<ul>
This is an alternative prefix for http for use when Motion is compiled without ffmpeg.
<p></p>
</ul>
<p></p>
<i>mjpg://</i>
<ul>
This option may process very old netcams with non standard mjpeg formats.
</ul>
<p></p>
<i>jpeg://</i>
<ul>
This option is for processing a static JPG file that is updated by processes external
to Motion. It must be a local file and specified such as jpeg:///path/current.jpg
</ul>
<p></p>
<i>ftp://</i>
<ul>
This prefix opens the ftp site and grabs a static image. The camera will be expected to periodically
replace that static image as it processes images.
</ul>
<p></p>
</ul>
<h3><a name="netcam_params"></a> netcam_params </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: varies by camera type</li>
</ul>
<p></p>
This option allows for specification of parameters to the network camera. The format for specifying
parameters and values is the same as what is given in the examples for video_params. The parameters are
delimited by commas and provided in the format of parameter_name = parameter_value.
<p></p>
For cameras that use the url prefix of mjpeg, ftp, mjpg, and jpeg the options permitted are limited
to keepalive, proxy and tolerant_check. These parameters correspond to the options provided in previous
versions of Motion.
<p></p>
For cameras that use other url prefixes, the parameters permitted are those available from the
ffmpeg library plus a some that are specific to Motion as specified below.
The options of keepalive, proxy, tolerant_check are not applicable to these cameras.
<p></p>
The following summarizes some of the options. Full descriptions of all the ffmpeg options
will be contained in the documentation for ffmpeg.
<p></p>
<h4>keepalive </h4>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: off</li>
</ul>
<p></p>
The keepalive option is specified in the <a href="#netcam_params" >netcam_params</a> option.
<p></p>
The setting for keep-alive of network socket, should improve performance on compatible net cameras.
<ul>
<li> off: The historical implementation using HTTP/1.0, closing the socket after each http request.</li>
<li> force: Use HTTP/1.0 requests with keep alive header to reuse the same connection.</li>
<li> on: Use HTTP/1.1 requests that support keep alive as default.</li>
</ul>
<p></p>
<h4>proxy </h4>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The proxy option is specified in the <a href="#netcam_params" >netcam_params</a> option.
<p></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>
Use this if you need to connect to a network camera through a proxy server.
Example of syntax: "http://myproxy.mydomain.com:1024
If the proxy port number is 80 you can omit the port number. Then the syntax is use "http://myproxy.mydomain.com" .
Leave this option undefined if you do not use a proxy server.
<p></p>
<h4>tolerant_check </h4>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
The tolerant_check option is specified in the <a href="#netcam_params" >netcam_params</a> option.
<p></p>
Use less strict jpeg checks for network cameras
<p></p>
<h4>decoder</h4>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The decoder option is specified in the <a href="#netcam_params" >netcam_params</a> option.
<p></p>
This option is specific to the Motion software and allows for specifying a user requested decoder for the camera.
Motion will try to open the camera using the decoder specified by this parameter. If it not successful, it
will fall back to the default decoder. This option may improve performance in certain situations for
certain platforms and cameras.
<p></p>
Users can find the names of the decoders in ffmpeg on their system by going to a command prompt and
typing <code>ffmpeg -decoders</code> and looking for the name of the decoder with a 'D' next
to it and correlating this with the type of image provided from the camera. Note that although the
decoder may be listed, it still may not work within Motion.
<p></p>
In addition to the decoders specified by ffmpeg, additional different decoder options may also
be found by reviewing the Motion log. These decoders will be shown as "available" in the log
when <a href="#log_level">log_level</a> is specified at the INF level or higher.
<p></p>
Not all decoders will work even if they are indicated as available or work using ffmpeg externally
to Motion. If the camera does not open using the requested decoder, try a different
decoder or leave this parameter empty to use the default.
<p></p>
<h4>capture_rate </h4>
<ul>
<li> Type: int</li>
<li> Range / Valid values: Integer</li>
<li> Default: <a href="#framerate">framerate</a></li>
</ul>
<p></p>
The capture_rate option is specified in the <a href="#netcam_params" >netcam_params</a> option.
<p></p>
This option allows for the user to request a specific frame per second (FPS) capture rate for
the network camera. This is needed at times so that the rate Motion is capturing images is in
sync with what the camera is sending.
<p></p>
When this value is used, it makes a slight distinction from
the usual interpretation of <a href="#framerate">framerate</a>. The capture_rate will specify
how fast images are <u>captured and decoded</u> and the <a href="#framerate">framerate</a>
will specify the rate at which they are <u>processed for motion</u>.
<p></p>
For example, if the capture_rate were set to be 10 and the
<a href="#framerate">framerate</a> was set to be 20, what would happen is that each captured image
would end up going through the Motion detection / processing routines twice because that loop is
processing at twice the speed of the capture loop. Conversely, if the capture_rate was set
to 20 and the <a href="#framerate">framerate</a> is specified as 10, then Motion will be detecting
and processing every other image captured.
<p></p>
The reason that the capture_rate is not systematically set to the <a href="#framerate">framerate</a>
within Motion has to with the camera. Each camera will provide a stream of images usually in some
compression format such as H264 or H265 and provide those images at a particular FPS. If the
capture and decoding FPS of Motion is set to a rate lower than the camera, decoding and disconnection
errors will occur.
<p></p>
To avoid the decoding and disconnection errors, it is recommended that the FPS of the camera be
adjusted where possible. Generally, it is preferable to have the FPS of the camera be slightly
lower than the capture_rate of Motion. This allows for the decoder to perform better and reduce
decoding errors. For example if the capture_rate is set at 5 and the camera is sending images at
30 FPS, the resulting images, processing latency, etc is going to be extremely "poor". But if
the camera FPS is set at 4 instead, the results will "better".
<p></p>
Reviews of the Motion log at the INF level can assist in determining whether a higher capture_rate is
required. In particular, look for the following:
<ul>
<li> Log messages indicating what the netcam capture rate is versus the log entry
for the camera FPS.</li>
<li> The network camera is disconnecting and reconnecting frequently.</li>
<li> A significant number of ffmpeg_avcodec_log messages</li>
</ul>
<p></p>
<h4>rtsp_transport</h4>
<ul>
<li> Range / Valid values: tcp, udp, see ffmpeg documentation</li>
<li> Default: tcp</li>
</ul>
<p></p>
The rtsp_transport option is specified in the <a href="#netcam_params" >netcam_params</a> option. This option
is from the ffmpeg libraries.
<p></p>
The rtsp_transport value of tcp is highly preferred because
without this option the rtsp/rtmp images are frequently corrupted and result in many false positive values and
images that appear to be smeared.
<p></p>
For some cameras, a tcp transport is not provided from the camera. Some Motion users have reported
using <code>netsed</code> can workaround this limitation of the camera using the following method:
<p></p>
<small><code>
Instead of: netcam_url rtsp://192.168.0.51:554/onvif1
<br>
Use: netcam_url rtsp://127.0.0.1:554/onvif1
<br>
Then in a different process, start netsed to substitude AVP; with AVP/TCP;
<br>
netsed tcp 554 192.168.0.51 554 's/AVP;/AVP%2FTCP;'
<br>
</code></small>
<p></p>
<h4>input_format</h4>
<ul>
<li> Range / Valid values: mjpeg, h264, see ffmpeg documentation</li>
<li> Default: tcp</li>
</ul>
<p></p>
The input_format option is specified in the <a href="#netcam_params" >netcam_params</a> option. This option
is from the ffmpeg libraries. This option is used for specifying the palette format of the camera when
using the v4l2 via netcam option.
<p></p>
<h3><a name="netcam_high_url"></a> netcam_high_url </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The network camera high resolution URL used in conjunction with the netcam_url parameter.
Users may specify the normal resolution in the netcam_url and that will be used for
the motion detection and then specify the high resolution url for this parameter.
<br>
Motion detection on the normal resolution will trigger the saving of images from the high resolution stream.
Note that the ONLY overlay that will be present on the resulting high resolution pictures and movies is the
privacy mask. The other overlays such as date/time, motion boxes, camera name, etc will not be
included. Users wishing to see those overlays on the resulting images and movies will need to specify the
high resolution url as the netcam_url and not use this option.
<p></p>
If the netcam_url is not specified, this option is ignored.
<p></p>
When this option is used with the <a href="#movie_passthrough">movie_passthrough</a> even less processing occurs.
Since the <a href="#movie_passthrough">movie_passthrough</a> bypasses decoding the stream, images will be saved
as provided from the camera and the privacy mask will not be applied.
<p></p>
<h3><a name="netcam_high_params"></a> netcam_high_params </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: varies by camera type</li>
</ul>
<p></p>
This option is the same as <a href="#netcam_params" >netcam_params</a> option except this option applies
the parameters to the high resolution camera.
<p></p>
<h3><a name="netcam_userpass"></a> netcam_userpass </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The username and password for the network camera. The string is specified as username:password.
If the camera does not have any authentication to the stream, leave this option empty.
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Image_Processing"></a> Image Processing</h3>
<ul>
<p></p>
<h3><a name="width"></a> width </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: Device Dependent</li>
<li> Default: 640</li>
</ul>
<p></p>
The width in pixels of each frame. Valid range is camera dependent.
<p></p>
For all devices, the width must be a multiple of 8.
<p></p>
Motion does not scale v4l2 devices and http netcams so the value should be set to the actual
size of the image provided by the device.
In case of a rtsp/rtmp network camera, Motion will rescale the camera image to the
requested dimensions. This rescaling comes at a very high CPU cost so it
is recommended that the network camera send the image in the same dimensions as included
in the configuration file.
<p></p>
While Motion will not rescale the image provided, it will attempt to set the size of the image
coming from the video4linux device to match the values provided for height/width.
<p></p>
It is important to realize that certain height/width combinations are only valid at
certain frame rates. The particular combinations which are valid are dependent upon
the device.
<p></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></p>
<h3><a name="height"></a> height </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: Device Dependent</li>
<li> Default: 480</li>
</ul>
<p></p>
The height in pixels of each frame. Valid range is camera dependent.
<p></p>
For all devices, the height must be a multiple of 8.
<p></p>
Motion does not scale v4l2 devices and http netcams so the value should be set to the actual
size of the image provided by the device.
In case of a rtsp/rtmp network camera, Motion will rescale the camera image to the
requested dimensions. This rescaling comes at a very high CPU cost so it
is recommended that the network camera send the image in the same dimensions as included
in the configuration file.
<p></p>
While Motion will not rescale the image provided, it will attempt to set the size of the image
coming from the video4linux device to match the values provided for height/width.
<p></p>
It is important to realize that certain height/width combinations are only valid at
certain frame rates. The particular combinations which are valid are dependent upon
the device.
<p></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></p>
<h3><a name="framerate"></a> framerate </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 2 - 100</li>
<li> Default: 15 </li>
</ul>
<p></p>
Maximum number of frames to be captured from the camera per second.
The faster you fetch pictures from the camera the more CPU load you
get and the more pictures get included when Motion is detected.
Motion will stop storing pictures if the framerate is set to less than 2.
Set this parameter to the maximum number of images per second that you want
to store either as images or movies.
To set intervals longer than one second use the 'minimum_frame_time' option instead.
<p></p>
<h3><a name="minimum_frame_time"></a> minimum_frame_time </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></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.
This option is used when you want to capture images at a rate lower than 2 per second.
When this is enabled the framerate option is used only to set the pace the Motion service the
webcam port etc.
<p></p>
<h3><a name="rotate"></a> rotate </h3>
<p></p>
<ul>
<li> Type: Discrete Integers</li>
<li> Range / Valid values: 0, 90, 180, 270</li>
<li> Default: 0 (not rotated)</li>
</ul>
<p></p>
Rotate image the given number of degrees. The rotation affects all saved images as well as movies.
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).
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>
<h3><a name="flip_axis"></a> flip_axis </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: none, v, h</li>
<li> Default: none (no change)</li>
</ul>
<p></p>
Flip the image according to specified axis. The flip affects all saved images as well as movies.
The flip feature is used when the camera is pointed towards a mirror or provides itself a mirrored image (as found in some cars).
Note that the CPU load increases when using this feature with a value other than none.
<p></p>
<h3><a name="locate_motion_mode"></a> locate_motion_mode </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: on, off, preview</li>
<li> Default: off</li>
</ul>
<p></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 movie.
<p></p>
<h3><a name="locate_motion_style"></a> locate_motion_style </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: box, redbox, cross, redcross</li>
<li> Default: box</li>
</ul>
<p></p>
Set the look and style of the locate box if enabled.
<p></p>
<h3><a name="text_left"></a> text_left </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
User defined text overlaid on each in the lower left corner.
Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > \ , . : - + _ \n and conversion specifiers
<p></p>
If the option is not defined no text is displayed at this position.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> to define this field and also include
a new line specifier as \n and spaces if this option is enclosed in quotes.
<p></p>
<p></p>
By combining spaces and new lines '\n' you can place
your text anywhere on the picture. 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></p>
This is how the overlaid text is located.
<p></p>
<table border="1" width=100%>
<tr>
<td width="45"></td>
<td width="45" align="right">CHANGES<br> <br> <br> <br> </td>
</tr>
<tr>
<td width="25%"><br> <br> <br> <br> TEXT_LEFT</td>
<td width="25%" align="right"><br> <br> TEXT_RIGHT<br/>YYYY-MM-DD<br/>HH:MM:SS </td>
</tr>
</table>
<p></p>
<p></p>
<h3><a name="text_right"></a> text_right </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: %Y-%m-%d\\n%T</li>
</ul>
<p></p>
User defined text overlaid on each in the lower right corner.
Use A-Z, a-z, 0-9, " / ( ) @ ~ # < > \ , . : - + _ \n and conversion specifiers
<p></p>
If the option is not defined no text is displayed at this position.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> to define this field and also include
a new line specifier as \n and spaces if this option is enclosed in quotes.
<p></p>
<p></p>
By combining spaces and new lines '\n' you can place
your text anywhere on the picture. 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></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></p>
This is how the overlaid text is located.
<p></p>
<table border="1" width=100%>
<tr>
<td width="45"></td>
<td width="45" align="right">CHANGES<br> <br> <br> <br> </td>
</tr>
<tr>
<td width="25%"><br> <br> <br> <br> TEXT_LEFT</td>
<td width="25%" align="right"><br> <br> TEXT_RIGHT<br/>YYYY-MM-DD<br/>HH:MM:SS </td>
</tr>
</table>
<p></p>
<p></p>
<h3><a name="text_changes"></a> text_changes </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Turns the text showing changed pixels on/off.
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 testing.
This is how the overlaid text is located.
<p></p>
<table border="1" width=100%>
<tr>
<td width="45"></td>
<td width="45" align="right">CHANGES<br> <br> <br> <br> </td>
</tr>
<tr>
<td width="25%"><br> <br> <br> <br> TEXT_LEFT</td>
<td width="25%" align="right"><br> <br> TEXT_RIGHT<br/>YYYY-MM-DD<br/>HH:MM:SS </td>
</tr>
</table>
<p></p>
<h3><a name="text_scale"></a> text_scale </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 10</li>
<li> Default: 1</li>
</ul>
<p></p>
The scale at which to draw text over the image.
The recommended range is 1 - 10.
This option makes the text defined by text_left, text_right and text_changes drawn at n-times the normal size.
This may be useful when using large picture formats such as 1280 x 720.
<p></p>
<h3><a name="text_event"></a> text_event </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: %Y%m%d%H%M%S</li>
</ul>
<p></p>
This option is special in that it defines the conversion specifier %C which can be used both for text
display and for filenames. This option defines the value of the special 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. The idea is that %C can be used filenames and text_left/right for
creating a unique identifier for each event. 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.
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> to define this field (except for
this option itself)
<p></p>
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Motion_Detection"></a>Motion Detection</h3>
<ul>
<p></p>
<h3><a name="emulate_motion"></a> emulate_motion </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on off</li>
<li> Default: off</li>
</ul>
<p></p>
Always save images even if there was no motion
<p></p>
<h3><a name="pause"></a>pause </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on off</li>
<li> Default: off</li>
</ul>
<p></p>
When Motion is started, pause the motion detection.
<p></p>
<h3><a name="threshold"></a> threshold </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 2147483647</li>
<li> Default: 1500</li>
</ul>
<p></p>
Threshold for declaring motion. The threshold is the number of changed
pixels counted after noise filtering, masking, despeckle, and labelling.
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.
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. (Unless of course
you are one of the many many users who use Motion to bird watch!)
Practical values would be from a few hundred to thousands.
<p></p>
<h3><a name="threshold_maximum"></a> threshold_maximum</h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0, 1 to unlimited</li>
<li> Default: 0 (off)</li>
</ul>
<p></p>
This parameter specifies the maximum number of pixels that will trigger motion. When the number of
changed pixels is above the maximum, it will not trigger an event. The result is that Motion will
only trigger events when the number of pixels changes is above the threshold and less than
the threshold_maximum. A value of zero disables threshold_maximum.
<p></p>
<h3><a name="threshold_tune"></a> threshold_tune </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Activate the automatic tuning of threshold level.
This feature makes Motion continuously adjust the threshold for declaring motion.
The threshold 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 threshold instead.
<p></p>
<h3><a name="noise_level"></a> noise_level </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 255</li>
<li> Default: 32</li>
</ul>
<p></p>
The noise level is used as a threshold for distinguishing between noise and motion.
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>
<h3><a name="noise_tune"></a> noise_tune </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
Activates the automatic tuning of noise level.
This feature makes Motion continuously adjust the noise
threshold for distinguishing between noise and motion.
<p></p>
When activating this feature, the noise_level setting is used as a value added to the dynamic noise level rather
than the absolute value.
<p></p>
<h3><a name="despeckle_filter"></a> despeckle_filter </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Combinations of E,e,D,d and l</li>
<li> Default: Not defined </li>
</ul>
<p></p>
Despeckle motion image using combinations of (E/e)rode or (D/d)ilate. And ending with optional (l)abeling.
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.
<p></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></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'.
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.
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'.
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.
<p></p>
<h3><a name="area_detect"></a> area_detect </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Detect motion in predefined areas (1 - 9) and when Motion is detected in the area, execute the script. All of
motion detection still continue. This option is only to execute the on_area_detect script.
<p></p>
Areas are numbered like
<ul>
<li>1 2 3</li>
<li>4 5 6</li>
<li>7 8 9</li>
</li>
</ul>
<p></p>
<h3><a name="mask_file"></a> mask_file </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and filename for the masking pgm file.
If needed, the mask will be resized to match the width and height of the frames being
captured.
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 area that you want ignored must be black. The pgm image should be the same size (number of pixels high
and wide) as the pictures that are taken by the camera so you can define the correct area to mask.
You can adjust sensitivity by using gray tones.
If you do not have a mask file disable this option by not having it in the config file or comment
it out.
If you are using the <a href="#rotate">rotate</a>
or <a href="#flip_axis">flip_axis</a> options, note that the mask is
applied <em>after</em> the rotation.
<p></p>
<strong>Detailed Description</strong>
<p></p>
The mask file must be a pgm format image file (portable gray map). Note that you must choose the BINARY 8-bit format.
<p></p>
To use this feature create an image of exact the same size as the ones you get from your camera.
Then make it purely white for the areas you want detected and
black for the areas you want ignored. 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></p>
One method for generating the mask file is as follows.
<p></p>
Take a motion captured picture, edit it with black and white for the mask and export it as a pgm file.
with a program such as gimp.
If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with
<p></p>
<code>djpeg -grayscale -pnm [inputfile] > mask.pgm</code>
<p></p>
(assuming you have djpeg installed - part of the jpeg lib package).
<p></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. Instead
use the mask_privacy option.
<p></p>
Below are an example of a webcam picture and a mask file to prevent the detection cars in the street.
<p></p>
Normal picture. Notice the street is visible through the hedge.
<p></p>
<img alt="normal.jpg" src="normal.jpg" />
<p></p>
Mask file (converted to png format so it can be shown by your web browser)
<p></p>
<table style="border-width:1px;" cellspacing="0" cellpadding="0" border="1">
<tr >
<td bgcolor="#ffffff" valign="top" style="vertical-align:top;" >
<img alt="mask1.png" src="mask1.png" />
</td>
</tr>
</table>
<p></p>
<p></p>
<h3><a name="mask_privacy"></a> mask_privacy </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and filename for the privacy masking pgm file. This file works like
the <a href="#mask_file">mask_file</a> as
described above. The difference with this parameter is that while the mask_file excludes the section from
detecting motion, this file excludes the section of the image completely.
<p></p>
mask_privacy is applied before detection so no motion will ever be detected in the excluded area.
This parameter could however still be used with the mask_file. e.g. This file could exclude the
neighbors yard and the <a href="#mask_file">mask_file</a> would exclude the blowing tree from motion
detection. The resulting
pictures/movies would show solid black in place of the neighbors yard but the tree would still be in
the pictures/movies.
<p></p>
<h3><a name="smart_mask_speed"></a> smart_mask_speed </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 10</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Speed for the smart mask. Default is 0 = DISABLED. 1 is slow, 10 is fast.
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></p>
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 <a href="#framerate">framerate</a>. The
attack and decay time
is constant over all available framerates.
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="#setup_mode">setup_mode</a>.
That way you can
easily adjust smart_mask_speed.
<p></p>
The <a href="#mask_file">mask_file</a> option provides a static mask to turn off sensitivity in certain areas.
This is very useful to mask a street with cars passing by all day long etc...
<p></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 <a href="#despeckle">despeckle</a> 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></p>
The answer to this problem is the smart mask feature A dynamic, self-learing mask.
<p></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>
<h3><a name="lightswitch_percent"></a> lightswitch_percent </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 100</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Ignore sudden massive light intensity changes when the percentage of the picture area that changed intensity is greater than this value.
The value defines the picture area in percent above which the lightswitch condition will trigger. When lightswitch is
detected motion detection is disabled for a configured number of frames. This is to avoid false detection when
light conditions change and when a camera changes sensitivity at low light.
<p></p>
<h3><a name="lightswitch_frames"></a> lightswitch_frames </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 1000</li>
<li> Default: 5</li>
</ul>
<p></p>
The number of frames to ignore when the lightswitch condition is triggered (see above).
<p></p>
<h3><a name="minimum_motion_frames"></a> minimum_motion_frames </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 1000s</li>
<li> Default: 1</li>
</ul>
<p></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.
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.
The feature is used when you get many false detections when the camera changes light sensitivity or light changes.
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>
<h3><a name="event_gap"></a> event_gap </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 60</li>
</ul>
<p></p>
The number of seconds of no motion detected that triggers the end of an event. An event
is defined as a series of motion images taken within a short timeframe. An event ends
right after no more motion is detected and post_capture is over.
<p></p>
The value -1 is allowed and disables events causing all Motion to be written
to one single movie file and no pre_capture. If set to 0, motion is
running in gapless mode. Disabling events has bad side effects on
noise_tune and smartmask. Both features can only work properly outside an event.
When event_gap is set to -1, both features don't work properly anymore.
<p></p>
For example, a person walking through a room starts an event. During the event many single
images will be detected as movement. Once the movement has stopped being detected, the
<a href="#post_capture">post_capture</a> starts. Then once that is finished, the timer starts
as specified in event_gap.
<p></p>
If any motion is detected before the timer finishes, the existing event continues and the
timer is reset. If no motion is detected during the time, the event ends.
<p></p>
The event_gap value impacts many functions in Motion.
<ul>
<li> When the 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 <a href="#pre_capture">pre_capture</a> feature only works at the beginning of an event.
So if you have a very large 'event_gap' value <a href="#pre_capture">pre_capture</a> is
not working very often.</li>
<li> When you make movies a new file is started at the beginning of an event
when the first motion is detected. When 'event_gap' seconds has passed without
motion (and post_captured frames
saved) the movie files are completed and closed.</li>
<li> Do not use large event_gap values to generate one large movie file.
If Motion stops working this movie file never gets properly completed and closed
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></p>
<h3><a name="pre_capture"></a> pre_capture </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 100s</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Specifies the number of pre-captured (buffered) pictures from before motion
was detected that will be output at motion detection.
The recommended range is 0 to 5. It is not recommended to use large values.
Large values will cause Motion to skip video frames and cause unsmooth movies.
<p></p>
This is because Motion is processing all the buffered images including saving jpegs,
encoding the movie, writing to databases and executing external programs immediately
after the first image is detected as Motion.
<p></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 probably miss many frames of Motion.
<p></p>
To create smooth movies use larger values of <a href="#post_capture">post_capture</a> instead.
<p></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 movie. 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></p>
If pre_capture is set to 0 the feature is disabled. 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.
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.
<p></p>
It is therefore recommended to use relatively small values for pre_capture.
Depending on your chosen framerate and depending on the features enabled values from 1-5 are sensible.
<p></p>
To get a smooth movie use a large value for <a href="#post_capture">post_capture</a> which does not cost any performance hit or RAM
space.
<p></p>
<p></p>
<h3><a name="post_capture"></a> post_capture </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Specifies the number of frames to be captured after motion has been detected.
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)..
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.
If you only store movies and do not have output_normal on, then the recommended post_capture value is what is
equivalent to 1-5 seconds (Don't forget to multiply the seconds desired by the framerate for this parameter)
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Scripts"></a> Script Execution </h3>
<ul>
<p></p>
Motion can execute external commands based on the motion detection and related events.
They are described in the sections below.
<p></p>
<strong>Security Warning!</strong>
<p></p>
These features mean 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></p>
<p></p>
<p></p>
<h3><a name="on_event_start"></a> on_event_start </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed at the start of an event.
An event starts at first motion detected after a
period of no motion defined by gap.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
<h3><a name="on_event_end"></a> on_event_end </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed when a event ends.
An event ends after the event_gap has expired.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
<h3><a name="on_picture_save"></a> on_picture_save </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed when a picture is saved.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
Use %f for passing filename (with full path) to the command.
<p></p>
<p></p>
<h3><a name="on_motion_detected"></a> on_motion_detected </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed when motion is detected.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
<h3><a name="on_area_detected"></a> on_area_detected </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed when motion is
detected in the predefined area indicated in the area_detect option.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
<h3><a name="on_movie_start"></a> on_movie_start </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the program/script to be executed when a
new movie is being created.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
Use %f for passing filename (with full path) to the command.
<p></p>
<p></p>
<h3><a name="on_movie_end"></a> on_movie_end </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
<p></p>
The full path and file name of the program/script to be executed after a new
movie was created.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
Use %f for passing filename (with full path) to the command.
<p></p>
<p></p>
<h3><a name="on_camera_lost"></a> on_camera_lost </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the command to be executed when a camera can't be opened or if it is lost.
<br />Note that there are situations when motion doesn't detect a lost camera. It is
dependent upon the camera and driver and it is advised that this option be tested
for each configuration. It has also been observed that there are also
situations in which the disconnection of the camera even hangs the PC in which
case this script will not be executed.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
<h3><a name="on_camera_found"></a> on_camera_found </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the command to be executed when a lost camera is found
<br />If motion fails to detect a lost camera, it will also fail to know it found one.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
and spaces as part of the command. 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></p>
<p></p>
</ul>
<h3><a name="OptDetail_Pictures"></a>Output - Picture Options </h3>
<ul>
<p></p>
Motion can output different types of pictures. The normal picture is indicated below.
<p></p>
<img alt="outputnormal1.jpg" src="outputnormal1.jpg" />
<p></p>
The motion type picture or also referred to as a debug picture is shown
below. Note that the largest area is blue and only this is counted as Motion.
<p></p>
The Motion image shows how Motion maintains a "reference frame" which is not just the last picture frame
but a mathematical calculation of the past images. This enlarges real Motion and ensures that it is not easy to
sneak in slowly.
<p></p>
<img alt="outputmotion1.jpg" src="outputmotion1.jpg" />
<p></p>
<p></p>
<h3><a name="picture_output"></a> picture_output </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: on, off, first, best</li>
<li> Default: off</li>
</ul>
<p></p>
This option controls the output of the normal image.
<p></p>
'on' is the usual selection.
<p></p>
'first' is Motion saves only the first motion detected picture per event.
<p></p>
"best" requires a little more CPU power and resources compared to "first".
If you set it to "best" Motion saves the picture with most changed pixels during the event.
This may be useful if you store movies on a server and want to present a jpeg to show the content of the movie
on a webpage.
<p></p>
'off' to don't write pictures
<p></p>
When the <a href="#netcam_highres">netcam_highres</a> option is selected along with the
<a href="#movie_passthrough">movie_passthrough</a> the output pictures will be provided in normal resolution
not high resolution.
<p></p>
<h3><a name="picture_output_motion"></a> picture_output_motion </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></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.
<p></p>
If a Smartmask is specified, it is shown in red.
<p></p>
This option is good for tuning and testing but probably not very interesting for the general public.
<p></p>
Default is not to store these 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="picture_type"></a> picture_type </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: jpeg, webp, ppm, grey</li>
<li> Default: jpeg</li>
</ul>
<p></p>
This option specifies the type of picture file to output. The recommendation is to always use jpeg except
if you have a specific need to store high quality pictures without any quality loss.
<p></p>
<p></p>
<h3><a name="picture_quality"></a> picture_quality </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 100</li>
<li> Default: 75</li>
</ul>
<p></p>
The quality for the jpeg or webp images in percent.
100 means hardly compressed. A small number means a much smaller file size but also a poorer
quality image to look at.
<p></p>
<p></p>
<h3><a name="picture_exif"></a> picture_exif </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Use this option to specify the text to include in a JPEG EXIF comment
The EXIF timestamp is included independent of this text.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this option.
<p></p>
<p></p>
<h3><a name="picture_filename"></a> picture_filename </h3>
<p></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>
</ul>
<p></p>
This option indicates the file name and optionally the path for the pictures relative to target_dir.
<p></p>
The file extension .jpg, webp or .ppm is automatically added.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this option.
<p></p>
<p></p>
<h3><a name="snapshot_interval"></a> snapshot_interval </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
This parameter specifies the number of seconds between each snapshot
<p></p>
<p></p>
<h3><a name="snapshot_filename"></a> snapshot_filename </h3>
<p></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>
</ul>
<p></p>
This option indicates the file name and optionally the path for the snapshots relative to target_dir.
<p></p>
The file extension .jpg, webp or .ppm is automatically added.
<p></p>
A symbolic link called lastsnap.jpg is created in the target_dir and will always
point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this option.
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Movies"></a>Output - Movie Options</h3>
<ul>
<p></p>
<h3><a name="movie_output"></a>movie_output </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
Use ffmpeg libraries to encode movies of the motion. This option
generates a new movie at the beginning of each new event and appends to the
movie for each motion detected within the same event.
The current event ends when the time defined by the 'event_gap' option has passed with no motion detected.
At the next detection of motion a new movie is started.
<p></p>
<p></p>
<h3><a name="movie_output_motion"></a>movie_output_motion</h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Use ffmpeg libraries to encode motion type movies where you only see the pixels that changes.
Works like movie_output but outputs motion pixel type pictures instead.
This feature generates the special motion type movie where you only see the pixels
that changes as a graytone image. If labeling is enabled you see the largest area in blue.
Smartmask is shown in red. The filename given is the same as the normal movies except they
have an 'm' appended after the filename.
<p></p>
<p></p>
<h3><a name="movie_max_time"></a> movie_max_time </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 (infinite) - 2147483647</li>
<li> Default: 120</li>
</ul>
<p></p>
The maximum length of a movie in seconds. Set this to zero for unlimited length.
<p></p>
<p></p>
<h3><a name="movie_bps"></a> movie_bps </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 9999999</li>
<li> Default: 400000</li>
</ul>
<p></p>
Bitrate of movies produced by ffmpeg. Bitrate is bits per second.
A higher value means better quality and larger files if the camera is on a fixed bitrate setting.
Experiment to get the desired quality. The better quality the bigger files.
This option is ignored if movie_quality is not 0 (disabled).
<p></p>
<p></p>
<h3><a name="movie_quality"></a> movie_quality </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 100</li>
<li> Default: 60</li>
</ul>
<p></p>
Enables and defines a variable bitrate for the ffmpeg encoder.
The option of movie_bps is ignored if variable bitrate is enabled.
A value of 0 disables this option while values 1 - 100 varies the quality
of the movie. The value of 1 means worst quality and 100 is the best quality.
<p></p>
Experiment for the value that gives you the desired compromise between size and quality.
<p></p>
<p></p>
<h3><a name="movie_codec"></a> movie_codec </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: mpeg4, msmpeg4, swf, flv, ffv1, mov, mp4, mkv, hevc</li>
<li> Default: mkv</li>
</ul>
<p></p>
Container/Codec to be used for the video.
<p></p>
<ul>
<li>mpeg4 or msmpeg4 - gives you files with extension .avi</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 </li>
<li>mov - QuickTime </li>
<li>mp4 - MPEG-4 Part 14 H264 encoding</li>
<li>mkv - Matroska container with H264 encoding</li>
<li>hevc -MP4 container with H.265 / HEVC (High Efficiency Video Coding)</li>
</ul>
<p></p>
Note that certain containers can handle different codecs than the defaults indicated above. For example, the
mkv container can handle virtually any codec. Motion can optionally take an additional specification with this
parameter. By specifying the container (mkv) and then appending a colon and the ffmpeg codec name Motion
will attempt to use the specified codec for the container. This permits options such as encoding the h265 codec
into a mkv container instead of mp4 by specifying the option as <code>mkv:libx265</code>
<p></p>
<h3><a name="movie_duplicate_frames"></a> movie_duplicate_frames </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
When specified, if the CPU can not keep up with the requested frame rate for the movies,
frames will be duplicated in order to keep up with the frame rate.
<p></p>
Users should never use this option since the resulting movies will have the same frame
sent multiple times and therefore the movie will appear to "stall" and look terrible.
<p></p>
<p></p>
<h3><a name="movie_passthrough"></a> movie_passthrough </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
When using a RTSP, RTMP, HTTP and some V4l2 cameras, create movie files of the motion with the packets
obtained directly from the camera.
<p></p>
For v4l2 cameras to use the movie_passthrough, they must be specified using the
<a href="#netcam_url">netcam_url</a> parameter and the <code>v4l2</code> prefix.
<u>Only</u> webcams that provide mjpeg or H264 will work with the
<a href="#movie_passthrough">movie_passthrough</a>.
<p></p>
<p></p>
When using only the single <a href="#netcam_url">netcam_url</a> this option will reduce the processing
required when encoding the images to the resulting movie file. Decoding of the image will still occur on the
image in order to process the motion detection.
<p></p>
When using both the <a href="#netcam_url">netcam_url</a> and the <a href="#netcam_highres">netcam_highres</a>
what will occur is that normal resolution stream will be captured and decoded, when motion is detected, the
high resolution images will be captured and processed into the movie file without going through the decode/encode
processing.
<p></p>
This option should reduce CPU usage but does increase memory requirements.
<p></p>
No image processing is performed so text overlays, privacy masks etc will not be on the resulting video. The
resulting movie may also include a few extra frames at the start that would not exist if the movie was created
without the passthrough option.
<p></p>
Since this option bypasses the decoding of the high resolution images to reduce CPU, when images are saved via
the <a href="#picture_output">picture_output</a> option, the pictures provided will be from the normal resolution stream.
<p></p>
<h3><a name="movie_filename"></a> movie_filename </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: %v-%Y%m%d%H%M%S</li>
</ul>
<p></p>
File path for motion triggered movies relative to target_dir. Note that the file
extension is automatically added to the name based upon the codec selected.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this option.
<p></p>
<p></p>
<h3><a name="movie_extpipe_use"></a> movie_extpipe_use </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
This option specifies whether to send the output to a
pipe for external encoding into a movie.
<p></p>
Piping raw video to stdout has some advantages comparing to using built-in ffmpeg encoder.
<br />First, you can use any encoder that supports RAW frames from stdin so you are not limited to the formats
that are currently implemented in motion. See examples in <a href="#movie_extpipe">movie_extpipe</a>
<br />Second, external encoders utilize separate cpu core(s) on multi-core systems so movie encoding
is offloaded from main motion thread to separate core(s) giving noticeable performance boost
<p></p>
Note that this option does not require the install or configure of the videoloopback software.
<p></p>
<p></p>
<h3><a name="movie_extpipe"></a> movie_extpipe </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This option specifies the program name and options for the
program that will receive and process the images during a movie event.
<p></p>
Note that this option does not require the install or configure of the videoloopback software.
<p></p>
Sample:
<p></p>
<code>
movie_extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of avi -o %f.avi - -fps %{fps}
</code>
<p></p>
<code>
movie_extpipe x264 - --input-res %wx%h --fps %{fps} --bitrate 2000 --preset ultrafast --quiet -o %f.mp4
</code>
<p></p>
<code>
movie_extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%{fps} -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %{fps}
</code>
<p></p>
<code>
movie_extpipe ffmpeg -y -f rawvideo -pix_fmt yuv420p -video_size %wx%h -framerate %{fps} -i pipe:0 -vcodec libx264 -preset ultrafast -f mp4 %f.mp4
</code>
<p></p>
<p></p>
<h3><a name="timelapse_interval"></a> timelapse_interval </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Create a timelapse video saving a picture frame at the interval in seconds set by this parameter.
<p></p>
<p></p>
<h3><a name="timelapse_mode"></a> timelapse_mode </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: hourly, daily, weekly-sunday, weekly-monday, monthly, manual</li>
<li> Default: daily</li>
</ul>
<p></p>
The file rollover mode of the timelapse video.
Note that it is important that you use the <a href="#conversion_specifiers">Conversion Specifiers</a>
in timelapse_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.
<br />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
<a href="#timelapse_interval">timelapse_interval</a> to 0 and then back to your chosen value.
<p></p>
The 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="timelapse_fps"></a> timelapse_fps </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 100's</li>
<li> Default: 30</li>
</ul>
<p></p>
The frame per second rate to use in the playback of the timelapse video.
<p></p>
<p></p>
<h3><a name="timelapse_codec"></a> timelapse_codec </h3>
<p></p>
<ul>
<li> Type: Discrete Strings</li>
<li> Range / Valid values: mpg, mpeg4</li>
<li> Default: mpg</li>
</ul>
<p></p>
Container/Codec to be used by timelapse video.
<p></p>
<ul>
<li>mpg - Creates mpg file with mpeg-2 encoding. If Motion is shutdown and restarted, new pics will be appended
to any previously created file with name indicated for timelapse.</li>
<li>mpeg4 - Creates avi file with the default encoding. If Motion is shutdown and restarted, new pics will
create a new file with the name indicated for timelapse.</li>
</ul>
<p></p>
Note that different containers are NOT planned for this option since the nature of recording a timelapse
is not what typical movies containers and codecs are designed to do. Users desiring a different container/codec
can use ffmpeg directly to either re-encode a finished timelapse video or output the timelapse as jpg picture
files and use ffmpeg to encode those jpgs into a movie.
<p></p>
<h3><a name="timelapse_filename"></a> timelapse_filename </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: %Y%m%d-timelapse</li>
</ul>
<p></p>
File path for the timelapse videos relative to target_dir. Note that the file
extension is automatically added to the name based upon the codec selected.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this option.
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Pipe"></a>Output - Pipe Options</h3>
<ul>
<p></p>
Motion provides two pipe variations. The first option is a v4l2loopback device with normal images.
Using this pipe option, the video that is captured from the v4l2 device is piped into a new
v4l2 device using the v4l2loopback software. This piping is desired when the user wishes to
use the video device at the same time as Motion is using the same device. By default, only
one application can have a device open at one time. Unlike a physical device, the videoloopback
devices take both input and output. The module simply takes anything that comes on its input
and send it out at the output.
<p></p>
When you install the video loopback device it will create a new device for example /dev/video1 while
the actual webcam device would be /dev/video0. You can then tell motion to open the physical
device (/dev/video0) and "pipe" the video signal to the /dev/video1. You will then be able to open
the /dev/video1 device with external videoplayers such as VLC and and look at the pictures live.
VLC is "fooled" to think it is looking at a real camera.
<p></p>
<strong>Installing</strong>
<p></p>
The video loopback device can be added installed via apt in many distributions. The package tested
with Motion is v4l2loopback-dkms. Once the package is installed, you just need to run
<code>sudo modprobe v4l2loopback</code>. This will add a new video device that you
can use for the loopback. It is believed that there are additional options associated with the
v4l2loopback that allows for adding more than one device. See the documentation of the v4l2loopback
project for additional details.
<p></p>
To activate the vloopback device in Motion set the 'video_pipe' option in the motion.conf file to the
device name associated with the one created by v4l2loopback.
<br />You can also view the special motion pictures where you see the changed pixels by setting the option
'video_pipe_motion' in motion.conf. When setting the video_pipe and/or video_pipe_motion options
specify the input device as e.g. /dev/video1.
<p></p>
De-activating should be done with this command
<p></p>
<code>sudo modprobe -r v4l2loopback</code>
<p></p>
The second option for pipe is the same as the above except motion images are sent to the loopback device.
<p></p>
<h3><a name="video_pipe"></a> video_pipe </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The video4linux video loopback device for normal images. The device would be specified
in the format like /dev/video1
<p></p>
<p></p>
<h3><a name="video_pipe_motion"></a> video_pipe_motion </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The video4linux video loopback device for motion images. The device would be specified
in the format like /dev/video1
<p></p>
<p></p>
</ul>
<h3><a name="OptDetail_Webcontrol"></a>Web Control</a> </h3>
<ul>
<p></p>
Motion has a limited web interface to control some parameters while running. By default, the
changing of any parameters via the web interface is disabled
via the <a href="#webcontrol_parms">webcontrol_parms</a> configuration option. This is for
security purposes. If the <a href="#webcontrol_parms">webcontrol_parms</a> is enabled, some Motion
configuration options can be changed while Motion is running. Other configuration options must be
saved and Motion restarted to become effective.
<p></p>
If your <a href="#webcontrol_port">webcontrol_port</a> is 8080, then open the following from the same
machine on which Motion is running
<a href="http://localhost:8080/" rel="nofollow" target="_top">http://localhost:8080/</a>
<p></p>
To access the web control from remote machine, first set the
<a href="#webcontrol_localhost">webcontrol_localhost</a> to <code>off</code> then
connect using the IP of the remote machine instead of <code>localhost</code> (example
<a href="http://192.168.1.4:8080/" rel="nofollow" target="_top">http://192.168.1.4:8080/</a>).
<p></p>
If you want to use a script or cron to automatically change Motion settings while Motion runs, use a
program that can fetch or send a webpage. Common programs are <code> wget </code>, <code>lwp-request</code>
and <code>curl</code>.
<p></p>
Example to pause motion detection
<p></p>
<code>
lwp-request http://localhost:8080/0/detection/pause
</code>
<p></p>
Example to start motion detection
<p></p>
<code>
lwp-request http://localhost:8080/0/detection/start
</code>
<p></p>
Example script to update the text_left with cpu load (verbose for clarity)
<p></p>
<code>
#!/bin/bash<br>
<br>
LOAD=`top -b -n2 | grep "Cpu(s)" | awk '{print $2+$4}' | tail -n1`<br>
<br>
TEXTLEFT=""<br>
TEXTLEFT=$TEXTLEFT"System at %{host}"<br>
TEXTLEFT=$TEXTLEFT"\nCPU $LOAD "<br>
TEXTLEFT=$TEXTLEFT"\nfps: %{fps}"<br>
TEXTLEFT=$TEXTLEFT"\nDate: %Y-%m-%d"<br>
TEXTLEFT=$TEXTLEFT"\n%T-%q"<br>
<br>
# Replace special chars with needed urlcodes<br>
TEXTLEFT="${TEXTLEFT//%/%25}" #Replace % with %25<br>
TEXTLEFT="${TEXTLEFT// /%20}" #Replace spaces with %20<br>
TEXTLEFT="${TEXTLEFT//\{/%7B}" #Replace { with %7B<br>
TEXTLEFT="${TEXTLEFT//\}/%7D}" #Replace } with %7D<br>
<br>
curl http://localhost:8080/1/config/set?text_left=$TEXTLEFT<br>
<br>
return 0<br>
</code>
Note that the replacement of characters with the urlcode values is required whenever updating via
a script or outside the html/css <a href="#webcontrol_interface">webcontrol_interface</a>
<p></p>
To control from your own software (for example your own PHP front end) the motion.conf
option <a href="#webcontrol_interface">webcontrol_interface</a> can be set to <code>1</code>(text) which
will cause Motion to remove the html tags in the responses and there is no navigation of any pages via
a web browser.
<p></p>
The following definitions will be used when summarizing the commands that are available for control
of Motion.
<ul>
<li><code>{IP}</code> The IP address of the computer running Motion</li>
<li><code>{port}</code> The port specified for the webcontrol</li>
<li><code>{camid}</code> The <a href="#camera_id">camera_id</a> of the camera.</li>
<li><code>{parm}</code> The Motion configuration parameter requested.</li>
<li><code>{value1}</code> The first value of the Motion configuration parameter requested.</li>
<li><code>{value2}</code> The second value of the Motion configuration parameter requested.</li>
</ul>
<p></p>
The following are the commands available.
<p></p>
<ul>
<li><code>{IP}:{port}/{camid}/config/list</code> Lists all the configuration values for the camera. </li>
<li><code>{IP}:{port}/{camid}/config/set?{parm}={value1}</code>Set the value for the requested parameter </li>
<li><code>{IP}:{port}/{camid}/config/get?query={parm}</code> Return the value currently set for the parameter.</li>
<li><code>{IP}:{port}/{camid}/config/write</code> Write the current parameters to the file.</li>
<li><code>{IP}:{port}/{camid}/detection/status</code> Return the current status of the camera.</li>
<li><code>{IP}:{port}/{camid}/detection/connection</code> Return the connection status of the camera.</li>
<li><code>{IP}:{port}/{camid}/detection/start</code> Start or resume motion detection. </li>
<li><code>{IP}:{port}/{camid}/detection/pause</code> Pause the motion detection.</li>
<li><code>{IP}:{port}/{camid}/action/eventstart</code> Trigger a new event.</li>
<li><code>{IP}:{port}/{camid}/action/eventend</code> Trigger the end of a event.</li>
<li><code>{IP}:{port}/{camid}/action/snapshot</code> Create a snapshot</li>
<li><code>{IP}:{port}/{camid}/action/restart</code> Shutdown and restart Motion</li>
<li><code>{IP}:{port}/{camid}/action/quit</code> Close all connections to the camera</li>
<li><code>{IP}:{port}/{camid}/action/end</code> Entirely shutdown the Motion application</li>
<li><code>{IP}:{port}/{camid}/track/center</code> Send command to center PTZ camera</li>
<li><code>{IP}:{port}/{camid}/track/set?x={value1}&y={value2}</code> Send command to PTZ camera to move
to location specified by x and y</li>
<li><code>{IP}:{port}/{camid}/track/set?pan={value1}&tilt={value2}</code> Send command to PTZ camera to
pan to value1 and tilt to value2</li>
</ul>
<p></p>
As a general rule, when the {camid} references the camera_id in the main motion.conf file, the webcontrol
actions referenced above are going to be applied to every camera that is connected to Motion. This camera_id
is usually specified as 0 (zero). So issuing a command of <code>{IP}:{port}/0/detection/pause</code> is
going to pause all the cameras.
<p></p>
A point of clarification with respect to the differences between <code>pause</code>, <code>quit</code>,
and <code>end</code>. When the action of <code>pause</code> is executed, Motion will stop the motion detection
processing and of course all events but will continue to process and decode images from the camera. This allows
for a faster transition when the user executes a <code>start</code> The <code>quit</code> action conversely not
only stops the motion detection but also disconnects from the camera and decoding of images. To start motion
detection after a <code>quit</code>, the user must execute a <code>restart</code> which will reinitialize the
connection to the camera. And since the camera was completely disconnect, it can take more than a few seconds
for Motion to fully start and have the camera available for processing or viewing. Finally, there is an
option for <code>end</code>. This option completely terminates the Motion application. It closes all connections
to all the cameras and terminates the application. This may be required when running Motion in daemon mode.
Note that there is no way to restart the Motion application from the webcontrol interface after processing
a <code>end</code> request.
<p></p>
If the item above is available via the HTML/CSS interface, it is also possible to see the exact URL sent
to Motion in the log. Change the log level to 8 (debug), then open up the Motion webcontrol interface and
perform the action in question. In the log Motion will report the exact URL sent to Motion that performed
the action.
<p></p>
<strong>ALERT!</strong> Security Warning! 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 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. Also make sure to adjust the
<a href="#webcontrol_parms">webcontrol_parms</a> to the lowest level possible.</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> Run Motion as a harmless user. DO NOT RUN AS ROOT!!</li>
</ul>
<p></p>
<p></p>
<h3><a name="webcontrol_port"></a> webcontrol_port </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 65535</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
Sets the port number for the http based control of the Motion parameters.
This option must be placed in the motion.conf file and not in a camera config file.
Port numbers below 1024 normally require that you have root privileges.
The port 8080 is the typical selection of the port for this purpose.
<p></p>
<h3><a name="webcontrol_ipv6"></a> webcontrol_ipv6 </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Listen for connections from IPv6 and IPV4.
<p></p>
<h3><a name="webcontrol_localhost"></a> webcontrol_localhost </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
This option restricts the control of the Motion parameters to the localhost.
This option must be placed in motion.conf and not in a camera config file.
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>
<h3><a name="webcontrol_parms"></a> webcontrol_parms </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 3</li>
<li> Default: 0 </li>
</ul>
<p></p>
Sets the type of parameters that will be listed on the webcontrol page and available for
modification.
<ul>
<li> 0: None - No configuration parameters will be available.</li>
<li> 1: Limited- A limited list of parameters will be available. </li>
<li> 2: Advanced - The advanced list of parameters will be available. These typically require Motion to be restarted to become effective.</li>
<li> 3: Restricted - User IDs, passwords and "on_" commands.</li>
</ul>
The default for this parameter is 0 (none) to enhance the security of the web interface. The setting of the
webcontrol_parms is NEVER included on the web interface and this parameter must be specified via the configuration file.
<b>EXTREME</b> Care should be exercised when using level restricted level because if the webcontrol is compromised,
it may compromise the computer.
<p></p>
Users are strongly advised to only set this option to something other than zero when initially setting up the
cameras. Once Motion has been configured, it is advised to complete the set up by setting this value back to zero!
<p></p>
<h3><a name="webcontrol_interface"></a> webcontrol_interface </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2</li>
<li> Default: 0</li>
</ul>
<p></p>
The type of webcontrol interface to provide.
<ul>
<li>The value of 0 provides a traditional web page interface using html/css.</li>
<li>The value of 1 provides a text only interface suitable for programmatic access.</li>
<li>The value of 2 provides the legacy web control interface</li>
</ul>
<p></p>
This option must be placed in motion.conf and not in a camera config file. The
recommended value for most is "0" which provides a page you can navigate and control
Motion with a normal browser.
<p></p>
<h3><a name="webcontrol_auth_method"></a> webcontrol_auth_method </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values:0, 1, 2 </li>
<li> Default: 0</li>
</ul>
<p></p>
Authentication method to use for the webcontrol port
<ul>
<li>0 = disabled </li>
<li>1 = Basic authentication </li>
<li>2 = Digest authentication </li>
</ul>
<p></p>
<p></p>
<h3><a name="webcontrol_authentication"></a> webcontrol_authentication </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This parameter establishes the username and password to use for the stream.
The syntax is username:password
<p></p>
<p></p>
<h3><a name="webcontrol_tls"></a> webcontrol_tls </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
This option specifies whether to enable SSL/TLS for the webcontrol port. For some distributions
the library that Motion uses may not have been compiled with SSL/TLS support. In this situation
Motion can not support SSL/TLS connections. Whether SSL/TLS can be supported will be reported in
the log. In addition to selecting this option, a <a href="#webcontrol_cert">webcontrol_cert</a> and
<a href="#webcontrol_key">webcontrol_key</a> file must also be specified.
<p></p>
<p></p>
<h3><a name="webcontrol_cert"></a> webcontrol_cert </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Full path to the certification file for SSL/TLS support. Only used when
<a href="#webcontrol_tls">webcontrol_tls</a> is enabled.
<p></p>
<p></p>
<h3><a name="webcontrol_key"></a> webcontrol_key </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Full path to the key file for SSL/TLS support. Only used when
<a href="#webcontrol_tls">webcontrol_tls</a> is enabled.
<p></p>
<p></p>
<h3><a name="webcontrol_header_params"></a> webcontrol_header_params </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
User specified header(s) for the webcontrol. The header/value pair is separated by an equal sign and multiple header/value
pairs are separated by commas. If the header or value includes an equal sign or comma, then the header or value must be
enclosed in double quotes. e.g.
<p></p>
<code>webcontrol_header_params Access-Control-Allow-Origin=*, Cache-Control="no-cache"</code>
<p></p>
When Motion parses this parameter, it only shows the values in the Motion log
when <a href="#webcontrol_localhost">webcontrol_localhost</a> is set to on. When
the <a href="#webcontrol_localhost">webcontrol_localhost</a> is set to off, Motion
will redact the values in the log.
<p></p>
<p></p>
<h3><a name="webcontrol_lock_attempts"></a> webcontrol_lock_attempts</h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Integers</li>
<li> Default: 5</li>
</ul>
<p></p>
This parameter applies to the webcontrol port and all stream ports.
<p></p>
The maximum number of failed authentication attempts to the web control or streams before the client IP is locked out
for the duration specified by webcontrol_lock_minutes.
<p></p>
<p></p>
<h3><a name="webcontrol_lock_minutes"></a> webcontrol_lock_minutes</h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Integers</li>
<li> Default: 5</li>
</ul>
<p></p>
This parameter applies to the webcontrol port and all stream ports.
<p></p>
The number of minutes that a IP is locked out when the number of failed authentication attempts has been reached. Note that
when the user attempts to connect the during the lock out period, the timer is reset to zero. So if the user set the time
at 5 minutes and attempted to log in after 4 minutes, they would have to wait a total of 9 minutes before Motion would
start to prompt for a password again. The attempt to open the web site at minute 4 resets the clock even though Motion
does not even respond with a prompt.
<p></p>
<p></p>
<h3><a name="webcontrol_lock_max_ips"></a> webcontrol_lock_max_ips</h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Integers</li>
<li> Default: 25</li>
</ul>
<p></p>
This parameter applies to the webcontrol port and all stream ports.
<p></p>
Motion can only keep track of a limited amount of IPs that are attempting to log in but failing. This parameter specifies
the maximum number of IPs that can be blocked at the same time. Motion will clear the log of IPs that have been locked out
but the webcontrol_lock_minutes has expired so this parameter represents the maximum concurrent IPs locked out. Note that
when this maximum is reached, Motion will deny all connections until one of the time of one of the lockouts expires.
<p></p>
While it is permitted to have a high value for this, it should be noted that it could impact the loading time for the webcontrol
and streams. Motion loops through the entire array looking for the connecting IP to determine whether to block it on each and
every connection.
<p></p>
</ul>
<h3><a name="OptDetail_Stream"></a> Live Stream</a> </h3>
<ul>
Motion has simple webcam server built in which allows for streaming the images from the
camera(s).
<p></p>
The streams are generated in "multipart jpeg" format (mjpeg) which most browsers can display. If
the browser does not directly open the stream, it may be possible to manually create a simple HTML
page that references the stream.
<p></p>
By default many browsers limit the number of simultaneous connections (usually to something like 5).
Since Motion uses connections for each camera, it is possible that only the first 5 cameras are displayed
on the all cameras home page. To get around this, some browsers allow the user to specify a
different(higher) number of simultaneous streams. For some browsers, this is specified via the
network.http.max-persistent-connections-per-server option. For other browsers, users are not permitted
to customize the settings. For these browswers, users will need to specify a different port for
each camera stream. The connection limit is based upon the server:port combination therefore specifying
a different port for each camera avoids the limitation.
<p></p>
Some regular stream players such as mplayer, ffplay and avplay may open the streams as well by specifying
the network stream as
<code>
http://localhost:mystreamportnumber/
</code>
<p></p>
While normally the stream players will open after a bit, it may be useful to also provide the format such as
<code>
ffplay -f mjpeg http://localhost:mystreamportnumber/
</code>
<p></p>
It has been observed by the author that VLC will not open the stream. This is not a Motion limitation but
instead is related to the general VLC support for MJPG http streams.
<p></p>
While the above examples indicate the Motion streams can be accessed as
<code>
http://localhost:mystreamportnumber/
</code>
Motion does provide other options for accessing the streams and images. In addition to sub-streams,
motion image streams and static images, Motion can also be configured to use just a single port for
accessing streams to all cameras. This is accomplished by specifying a stream port within the
motion.conf file and also using separate camera files. The following examples should clarify the
methods by which streams can be accessed:
<ul>
<li><code>{IP}</code> The IP address of the computer running Motion</li>
<li><code>{port0}</code> The port specified for the stream within the motion.conf file.</li>
<li><code>{portX}</code> The port specified for the stream within a camera.conf file.</li>
<li><code>{camid}</code> The <a href="#camera_id">camera_id</a> of the camera.</li>
</ul>
<p></p>
<ul>
<li><code>{IP}:{port0}/cameras.json</code> JSON object with IDs and names of all cameras</li>
<li><code>{IP}:{port0}/status.json</code> JSON object with information about all cameras</li>
<li><code>{IP}:{port0}/{camid}/</code> Primary stream for the camera</li>
<li><code>{IP}:{port0}/{camid}/stream</code> Primary stream for the camera</li>
<li><code>{IP}:{port0}/{camid}/substream</code> Sub-stream for the camera</li>
<li><code>{IP}:{port0}/{camid}/motion</code> Motion image stream for the camera</li>
<li><code>{IP}:{port0}/{camid}/source</code> Source image from the camera</li>
<li><code>{IP}:{port0}/{camid}/current</code> Static JPG for the camera</li>
<li><code>{IP}:{port0}/{camid}/status.json</code> JSON object with information about the camera</li>
<li><code>{IP}:{portX}/</code> Primary stream for the camera running on port {portX}</li>
<li><code>{IP}:{portX}/stream</code> Primary stream for the camera running on port {portX}</li>
<li><code>{IP}:{portX}/substream</code> Sub-stream for the camera running on port {portX}</li>
<li><code>{IP}:{portX}/motion</code> Motion image stream for the camera running on port {portX}</li>
<li><code>{IP}:{portX}/source</code> Source image from the camera running on port {portX}</li>
<li><code>{IP}:{portX}/current</code> Static JPG for the camera running on port {portX}</li>
<li><code>{IP}:{portX}/status.json</code> JSON object with information about the camera running on port {portX}</li>
</ul>
<h3><a name="stream_port"></a> stream_port </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 65535</li>
<li> Default: 0 (disabled)</li>
</ul>
<p></p>
The TCP port that Motion will send the main stream.
The stream port must be different than the
<a href="#webcontrol_port">webcontrol_port</a>. If the port is specified
within the motion.conf file (as opposed to being specified in the camerax.conf files), then
Motion will provide all streams on that single port by specifying a different url. See the
<a href="#OptDetail_Stream">stream</a> section above for further details and
examples of how ports can be specified. If setting a unique port for each camera
good value may be to select is 8081 for camera 1, 8082 for camera 2, 8083 for camera 3 etc.
<p></p>
<h3><a name="stream_localhost"></a> stream_localhost </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: on</li>
</ul>
<p></p>
Limits the access to the stream to the localhost.
By setting this to on, the stream can only be accessed on the same machine on which Motion is running.
<p></p>
<h3><a name="stream_auth_method"></a> stream_auth_method </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0, 1, 2</li>
<li> Default: 0</li>
</ul>
<p></p>
This parameter establishes desired authentication method for the stream port. The parameters have the following meaning.
<ul>
<li>0 = disabled </li>
<li>1 = Basic authentication </li>
<li>2 = MD5 digest (the safer authentication) </li>
</ul>
<p></p>
Note that if you are enabling the webcontrol feature of Motion, you really really really ... should
enable security authentications. No. Seriously. You really should. See the security warnings in this
document regarding how it completely opens up your system.
<p></p>
<h3><a name="stream_authentication"></a> stream_authentication </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This parameter establishes the username and password to use for the stream.
The syntax is username:password
<p></p>
<h3><a name="stream_tls"></a> stream_tls </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
This option specifies whether to enable SSL/TLS for the stream port. For some distributions
the library that Motion uses may not have been compiled with SSL/TLS support. In this situation
Motion can not support SSL/TLS connections. Whether SSL/TLS can be supported will be reported in
the log. In addition to selecting this option, a <a href="#webcontrol_cert">webcontrol_cert</a> and
<a href="#webcontrol_key">webcontrol_key</a> file must also be specified.
<p></p>
<p></p>
<h3><a name="stream_header_params"></a> stream_header_params</h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
User specified header(s) for the stream. The header/value pair is separated by an equal sign and multiple header/value
pairs are separated by commas. If the header or value includes an equal sign or comma, then the header or value must be
enclosed in double quotes. e.g.
<p></p>
<code>stream_header_params Access-Control-Allow-Origin=*, Cache-Control="no-cache"</code>
<p></p>
When Motion parses this parameter, it only shows the values in the Motion log
when <a href="#stream_localhost">stream_localhost</a> is set to on. When
the <a href="#stream_localhost">stream_localhost</a> is set to off, Motion
will redact the values in the log.
<p></p>
<h3><a name="stream_preview_scale"></a> stream_preview_scale </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 to 100s</li>
<li> Default: 25</li>
</ul>
<p></p>
If the webcontrol page has HTML enabled, Motion displays all of the streams on the home webcontrol page in HTML
format so that all the images can be viewed by standard browsers.
<p></p>
This parameter indicates the percentage to scale the stream image when it is placed on the page.
Note that this is scaled on the browser side, Motion will keep sending full frame.
<p></p>
Numbers greater than 100 are permitted.
<p></p>
<p></p>
<h3><a name="stream_preview_newline"></a> stream_preview_newline </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
If the webcontrol page has HTML enabled, Motion displays all images of the streams on the home webcontrol page
in HTML format so that all the images can be viewed by standard browsers.
<p></p>
This parameter determines whether the image is placed on a new line in the webcontrol web page.
<p></p>
Preview images are placed on to the webcontrol home page in camera id number order.
This parameter allows the user some flexibility in organizing the images on the page.
<p></p>
Setting this parameter to off will set the image to the right of any image from a lower numbered thread number.
Setting it to 'on' will place the image on the start of the next line(below).
<p></p>
Users that require a more polished and customized preview page are encouraged to create their own
local HTML page that reference the URL streams.
<p></p>
<h3><a name="stream_preview_method"></a> stream_preview_method </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 4</li>
<li> Default: 0</li>
</ul>
<p></p>
This option determines the method used for displaying images on the webcontrol page.
<ul>
<li>0 = Full stream images are sent and scaled by the client to the webcontrol page</li>
<li>1 = Substream images are sent by Motion. This saves bandwidth</li>
<li>2 = Static images are sent by Motion and the page must be manually refreshed</li>
<li>3 = Full stream images and motion images side by side to assist setup of detection</li>
<li>4 = The source image provided by camera without privacy or other Motion overlays</li>
</ul>
<p></p>
<p></p>
<h3><a name="stream_quality"></a> stream_quality </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 100</li>
<li> Default: 50</li>
</ul>
<p></p>
Quality setting in percent for the jpeg picture frames transferred over the live stream connection.
When it is set to a low number, it will lower the bandwidth required to stream the images.
<p></p>
<h3><a name="stream_grey"></a> stream_grey </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Send the live stream in grey (black and white) rather than color. Useful for limiting bandwidth.
<p></p>
<h3><a name="stream_maxrate"></a> stream_maxrate </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 1 - 100</li>
<li> Default: 1</li>
</ul>
<p></p>
Limit the framerate of the stream in frames per second. Set the value to 100 for practically unlimited.
Don't set this parameter too high unless you only use it on the localhost or on an internal LAN.
<p></p>
<h3><a name="stream_motion"></a> stream_motion </h3>
<p></p>
<ul>
<li> Type: boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Limit the framerate to 1 frame per second when there is no motion being detected and increase
it to the stream_maxrate when there is motion.
<p></p>
</ul>
<h3><a name="OptDetail_Database"></a>Database</h3>
<ul>
Motion can record many details of its images, movies, and events in a database.
Support for one or more of the Database Management Systems (DBMS) MySQL, MariaDB,
PostgreSQL, and SQLite3 may be incorporated when Motion is built from source.
Many Linux distributions provide packages to selectively incorporate most or all
of Motion's DBMS support.
Configuration option <a href="#database_type">database_type</a> specifies which DBMS,
if any, is used in a given Motion run.
<p></p>
When a Motion installation includes DBMS support, SQL statements to insert or update
database records may be specified using Motion's
<a href="#OptTopic_Database">database configuration options</a>
<a href="#sql_query">sql_query</a>, <a href="#sql_query_start">sql_query_start</a>, and
<a href="#sql_query_stop">sql_query_stop</a>.
These SQL statements may record dynamic image, movie, and event data
in database tables using <a href="#conversion_specifiers">Conversion Specifiers</a>
for data elements like filename, time, number of changed pixels detected etc.
Motion does <em>not</em> record images or movies themselves in a database.
<p></p>
Motion can insert or update database records when it creates image or movie files,
when it recognizes the beginning of a motion event, and when it closes movie files
at the end of a motion event.
<a href="#sql_query">sql_query</a> and <a href="#sql_query_stop">sql_query_stop</a>
are executed only for the image and movie file types enabled by their respective sql_log_*
configuration options.
The sql_log_* options do <em>not</em> impact <a href="#sql_query_start">sql_query_start</a>,
which, if specified, is always executed at event start.
<p></p>
Motion does not provide for deletion of the database records it creates nor for the
images and movies they catalog.
Other user-provided scripts or software may analyze, search, display,
and purge database records and related images and movies.
<p></p>
Example SQL statements defining a database table to record Motion file details:
<p></p>
MySQL; MariaDB : <code>CREATE TABLE security (camera INTEGER NOT NULL,
filename VARCHAR(255) NOT NULL, file_type INTEGER NOT NULL,
time_stamp DATETIME NOT NULL, frame INTEGER, motion_event INTEGER,
movie_end DATETIME);</code>
<p></p>
Postgresql : <code>CREATE TABLE security (camera INTEGER NOT NULL,
filename VARCHAR NOT NULL, file_type INTEGER NOT NULL,
time_stamp TIMESTAMP NOT NULL, frame INTEGER, motion_event INTEGER,
movie_end TIMESTAMP);</code>
<p></p>
<h3><a name="database_type"></a> database_type </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: <code>mysql</code>, <code>mariadb</code>,
<code>postgresql</code>, <code>sqlite3</code></li>
<li> Default: Not defined</li>
</ul>
<p></p>
This option specifies the database type.
<p></p>
<h3><a name="database_dbname"></a> database_dbname </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
Name of a database (SQLite3: full path to the database file) containing preexisting table(s) created
with schema(s) consistent with any SQL statements specified by sql_query* configuration options.
<p></p>
<h3><a name="database_host"></a> database_host </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: localhost</li>
</ul>
<p></p>
The host on which the database is located. Hostname, domain name, or IP address.
Optionally for PostgreSQL, full path of the local directory containing its Unix domain
pipe; e.g., <code>/var/run/postgresql</code>. Ignored for SQLite3.
<p></p>
<h3><a name="database_port"></a> database_port </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 65535</li>
<li> Default: 0</li>
</ul>
<p></p>
The port number that is used for the database. Ignored for SQLite3. Typical values are: mysql=3306 and postgresql=5432
<p></p>
<h3><a name="database_user"></a> database_user </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The user account name for database. Ignored for SQLite3.
<p></p>
<h3><a name="database_password"></a> database_password </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The user password for database. Ignored for SQLite3.
<p></p>
<h3><a name="database_busy_timeout"></a> database_busy_timeout </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 or more, millisec.</li>
<li> Default: 0, immediate timeout</li>
</ul>
<p></p>
SQLite3 only. If a required SQLite3 table is locked when a Motion thread issues a
SQL statement, the maximum time it may block the camera's Motion thread before
that SQL statement is abandoned.
<p></p>
<p></p>
<p></p>
<h3><a name="sql_log_picture"></a> sql_log_picture </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Log to the database when Motion triggers an image file to be saved.
<p></p>
<h3><a name="sql_log_snapshot"></a> sql_log_snapshot </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Log to the database when creating a snapshot image file.
<p></p>
<h3><a name="sql_log_movie"></a> sql_log_movie </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Log to the database when creating a motion triggered movie file.
<p></p>
<h3><a name="sql_log_timelapse"></a> sql_log_timelapse </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Log to the database when creating a timelapse movie file
<p></p>
<h3><a name="sql_query"></a> sql_query </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
SQL statement (typically INSERT) to a database table when a sql_log_* image file is recorded
or movie file recording begins.
<p></p>
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a>
within the query.
<p></p>
<p></p>
Sample Queries (depend upon the table provided):
<p></p>
<code>INSERT INTO security(camera, filename, frame, file_type, time_stamp, text_event)
VALUES(%t, '%f', %q, %n, '%Y-%m-%d %T', '%C')</code><br/>
<code>INSERT IGNORE INTO security(camera, file_name, year, month, day, hour, minute)
VALUES (8, '%f', %Y, %m,%d, %H, %M)</code><br/>
<p></p>
<p></p>
<h3><a name="sql_query_start"></a> sql_query_start </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
SQL statement (typically INSERT) executed when a motion event is recognized.
This can be used, for example, to record event start times and generate unique event IDs.
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this statement.
<p></p>
<p></p>
<h3><a name="sql_query_stop"></a> sql_query_stop </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
SQL statement (typically INSERT or UPDATE) executed when Motion stops recording a motion-triggered
or timelapse movie.
For example, this can update an events table with an event end timestamp, provided that
<a href="#movie_output">movie_output</a> and <a href="#sql_log_movie">sql_log_movie</a> are enabled.
<p></p>
<p></p>
You can use <a href="#conversion_specifiers">Conversion Specifiers</a> in this statement.
File type (conversion specifier <code>%n</code>) allows distinction between motion movie end
and timelapse movie end.
<p></p>
<p></p>
Sample Queries:
<p></p>
<code>UPDATE security SET movie_end='%Y-%m-%d %T' WHERE filename='%f'</code><br/>
<p></p>
</ul>
<h3><a name="OptDetail_Tracking"></a>Tracking</h3>
<ul>
<p></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. Review and revise the Motion code
regarding tracking if these features are required. The Motion developers do not have any tracking cameras
so it is unlikely that tracking features will be developed in any way. (We have no way to test anything!)
<p></p>
<p></p>
<p></p>
<h3><a name="track_type"></a> track_type </h3>
<p></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>
</ul>
<p></p>
Type of tracker.
<p></p>
Motion has special tracking options which use either a serial stepper motor controller,
an iomojo smile cam or a Philips WebCam driver compatible pan/tilt camera such as
the Logitech Quickcam Sphere or Orbit.
<p></p>
To disable tracking, set this to 0 and the other track options are ignored.
<p></p>
Value 1 is for the special Motion Tracking project using a stepper motor and a home made controller.
<p></p>
Value 2 is for the iomojo smilecam
<p></p>
Value 3 is for pwc type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit which is driven
by the pwc (Philips WebCam) driver. To use this camera your version of pwc must be at least 8.12.
<p></p>
Value 4 is the generic track type. This option executes the
<a href="#track_generic_move">track_generic_move</a> script. Users can write their own script
to move the camera based upon the <a href="#conversion_specifiers">Conversion Specifiers</a> passed to the
script and/or based upon the environment variables set by Motion.
<p></p>
Value 5 is for uvcvideo type USB tracking cameras such as the Logitech Quickcam Sphere/Orbit MP which is driven
by the uvcvideo driver.
<p></p>
<p></p>
<h3><a name="track_auto"></a> track_auto </h3>
<p></p>
<ul>
<li> Type: Boolean</li>
<li> Range / Valid values: on, off</li>
<li> Default: off</li>
</ul>
<p></p>
Enable auto tracking of the motion. Requires a tracking camera or custom script as specified in the
<a href="#track_type">track_type</a> above.
<p></p>
<h3><a name="track_port"></a> track_port </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
This is the device name of the serial port to which the stepper motor interface is connected.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_motorx"></a> track_motorx </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
The motor number that is used for controlling the x-axis.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_motorx_reverse"></a> track_motorx_reverse </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Description
<p></p>
<h3><a name="track_motory"></a> track_motory </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
The motor number that is used for controlling the y-axis.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_motory_reverse"></a> track_motory_reverse </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
<p></p>
<h3><a name="track_maxx"></a> track_maxx </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
The maximum position for servo x.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_minx"></a> track_minx </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
<p></p>
<h3><a name="track_maxy"></a> track_maxy </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
The maximum position for servo y.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_miny"></a> track_miny </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
<p></p>
<h3><a name="track_homex"></a> track_homex </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
<p></p>
<h3><a name="track_homey"></a> track_homey </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
<p></p>
<h3><a name="track_iomojo_id"></a> track_iomojo_id </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Use this option if you have an iomojo smilecam connected to the serial port instead
of a general stepper motor controller.
Only used for iomojo camera.
<p></p>
<h3><a name="track_step_angle_x"></a> track_step_angle_x </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Angle in degrees the camera moves per step on the X-axis with auto tracking. Currently only used with pwc type cameras.
Requires a tracking camera type pwc.
<p></p>
<h3><a name="track_step_angle_y"></a> track_step_angle_y </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Angle in degrees the camera moves per step on the Y-axis with auto tracking. Currently only used with pwc type cameras.
Requires a tracking camera type pwc.
<p></p>
<p></p>
<h3><a name="track_move_wait"></a> track_move_wait </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Delay during which tracking is disabled after auto tracking has moved the camera.
Delay is defined as number of picture frames.
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>
<h3><a name="track_speed"></a> track_speed </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Speed to set the motor to.
Only used for stepper motor tracking.
<p></p>
<h3><a name="track_stepsize"></a> track_stepsize </h3>
<p></p>
<ul>
<li> Type: Integer</li>
<li> Range / Valid values: 0 - 2147483647</li>
<li> Default: 0</li>
</ul>
<p></p>
Number of steps to make.
Only used for stepper motor tracking.
<p></p>
<p></p>
<h3><a name="track_generic_move"></a> track_generic_move </h3>
<p></p>
<ul>
<li> Type: String</li>
<li> Range / Valid values: Max 4095 characters</li>
<li> Default: Not defined</li>
</ul>
<p></p>
The full path and file name of the command to execute to move a PTZ camera in generic tracking mode
<p></p>
Users have the option of using the <a href="#conversion_specifiers">Conversion Specifiers</a>
and including the parameters as part of command line options to the script and/or to obtain the
values from system environment variables as indicated below.
<p></p>
The following are the parameters provided as environment variables:
<ul>
<li> When called to recenter the camera: TRACK_ACTION=center TRACK_XOFF TRACK_YOFF</li>
<li> When called to track a motion: TRACK_ACTION=move TRACK_CENT_X TRACK_CENT_Y TRACK_CENT_WIDTH TRACK_CENT_HEIGHT TRACK_CENT_MINX TRACK_CENT_MAXX TRACK_CENT_MINY TRACK_CENT_MAXY TRACK_IMGS_WIDTH TRACK_IMGS_HEIGHT TRACK_IMGS_MOTIONSIZE</li>
</ul>
<p></p>
<p></p>
The following is a sample script that moves a PTZ netcam based upon the system environment
variables. The 3/8 and 5/8 are illustrative only and set based upon testing with a VIVOTEK PZ81X1 camera. The
values and methods applicable to any other camera would need to be established by the user.
<p></p>
<code>
#!/bin/bash<br>
<br>
LOCKFILE=/tmp/track_generic_move_netcam.lock<br>
if [ -e "$LOCKFILE" ]; then # Trick to avoid flooding<br>
exit 0 # the netcam of multiple<br>
fi # moving commands.<br>
<br>
function movecam() {<br>
touch $LOCKFILE<br>
curl "http://youripaddress/cgi-bin/camctrl/camctrl.cgi?move=$1"<br>
LOCKED=true<br>
}<br>
<br>
case "$TRACK_ACTION" in<br>
"center")<br>
movecam home<br>
;;<br>
"move")<br>
if [ "$TRACK_CENT_X" -lt "$((TRACK_IMGS_WIDTH*3/8))" ]; then<br>
movecam left<br>
fi<br>
if [ "$TRACK_CENT_X" -gt "$((TRACK_IMGS_WIDTH*5/8))" ]; then<br>
movecam right<br>
fi<br>
if [ "$TRACK_CENT_Y" -lt "$((TRACK_IMGS_HEIGHT*3/8))" ]; then<br>
movecam up<br>
fi<br>
if [ "$TRACK_CENT_Y" -gt "$((TRACK_IMGS_HEIGHT*5/8))" ]; then<br>
movecam down<br>
fi<br>
;;<br>
esac<br>
<br>
if [ "$LOCKED" = "true" ]; then<br>
sleep 2<br>
rm -f "$LOCKFILE"<br>
fi<br>
</code>
<p></p>
<p></p>
</ul>
</ul>
</section>
</body>
</html>
|