Motion - Support Question 2008x 03x 06x 102257

Problems about MotionHttpAPI

Question

I am using Motion for my project. Motion is definitely an excellent program with motion detection. I installed the Motion in the Buffalo Linkstation with Debian OS. Every functions work well except I feel confused about how to implement Http interface for Motion. I have already read all related topics like: WebInterfaceForMotionDiscussion, MotionHttpAPI#Get_config, MotionHttpControl _option_value.

Does I need to apply the patch file by patch -p1 < /usr/local/motion-20050826-051002-httpd.diff ? I have tried one of the RelatedProjects, KED's Motion Tools, but it displays nothing except display error messages when I change the wrong port or the Motion have not started. I hope anyone can give me more detailed guideline about MotionHttpAPI.
Paste in your error messages, config settings, terminal window output etc in this text field.

Environment

Motion version: 3.2.9
ffmpeg version:  
Libraries: ffmpeg, mysql, postgresql
Server OS:  

-- VictorHung - 06 Mar 2008

Answer

A patch from 2005 is for sure not relevant and some of the related projects are not kept up to date by the one that posted them. If you see something is out of date please feel free to hit the edit button and write it. The current http interface was introduced a couple of years ago. Before that we had an xml-rpc interface but it was hard for non-programmers to understand and use.

MotionHttpAPI is up to date. The easiest way to use the http API is to control Motion from a browser and record the URLs you get from the interface and use those in your own program. The general way to use it is to fetch the URL and ignore what is sent back to the "browser".

What programming language are you trying to implement something in? I can give some hints if you have some specific problems.

-- KennethLavrsen - 07 Mar 2008

Follow up

First, thanks your reply so quickly. I'm trying to using php or java to implement a website with http API to control the webcam. Actually, I don't really understand the background concept of how to control the webcam by using the URLs. Are the URLs just the ip and port no. with the commands, not the actual folders or pages? I also confuse webcam_port with control_port. Am I getting the right setting for http control? And I am trying to analyse the webhttpd.c file by Angel Carpintero. Best Wish~
############################################################
# Live Webcam Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
webcam_port 8081
# Quality of the jpeg images produced (default: 50)
webcam_quality 50
# Output frames at 1 fps when no motion is detected and increase to the
# rate given by webcam_maxrate when motion is detected (default: off)
webcam_motion off
# Maximum framerate for webcam streams (default: 1)
webcam_maxrate 10
# Restrict webcam connections to localhost only (default: on)
webcam_localhost off
# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual webcam rate by desired number of seconds
# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate
webcam_limit 0
############################################################
# HTTP Based Control
############################################################
# TCP/IP port for the http server to listen on (default: 0 = disabled)
control_port 8080
# Restrict control connections to localhost only (default: on)
control_localhost off
# Output for http server, select off to choose raw text plain (default: on)
control_html_output off
# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
control_authentication myusername:mypassword

-- VictorHung - 07 Mar 2008

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

All this info it's already in motion guide and Twiki , no reason to keep this open. Please RTFM smile

-- AngelCarpintero - 07 May 2008
Topic revision: r4 - 07 May 2008, AngelCarpintero
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.