Motion - Motion Stream Auth Patch

Motion Stream Authentication Patch

Description of Patch

This patch add authentication support to the "Live Stream Server" function.

It contains two authentication methods 'Basic Authentication' and 'Digest Authentication'.
# Set the authentication method (default: 0)
# 0 = disabled 
# 1 = Basic authentication
# 2 = MD5 digest (the safer authentication)
stream_auth_method 0

# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
; stream_authentication username:password

Installation of Patch

Download the patch file. If it is packed as a gz or tar.gz unpack it first. Then copy it to the motion source directory and issue the command (assuming the patch file is called motion_stream_auth.patch)

patch < motion_stream_auth.patch

Then re-build Motion and test the patch.

Change History of Patch

  • 1.0 Initial revision

Discussion and Comments

Thanks Michael, I'll give a try.


-- AngelCarpintero - 15 Nov 2009

Included in trunk r472.

-- AngelCarpintero - 23 Nov 2009

Is it implemented in Version 3.2.12? I``s seems to be but not working.

-- TommyLee - 18 Oct 2011

Included in GIT and SVN trunk.

-- AngelCarpintero - 31 Oct 2011

I have ran apt-get install motion and i still dont have the new feature frown, sad smile

-- AdrianGraham - 10 Apr 2013

Hi, Kinda new here. How do you download the patch and how do you re-build motion?


-- RaspberryPi - 17 Apr 2013

You don't need the path, just download the latest verision: and run "./configure" and then "make" to get the latest version of motion with authentication for streams. Just tried it out on Raspberry Pi and works great. BTW, you will want to add this to track.c: #include <linux/videodev2.h> to get past a compilation problem on Raspberry.

-- XrakEn - 09 May 2013

hi XrakEn, it's taken me ages to get motion set up and working. if i download the latest version above and ./configure and make as you say, will it just neatly update the version i am running leaving me to just re-edit the motion.conf or do i have to remove the current version? thanks d

-- DonAitken - 31 May 2013

XrakEn, DonAitken - Also interested in adding a password for the webcam stream. And I'm also confused on what exactly I need to do with the patch file to get it incorporated into motion.

I'm one of the newbies. Does this sound right?

1) Download the tar.gz file. 2) Move the tar.gz file into /etc/motion/ directory, where the motion.conf file is? 3) "cd" into /etc/motion/ directory. 4) run "./configure" and "make"??? This part doesn't seem to work for me.

By the way, I'm running ArchLinux.

-- EricRead - 10 Jun 2013

I have also the same problem. Already installed motion in arch linux using pacman (did not download tarball and compile) How do I get the patch? Don't want to uninstall and compile from scratch..

-- PanosXatzi - 04 Nov 2013

where is the patch file ?? if i use apt-get install motion, how to patch? cause when i make the source it always eroor!

-- HaikinKin - 21 Feb 2014

It's included in GIT version ,

git clone

cd motion ; autoconf ; ./configure ; make

cp motion-dist,conf motion.conf ( edit what you need )


-- AngelCarpintero - 28 Feb 2014

i still do not understand. please help. I have a raspberry with raspbian and motion installed. All work very well also web streaming. Please if you can explain step by step for a noob. Thanks a lot.

-- RobRob - 15 Sep 2014

why isn't this patch included in the regular version of motion? What is Motion Snapshot? and is there plans to include this patch in the regular version?

-- ReggieNoo - 14 Oct 2014

i want to use Digest Authentication. can i make password file by htdigest command of apache2? where do i should save the password file?

-- KazzSaito - 08 Jan 2015

tried AngelCarpintero way and once ive copied the files from my old config folder to the new one and edited to suite the new version, the web stream didnt work at all. pulled my hair out last night with it frown, sad smile

ended up removing and and going back to the version from apt-get install motion

-- MattTaylor - 21 Jan 2015

Hi, could be used more than just one login to view stream? I was playing with stream_authentication username:password, but didn't succeed.

-- JanGrant - 21 Jan 2015

HI, I have submitted a test patch (against snapshot) for logging Stream Server IP/auth connections, as we can now put stream server directly on a public interface:

-- StevePowers - 16 Aug 2015


i have changed the following configurations to achieve authentication

# Username and password for network camera (only if required). Default: not defined # Syntax is user:password netcam_userpass saif:campuseye

# The setting for keep-alive of network socket, should improve performance on compatible net cameras. # 1.0: The historical implementation using HTTP/1.0, closing the socket after each http request. # keep_alive: Use HTTP/1.0 requests with keep alive header to reuse the same connection. # 1.1: Use HTTP/1.1 requests that support keep alive as default. # Default: 1.0 netcam_http 1.1

server is not prompting for authentication for the stream. however authentication is working for http based control.

-- SaifSheikh - 25 Nov 2015
Topic revision: r23 - 25 Nov 2015, SaifSheikh
Copyright © 1999-2017 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.