Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/motion-user or, via email, send a message with subject or body 'help' to motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: mpjpeg fails on wansview 1080p (John Baker) 2. Re: How the documentation on the Motion wiki is working (Joseph Heenan) ---------------------------------------------------------------------- Message: 1 Date: Sun, 07 Aug 2016 08:25:06 +0100 From: John Baker <jba...@dryfish.org.uk> Subject: Re: [Motion-user] mpjpeg fails on wansview 1080p To: motion-user@lists.sourceforge.net Message-ID: <1470554706.1113147.688186593.00ef8...@webmail.messagingengine.com> Content-Type: text/plain Totally agree. (1) is easy. (2) Coming from a Python/Java background, I would not expect anyone to be writing HTTP code in 2016 (or 2010). Rip it all out and replace it with a good library; I guess whatever is used by curl or wget. I think one of your objectives should be to remove as much home grown code as possible, whether config file reading or HTTP. On Sun, Aug 7, 2016, at 08:08 AM, tosiara wrote: > So here we have two issues: > 1. motion should better handle 401 or any non-200 http status and show > user > friendly error > 2. digest auth support > > The first would probably be an easy code change > But the second would be a challenge. We can implement digest auth. Or. > There was a discussion already to replace all the manual http code by > some > web library that provides better support and better maintained. But that > requires also quite a lot of efforts to change the code > > On Sun, Aug 7, 2016 at 9:25 AM, John Baker <jba...@dryfish.org.uk> wrote: > > > So being more awake this morning, I now spot the problem. The camera > > wishes to use HTTP digest authentication, which I guess motion doesn't > > support (another on the todo list Mr Dave / Joseph ?:). > > > > http://stackoverflow.com/questions/2384230/what-is-digest-authentication > > > > Example: > > > > > HEAD /mjpeg/stream.cgi?chn=0 HTTP/1.1 > > > Host: 192.168.0.102 > > > User-Agent: curl/7.49.1 > > > Accept: */* > > > > > < HTTP/1.1 401 Unauthorized > > < WWW-Authenticate: Digest realm="IPCamera Login", > > nonce="f35b3a998c0b964d21d99da3f8880f14", qop="auth" > > > > > HEAD /mjpeg/stream.cgi?chn=0 HTTP/1.1 > > > Host: 192.168.0.102 > > > Authorization: Digest username="visitor", realm="IPCamera Login", nonce=" > > f35b3a998c0b964d21d99da3f8880f14", uri="/mjpeg/stream.cgi?chn=0", cnonce=" > > MWY1N2M3NmUzMjNlODIxM2ZjMzAxYTcyNTIzMjA0MTY=", nc=00000001, qop=auth, > > response="3bb6cbc93342432432421104ebeed5c3a" > > > User-Agent: curl/7.49.1 > > > Accept: */* > > > > > < HTTP/1.1 200 OK > > > > > > ------------------------------------------------------------ > > ------------------ > > _______________________________________________ > > Motion-user mailing list > > Motion-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/motion-user > > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > > > ------------------------------------------------------------------------------ > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome ------------------------------ Message: 2 Date: Sun, 7 Aug 2016 09:33:12 +0100 From: Joseph Heenan <jos...@heenan.me.uk> Subject: Re: [Motion-user] How the documentation on the Motion wiki is working To: Motion discussion list <motion-user@lists.sourceforge.net> Message-ID: <b83a531c-03f2-48d1-889f-ea3fd9a09...@heenan.me.uk> Content-Type: text/plain; charset="utf-8" Hi Kenneth, Thanks for the info! I?m happy to setup an external backup - it sounds like the easiest way might be if you could do a nightly tgz and then I can grab that from a http url? Thanks Joseph > On 6 Aug 2016, at 13:30, Kenneth Lavrsen <kenn...@lavrsen.dk> wrote: > > Oh forgot backup > > Foswiki has all its files as plan text files. So it is easy to back-up in > many different ways. > > A simple cron job can tgz the whole Motion guide in seconds either shoot it > off or place it where it can be picked up as a simple html download. And the > space required is none. The text zipped is kilobytes in size. Only the images > take a little space. It is nothing. > And Foswiki itself is open source and can be downloaded and installed on any > Linux box. All plugins used are open source from the Foswiki site. > > I take daily backups myself but they are inhouse. If my house burns... > > Then it smells like pork roast when my body burns and the data is lost > Kenneth > > > On 06 Aug 2016, at 11:31, Joseph Heenan <jos...@heenan.me.uk > <mailto:jos...@heenan.me.uk>> wrote: > >> Hi Kenneth, >> >> Many thanks for the detailed explanation. I have read it and it makes sense >> to me, though I have yet to try it. (I?m no stranger to foswiki?s macros.) I >> guess we may want to document some of this process in a wiki page somewhere. >> >> I have two questions: >> >> 1) Should the wiki reflect the current release version or the latest >> development version? (I hope the latter is the answer, as otherwise it makes >> for a lot of work at release time, and there are a lot of advantages to the >> release process being lightweight.) >> >> 2) Would it be a good idea to setup an offsite backup of the wiki? I?m >> conscious that if it is an ingrained part of our development process, we >> should make sure we can easily reproduce it if the worst happens. (I can >> donate server space for an offsite backup to be stored, but I presume the >> only good way to create a backup is that it is pushed from your server.) >> >> Thanks >> >> Joseph >> >> >>> On 5 Aug 2016, at 22:21, Kenneth Lavrsen <kenn...@lavrsen.dk >>> <mailto:kenn...@lavrsen.dk>> wrote: >>> >>> I forgot to write >>> >>> And now the man page >>> >>> In front of the section that starts with "it is a bit hidden" >>> >>> On 05 Aug 2016, at 23:07, Kenneth Lavrsen <kenn...@lavrsen.dk >>> <mailto:kenn...@lavrsen.dk>> wrote: >>> >>>> Hi all >>>> >>>> Let me introduce what is under the hood of the project documentation of >>>> Motion >>>> >>>> Ignore all the bug report, feature request, patch features. They are awful >>>> and could be implemented much better but there is no point that I try to >>>> do that because Github offers the same out of the box in a familiar and >>>> superiour way. >>>> >>>> But on the documentation side the Foswiki features are pretty cool and not >>>> at all supported by Github or Sourceforge >>>> >>>> You probably all know the Motion guide. >>>> >>>> You go to http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome>. You click in the >>>> Motion Guide and you land >>>> onhttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide> >>>> From there you have several choices. >>>> >>>> The first is the Installation. And if you ever try to edit that page it >>>> has a short text and then followed by >>>> >>>> %TOC% >>>> >>>> %INCLUDE{"MotionOverview"}% >>>> %INCLUDE{"KnownProblems"}% >>>> %INCLUDE{"InstallOverview"}% >>>> %INCLUDE{"PrepareInstall"}% >>>> %INCLUDE{"ConfigureScript"}% >>>> %INCLUDE{"MakeInstall"}% >>>> %INCLUDE{"UpgradingFromOlderVersion"}% >>>> %INCLUDE{"ErrorLogging"}% >>>> >>>> All the %SOMETHING% are macros. %TOC% is a table of content. And >>>> %INCLUDE.... simply includes pages. So all it is is a modular approach so >>>> you do not have to sit and edit an evil long page. So to edit the >>>> documentation you go to the sub page and start typing. >>>> >>>> The markup language is simple. >>>> >>>> ---+ Headline level 1 >>>> >>>> ---++ Headline level 2 >>>> >>>> ---+++ Headline level 3 >>>> >>>> Some *bold* text. >>>> >>>> WikiWords like WoW, HitMeGood etc automatically link to a page with that >>>> name. WikiWord starts with upper case followed by lower case followed by >>>> uppercase and you have a WikiWord. >>>> >>>> WikiWord >>>> >>>> Notawikiword (not capitals in the middle) >>>> >>>> notAwikiWord (does not start with a capital) >>>> >>>> Wiki2Word is a wikiword because number count as lower case. >>>> >>>> ALSoaWikiWord2Go - Also a wiki word. The minute the parser saw ALSoaW it >>>> because a wiki word. >>>> >>>> If the page exists it links to it. If the page does not exist it suggest >>>> that you create it. >>>> >>>> !IDoNotWantThisAsWikiWord is not a wikiword. The ! cancels the >>>> wikiword-ness but the ! is invisible. >>>> >>>> There are two edit modes. Normal Edit is a WYSIWYG editor which is OK. >>>> Edit Wikitext is for us geeks that want to control what we do. If you edit >>>> existing text you quickly see how it works >>>> >>>> Tables use the syntax >>>> >>>> | *Heading text* | *Second Heading* | >>>> | text here | more cell text here | >>>> | hello | here I am | >>>> >>>> Very simple. >>>> >>>> Back to the documentation >>>> >>>> Getting It Running is also a bunch of includes. Some are pretty smart and >>>> intelligent. >>>> >>>> Like the table of options. Noone had written that table. >>>> >>>> The table gets generated in the included page ConfigFileOptions ( >>>> http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions> ) >>>> >>>> It has code that looks like this >>>> >>>> %TABLE{valign="top" headeralign="left" columnwidths="170,240"}% >>>> | *Option* | *Range/Values<br />Default* | *Description* | >>>> %SEARCH{ "Group != 'Obsolete'" topic="ConfigOption*" casesensitive="on" >>>> type="query" nosearch="on" nototal="on" order="formfield(Option)" >>>> excludetopic="ConfigOptionTemplate, ConfigOptionForm" format="| >>>> [[$topic][$formfield(Option)]]| Values: $formfield(Range)<br />Default: >>>> $formfield(Default) | $formfield(Description) |"}% >>>> >>>> What is going on? >>>> >>>> First line is a Macro %TABLE... which defines how the table looks like. >>>> Mostly allignment of text and columnwidths >>>> >>>> Then | *Option* | *Range/Values<br />Default* | *Description* | >>>> >>>> Which is he header of the table. Notice how you can use HTML in the >>>> markup. >>>> >>>> And then the smart feature - the formatted SEARCH. >>>> >>>> The SEARCH looks up all pages that start with ConfigOption. Note the >>>> topic="ConfigOption*" where * is a wild card. >>>> >>>> And it exclude the topics where Group != 'Obsolete' >>>> >>>> What is this? Is it a database? Well almost. I will get back to that. >>>> >>>> There are some more options for the SEARCH that controls how it presents >>>> data. In this case it basically means "shut up with all your noise" and >>>> finally there is the format parameter which defines how the pages (topics) >>>> are presented. >>>> >>>> Each found topic becomes a table row. >>>> >>>> format="| [[$topic][$formfield(Option)]]| Values: $formfield(Range)<br >>>> />Default: $formfield(Default) | $formfield(Description) |"}% >>>> >>>> So the format is a row where >>>> >>>> First column is a link to the page that defines the parameter. >>>> >>>> Second column is a combination of the field values for Range and Default >>>> values. >>>> >>>> Third column is the description >>>> >>>> So each motion.conf option has its own wikipage. The naming convention is >>>> ConfigOptionOptionName where OptionName is a WikiWord version of the >>>> option. Simple. It does not have to be but that is how I defined it and it >>>> makes it easy to find the right page >>>> >>>> Now to the config option pages. >>>> >>>> Let us take an example. The option "height" from motion conf is defined >>>> onhttp://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHeight >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionHeight>. So the >>>> topic (Pages are called topics in Foswiki - horrible I know) is >>>> ConfigOptionHeight. >>>> >>>> When you look at it you see a plain descriptive text >>>> >>>> And below a table which is a Form. The structure of this form is defined >>>> in ConfigOptionForm which looks like >>>> >>>> >>>> >>>> Form Topic for motion.conf options >>>> >>>> Name: >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionForm?sortcol=0;table=1;up=0#sorted_table> >>>> Type: >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionForm?sortcol=1;table=1;up=0#sorted_table> >>>> Size: >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionForm?sortcol=2;table=1;up=0#sorted_table> >>>> Values: >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionForm?sortcol=3;table=1;up=0#sorted_table> >>>> Tooltip message: >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionForm?sortcol=4;table=1;up=0#sorted_table> >>>> Option text 50 Option Name - always lower case and >>>> with underscore between words >>>> Type select 1 Boolean, Integer, String, Discrete Strings >>>> Date type of option >>>> Range text 70 min: x, max: y Range for integers, or list of >>>> allowed strings/values >>>> Default text 50 Default value when option is commented >>>> out >>>> Description textarea 80x4 Short Description >>>> Group select 1 Runtime Options, Capture Device, Round Robin, >>>> Motion Detection Settings, Image File Output, Movie File Output, >>>> Snapshots, Text Display, Target Directories and Filenames, Live Webcam >>>> Server, HTML Based Control, Tracking, External Commands, Common Options >>>> For Database, Database Options For MySQL, Database Options For PostgreSQL, >>>> Video Loopback Device, Debugging for Programmers, Thread, Obsolete >>>> Option group from motion.conf >>>> >>>> So in reality it is like a primitive database where each option is a >>>> record in a database and the database fields are >>>> >>>> Option: The name of the option >>>> Type: One of the values Boolean, Integer, String, Discrete Strings >>>> Range: is a plain text field where you define the range of valid values if >>>> there is a range >>>> Default: is the default value >>>> Group: Is one of the values - Runtime Options, Capture Device, Round >>>> Robin, Motion Detection Settings, Image File Output, Movie File Output, >>>> Snapshots, Text Display, Target Directories and Filenames, Live Webcam >>>> Server, HTML Based Control, Tracking, External Commands, Common Options >>>> For Database, Database Options For MySQL, Database Options For PostgreSQL, >>>> Video Loopback Device, Debugging for Programmers, Thread, Obsolete >>>> >>>> The group is used to be able to autogenerate the documentation and present >>>> the different options grouped together. If you need a new group you edit >>>> the ConfigOptionForm topic and the new value will be in the pick list >>>> >>>> >>>> To create a new ConfigOptionXXXXX topic you create it first and then add >>>> the ConfigOptionForm to the topic and it then gets the nice structured >>>> database like fields to it. Very simple once you get the idea. >>>> >>>> Once you have the the config options defined as one topic for each option >>>> only fantasy limits the ways you can present the data using the SEARCH >>>> macro. >>>> >>>> And this is what I do in the Motion Guide. In >>>> http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions> it >>>> creates the table of all config options. >>>> >>>> Back to the Motion Guide. Now that you know what is going on let us look >>>> athttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideBasicFeatures >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideBasicFeatures>. >>>> Again just a bunch of INCLUDEs. >>>> And inside each included topic I have a plain text introduction. And then >>>> followed by a SEARCH that presents the the options based on a section >>>> criteria based on Group value. I can see I need to simplify the SEARCHes a >>>> little because there is a newer query syntax available now in Foswiki that >>>> works a bit like SQL. I will update all those. >>>> >>>> But the principle is the same all over. The documention is a mix of >>>> plaintext and reuse of the ConfigOptionXXXX topics. >>>> >>>> http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideAlphabeticalOptionReferenceManual >>>> >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideAlphabeticalOptionReferenceManual> >>>> simply lists ALL the config options in one big document. >>>> >>> >>> And now to the man page >>> >>>> It is a bit hidden. It is under >>>> http://www.lavrsen.dk/foswiki/bin/view/Motion/MiscellaneousInformation >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MiscellaneousInformation> >>>> and there you >>>> findhttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage >>>> >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage> >>>> >>>> And what is under the hood of that? >>>> >>>> http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage?raw=on >>>> >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage?raw=on> >>>> >>>> First some plain text Main page intro. Nothing fancy and all within <pre> >>>> and </pre> tags that makes Foswiki show the text as raw code but still >>>> interprets macros. >>>> >>>> %STARTATTACH...% and %ENDATTACH...% enclose the text we want saved in a >>>> man page file. >>>> Each time you edit and save the page a new man page is created and >>>> attached to the topic. Yes you can also attach files to the wikipages. In >>>> this case a plugin does it automatically each time you save. >>>> >>>> Inside the pre tags you find a SEARCH macro. >>>> >>>> %SEARCH{ "Group != 'Obsolete'" type="query" topic="ConfigOption*" >>>> casesensitive="on" nosearch="on" nototal="on" order="formfield(Option)" >>>> excludetopic="ConfigOptionTemplate, ConfigOptionForm, >>>> ConfigOptionFfmpegFilename, ConfigOptionMinimumGap" format=".TP$n().B >>>> $formfield(Option) >>>> $percntCALC{\"$LOWER($formfield(Type))\"}$percnt$n()Values: >>>> $formfield(Range) / Default: >>>> $formfield(Default)$n().br$n()$formfield(Description)"}% >>>> >>>> It again find all the options and present them neatly in a format that >>>> makes sense in a man page. >>>> >>>> In this case it presents all options except the ones that are in marked as >>>> Obsolete in the Group field. So now you know how to hide the options that >>>> are removed in the new versions. Change the group field to Obsolete and it >>>> is hidden from all views but can be presented on a list of obsolete >>>> options. >>>> >>>> The Macros in Foswiki are parsed top to down, left to right, inside out. >>>> >>>> So when you want to put macros inside the format string of the SEARCH you >>>> have to hide the macros (inside out) until the search is run. The $percnt >>>> or $percent is the way you delay the macro expansion inside SEARCH. >>>> >>>> So first the SEARCH finds all the option topics, then creates the table >>>> rows, replaceing all the $percnt with "%" and when the SEARCH is complete >>>> the the now visible macros get parsed. In this case the CALC macro which >>>> is a swiss army knife of small functions. Here is changes text to lower >>>> case. >>>> >>>> I do not expect you guys to understand all this. But you can easily edit >>>> the pages that are already there. >>>> With a little help you can create new config option topics and they then >>>> automatically appear in the Motion guide in the right chapter based on the >>>> Group field. >>>> And if you remove an option you change it to the obsolete group. >>>> >>>> When you want to generate a new man page - just look >>>> uphttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage >>>> >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionOptionsAlphabeticalManpage>. >>>> Edit the page and save it. And then download the updated "motion.1" >>>> attachment. Easy, right? >>>> >>>> You edit one config option file one place. And all the many versions of >>>> the options tables, the reference manual, the detailed manual, the man >>>> pages - everything is up to date. THAT is WHY the Motion guide is on >>>> Foswiki. It takes a little effort to get the head around it but then it is >>>> easy to maintain >>>> >>>> And I will gladly do that. I am using Foswiki at work every day. I just >>>> need you guys to ping me when you need to update something that is not >>>> just a simple edit of an existing page >>>> >>>> >>>> The motion guide which is included when you build Motion (at least from >>>> the old SVN version) simply downloads the HTML >>>> fromhttp://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument >>>> >>>> <http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideOneLargeDocument> >>>> >>>> And it does it in a mode where all the menus and shit is removed and you >>>> just get a plain HTML file. You can see some grumpy users that added a >>>> note that the file is out of date and that people have to read the code to >>>> find out how it works. That is so wrong and not easy if you do not read C >>>> code. >>>> >>>> Long email. But the few of you that are interested should not understand >>>> how it works. I will update the SEARCH syntax used to query search instead >>>> of the old regex searches used which are a bit dodgy to read. >>>> >>>> Kenneth >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Motion-user mailing list >>>> Motion-user@lists.sourceforge.net >>>> <mailto:Motion-user@lists.sourceforge.net> >>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>> <https://lists.sourceforge.net/lists/listinfo/motion-user> >>>> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome >>>> <http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Motion-user mailing list >>> Motion-user@lists.sourceforge.net <mailto:Motion-user@lists.sourceforge.net> >>> https://lists.sourceforge.net/lists/listinfo/motion-user >>> <https://lists.sourceforge.net/lists/listinfo/motion-user> >>> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome >>> <http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net <mailto:Motion-user@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/motion-user >> <https://lists.sourceforge.net/lists/listinfo/motion-user> >> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome >> <http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome> > ------------------------------------------------------------------------------ > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------------------------------------------------------ ------------------------------ _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user End of Motion-user Digest, Vol 123, Issue 16 ********************************************