Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
2162
views
Motion doesn't detected my webcam : UNABLE TO OPEN VIDEO DEVICE
I would use a USB webcam with Motion software, installed in Ubuntu on my Windows PC (WSL2 ) But when I started Motion as a service and i check on browser at the address [LOCALHOLST:port 8080 or 8081 ] it appears the Motion interface but never has been detected my webcam. Always It is showed a gray s...
I would use a USB webcam with Motion software, installed in Ubuntu on my Windows PC (WSL2 ) But when I started Motion as a service and i check on browser at the address [LOCALHOLST:port 8080 or 8081 ] it appears the Motion interface but never has been detected my webcam. Always It is showed a gray screen, for the MyCam1 option, with written at the top on the left "UNABLE TO OPEN VIDEO DEVICE".
I tried many types of configurations in the camera1-dist.conf and motion.conf files, but unfortunately they still doesn't work
Someone who could suggest me what type of configurations and in wich file, do I have to use to detected a USB webcam with Motion software ?
Thank you in advance.
Hi, many thanks your indications has been very useful!
I have followed all the steps and I have attached the webcam to my Ubuntu distribution and now Ubuntu 'lsusb' comand gives the following output
root@LAPTOP-5OFK2AK7:/home/daniele# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 3443:950a SHENZHEN AONI ELECTRONIC CO.,LTD NexiGo N950P 4K Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Unfortunately it still doesn't work..Motion still showes a grey screen and the UNABLE TO OPEN VIDEO DEVICE..
I think now the problem is in the camera1-dist.conf file.
I'd like to set the webcam in localhost:8080 (port) or ( 8081 ) but i don't understand, it still doesn't work what and where I have to write in this camera1-dist.conf file
# This config file was generated by motion 4.2.2
###########################################################
# Configuration options specific to camera 1
############################################################
# User defined name for the camera.
camera_name MyCam1
# Numeric identifier for the camera.
camera_id 101
# The full URL of the network camera stream.
netcam_url http://127.0.0.1:8080
# Image width in pixels.
width 1280
# Image height in pixels.
height 720
# Text to be overlayed in the lower left corner of images
text_left CAMERA 1
# File name(without extension) for movies relative to target directory
movie_filename CAM01_%t-%v-%Y%m%d%H%M%S
DanielePP
(11 rep)
Apr 15, 2022, 09:37 PM
• Last activity: May 13, 2025, 05:06 AM
-3
votes
1
answers
56
views
Why can only get access video with 127.0.0.1:8081?
My local pc's address is `192.168.31.167`. sudo ifconfig | grep inet inet 192.168.31.167 netmask 255.255.255.0 broadcast 192.168.31.255 Install motion and start it: sudo apt install motion sudo motion I can only get access video with `127.0.0.1:8081` in browser. [![enter image description here][1]][...
My local pc's address is
Why
192.168.31.167
.
sudo ifconfig | grep inet
inet 192.168.31.167 netmask 255.255.255.0 broadcast 192.168.31.255
Install motion and start it:
sudo apt install motion
sudo motion
I can only get access video with 127.0.0.1:8081
in browser.

192.168.31.167:8081
can't play the video?
showkey
(499 rep)
Aug 23, 2023, 12:15 PM
• Last activity: Aug 23, 2023, 12:25 PM
0
votes
1
answers
566
views
V4L2 Webcam has weird colours in Motion stream, normal on VLC
I've set up a webcam stream with Motion to use with Octoprint on my Raspberry Pi 4 (Raspbian 10). With my main webcam (Logitech C270) it works well as expected. I was testing to see if I could use a quite old webcam (Sunplus Flexcam 100 according to `lsusb`) I just found. I've managed to make it wor...
I've set up a webcam stream with Motion to use with Octoprint on my Raspberry Pi 4 (Raspbian 10). With my main webcam (Logitech C270) it works well as expected.
I was testing to see if I could use a quite old webcam (Sunplus Flexcam 100 according to
(my red jumper and a green plastic object as color reference)
However, when I start Motion, the image I see on the stream has the colours distorted (kind of looks like green and red are interchanged):
I've tried changing the
lsusb
) I just found. I've managed to make it work, through VLC I can see the video feed just fine:


palette
and hue
config options, but nothing changes. I've also tried using the v4l2 prefix, as in v4l2:///dev/video0
in the videodevice
config option, but it does not recognize it as valid.
Any ideas as to what might be happening?
Thanks in advance
Nouvilas
(1 rep)
Jan 9, 2022, 02:27 AM
• Last activity: May 26, 2022, 07:24 PM
7
votes
4
answers
4244
views
Problems running python script from motion
I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using [Jeremy Blythe's script](http://jeremyblythe.blogspot.co.uk/2012/06/motion-google-drive-uploader-and.html) I have motion working correctly and the python script runs when I t...
I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using [Jeremy Blythe's script](http://jeremyblythe.blogspot.co.uk/2012/06/motion-google-drive-uploader-and.html)
I have motion working correctly and the python script runs when I test it from the terminal.
However the script doesn't run when I add it to the on_movie_end option in motion.conf.
The script I am using in the file is
On_Movie_End /etc/motion/uploader.py /etc/motion/uploader.cfg %f
I have also tried getting the on_movie_end to run a bash script that runs the python script and this doesn't work either. I am new to linux though so not entirely sure I have it correct.
The script is:
#!/bin/bash
VIDEO=$1
/etc/motion/uploader.py /etc/motion/uploader.cfg VIDEO
In motion.conf
/etc/motion/uploaderscript.sh %f
DanBrum
(71 rep)
Dec 21, 2012, 10:38 AM
• Last activity: Mar 3, 2022, 11:45 PM
3
votes
1
answers
4426
views
sound recording with motion?
I want to set up a daemon that starts recording video with sound when it detects noise or movement. There are tools that do that separately but can they be done at the same time? Can I set up motion in a way that when it detects motion it executes a script? Can I do the same with SOX?
I want to set up a daemon that starts recording video with sound when it detects noise or movement. There are tools that do that separately but can they be done at the same time? Can I set up motion in a way that when it detects motion it executes a script? Can I do the same with SOX?
tst
(195 rep)
Mar 26, 2017, 12:20 AM
• Last activity: Mar 3, 2022, 01:53 PM
5
votes
2
answers
8546
views
How to configure a video4linux loopback device
I am writing an application which is based on [Motion][1]. Motion allows me to define a video4linux loopback device: # Output images to a video4linux loopback device # The value '-' means next available (default: not defined) ; video_pipe value # Output motion images to a video4linux loopback device...
I am writing an application which is based on Motion . Motion allows me to define a video4linux loopback device:
# Output images to a video4linux loopback device
# The value '-' means next available (default: not defined)
; video_pipe value
# Output motion images to a video4linux loopback device
# The value '-' means next available (default: not defined)
; motion_video_pipe value
Motion already accesses the webcam to detect motion, now I would like to access images of the webcam, too. I think the loopback device is the right thing to do this.
But what do I have to do exactly? Do I have to configure another(?) video4linux device and add it in the configuration? Motion offers documentation about this topic. But I find it hard to get starting, as I am still troubled with how the whole architecture is working.
RevMoon
(153 rep)
Sep 25, 2012, 12:16 AM
• Last activity: Dec 23, 2021, 02:22 PM
1
votes
0
answers
350
views
How is lightswitch_percent and maximum_threshold different in Motion?
The Motion documentation for lightswitch_percent is as follows: "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."...
The Motion documentation for lightswitch_percent is as follows:
"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."
The documentation for threshold_maximum is as follows:
"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."
The question is whether an intensity change for a pixel is just the same as a change to that pixel that would count against the threshold_maximum. For example, assume my configuration sets the threshold_maximum at 70,000, the lightswitch_percent to 70, and my image dimensions set such that my image contains 100,000 pixels. If a moving object changes 70,000 pixels in that image, doesn't that just barely trigger both the lightswitch_percent and the threshold_maximum?
Perhaps they really are just the same thing for purposes of triggering the feature, but they just have different outcomes. When lightswitch_percent is triggered, the next few frames (default 5) are ignored for purposes of detecting motion. The result of a maximum_threshold being exceeded is only that the current frame is ignored for the purposes of detecting motion.
John Gauthier
(11 rep)
Apr 12, 2021, 11:43 PM
0
votes
1
answers
604
views
Motion on Pi - Not Writing Files
I am struggling to get Motion working properly. It is not currently writing files when it detects motion. I got my first Pi today. I have set it up, the camera works. I can take pictures and take video. These are being written fine. I have set up Motion and this appears to be working. I can stream t...
I am struggling to get Motion working properly. It is not currently writing files when it detects motion.
I got my first Pi today. I have set it up, the camera works. I can take pictures and take video. These are being written fine. I have set up Motion and this appears to be working. I can stream the video via the IP address/web browser to a different machine. When creating movement in front of the camera this is detected - the log file motion.log updates and detects motion. However, stills are not being written. The target_dir folder is empty and a search of the file system doesn't find any new image files.
How do I get the stills to be written when motion is detected?
motion.conf is below. Any suggestions welcome. Thanks
___________
# Daemon
# Start in daemon (background) mode and release terminal (default: off)
daemon off
# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid
# Basic Setup Mode
# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off
# Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined)
logfile /var/log/motion/motion.log
# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC)
log_level 6
# Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)
log_type all
###########################################################
# Capture device options
############################################################
# Videodevice to be used for capturing (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0
# v4l2_palette allows one to choose preferable palette to be use by motion
# See motion_guide.html for the valid options and values. (default: 17)
v4l2_palette 17
# Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
# This is ONLY used for FreeBSD. Leave it commented out for Linux
; tunerdevice /dev/tuner0
# The video input to be used (default: -1)
# Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras
# Set to 0 for uvideo(4) on OpenBSD
input -1
# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0
# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
frequency 0
# Override the power line frequency for the webcam. (normally not necessary)
# Values:
# -1 : Do not modify device setting
# 0 : Power line frequency Disabled
# 1 : 50hz
# 2 : 60hz
# 3 : Auto
power_line_frequency -1
# Rotate image this number of degrees. The rotation affects all saved images as
# well as movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
rotate 0
# Flip image over a given axis (vertical or horizontal), vertical means from left to right
# horizontal means top to bottom. Valid values: none, v and h.
flip_axis none
# Image width (pixels). Valid range: Camera dependent, default: 320
width 640
# Image height (pixels). Valid range: Camera dependent, default: 240
height 480
# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 2
# Minimum time in seconds between 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.
minimum_frame_time 0
# Full Network Camera URL. Valid Services: http:// ftp:// mjpg:// rtsp:// mjpeg:// file:// rtmp://
; netcam_url value
# Username and password for network camera if required. Syntax is user:password
; netcam_userpass value
# The setting for keep-alive of network socket, should improve performance on compatible net cameras.
# off: The historical implementation using HTTP/1.0, closing the socket after each http request.
# force: Use HTTP/1.0 requests with keep alive header to reuse the same connection.
# on: Use HTTP/1.1 requests that support keep alive as default.
# Default: off
netcam_keepalive off
# URL to use for a netcam proxy server, if required, e.g. "http://myproxy ".
# If a port number other than 80 is needed, use "http://myproxy:1234 ".
# Default: not defined
; netcam_proxy value
# Set less strict jpeg checks for network cameras with a poor/buggy firmware.
# Default: off
netcam_tolerant_check off
# RTSP connection uses TCP to communicate to the camera. Can prevent image corruption.
# Default: on
rtsp_uses_tcp on
# Name of camera to use if you are using a camera accessed through OpenMax/MMAL
# Default: Not defined
; mmalcam_name vc.ril.camera
# Camera control parameters (see raspivid/raspistill tool documentation)
# Default: Not defined
; mmalcam_control_params -hf
# Let motion regulate the brightness of a video device (default: off).
# The auto_brightness feature uses the brightness option as its target value.
# If brightness is zero auto_brightness will adjust to average brightness value 128.
# Only recommended for cameras without auto brightness
auto_brightness off
# Set the initial brightness of a video device.
# If auto_brightness is enabled, this value defines the average brightness level
# which Motion will try and adjust to.
# Valid range 0-255, default 0 = disabled
brightness 0
# Set the contrast of a video device.
# Valid range 0-255, default 0 = disabled
contrast 0
# Set the saturation of a video device.
# Valid range 0-255, default 0 = disabled
saturation 0
# Set the hue of a video device (NTSC feature).
# Valid range 0-255, default 0 = disabled
hue 0
# Round Robin (multiple inputs on same video device name)
# Number of frames to capture in each roundrobin step (default: 1)
roundrobin_frames 1
# Number of frames to skip before each roundrobin step (default: 1)
roundrobin_skip 1
# Try to filter out noise generated by roundrobin (default: off)
switchfilter off
############################################################
# Motion Detection Settings:
############################################################
# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 1500
# Automatically tune the threshold down if possible (default: off)
threshold_tune off
# Noise threshold for the motion detection (default: 32)
noise_level 32
# Automatically tune the noise threshold (default: on)
noise_tune on
# Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined)
# Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.
# (l)abeling must only be used once and the 'l' must be the last letter.
# Comment out to disable
despeckle_filter EedDl
# Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3
# A script (on_area_detected) is started immediately when motion is 4 5 6
# detected in one of the given areas, but only once during an event. 7 8 9
# One or more areas can be specified with this option. Take care: This option
# does NOT restrict detection to these areas! (Default: not defined)
; area_detect value
# PGM file to use as a sensitivity mask.
# Full path name to. (Default: not defined)
; mask_file value
# PGM file to completely mask out a area of image.
# Full path name to. (Default: not defined)
# mask_privacy value
# Dynamically create a mask file during operation (default: 0)
# Adjust speed of mask changes from 0 (off) to 10 (fast)
smart_mask_speed 0
# Ignore sudden massive light intensity changes given as a percentage of the picture
# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled
lightswitch 0
# 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: 1 to thousands, recommended 1-5
minimum_motion_frames 1
# Specifies the number of pre-captured (buffered) pictures from before motion
# was detected that will be output at motion detection.
# Recommended range: 0 to 5 (default: 0)
# Do not use large values! Large values will cause Motion to skip video frames and
# cause unsmooth movies. To smooth movies use larger values of post_capture instead.
pre_capture 0
# Number of frames to capture after motion is no longer detected (default: 0)
post_capture 0
# Event Gap is the seconds of no motion detection that triggers the end of an event.
# An event is defined as a series of motion images taken within a short timeframe.
# Recommended value is 60 seconds (Default). 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. Movies don't have gaps anymore. An
# event ends right after no more motion is detected and post_capture is over.
event_gap 60
# Maximum length in seconds of a movie
# When value is exceeded a new movie file is created. (Default: 0 = infinite)
max_movie_time 0
# Always save images even if there was no motion (default: off)
emulate_motion off
############################################################
# Image File Output
# Output 'normal' pictures when motion is detected (default: off)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_pictures centre
# Output pictures with only the pixels moving object (ghost images) (default: off)
output_debug_pictures off
# The quality (in percent) to be used by the jpeg and webp compression (default: 75)
quality 75
# Type of output images
# Valid values: jpeg, ppm or webp (default: jpeg)
picture_type jpeg
############################################################
# Use ffmpeg to encode videos of motion (default: off)
ffmpeg_output_movies off
# Use ffmpeg to make videos showing the moving pixels (ghost images) (default: off)
ffmpeg_output_debug_movies off
# Bitrate to be used by the ffmpeg encoder (default: 400000)
# This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)
ffmpeg_bps 400000
# Enables and defines variable bitrate for the ffmpeg encoder.
# ffmpeg_bps is ignored if variable bitrate is enabled.
# Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,
# or the range 1 - 100 where 1 means worst quality and 100 is best.
ffmpeg_variable_bitrate 0
# Container/Codec output videos
# Valid values: mpeg4, msmpeg4, swf,flv, ffv1, mov, mp4, mkv, hevc
ffmpeg_video_codec mkv
# When creating videos, should frames be duplicated in order
# to keep up with the requested frames per second
# (default: true)
ffmpeg_duplicate_frames true
# Interval in seconds between timelapse captures. Default: 0 = off
timelapse_interval 0
# Timelapse file rollover mode. See motion_guide.html for options and uses.
timelapse_mode daily
# Frame rate for timelapse playback
timelapse_fps 30
# Container/Codec for timelapse video. Valid values: mpg or mpeg4
timelapse_codec mpg
# External pipe to video encoder
# Replacement for FFMPEG builtin encoder for ffmpeg_output_movies only.
# The options movie_filename and timelapse_filename are also used
# by the ffmpeg feature
#############################################################
# Bool to enable or disable extpipe (default: off)
use_extpipe off
# External program (full path and opts) to pipe raw video to
# Generally, use '-' for STDIN...
;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
;extpipe x264 - --input-res %wx%h --fps %fps --bitrate 2000 --preset ultrafast --quiet -o %f.mp4
;extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%fps -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %fps
;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
# Snapshots (Traditional Periodic Webcam File Output)
# Make automated snapshot every N seconds (default: 0 = disabled)
snapshot_interval 0
############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level, \n = new line,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event - do not use with text_event!
# You can put quotation marks around the text to allow
# leading spaces
# Locate and draw a box around the moving object.
# Valid values: on, off, preview (default: off)
# Set to 'preview' will only draw a box in preview_shot pictures.
locate_motion_mode preview
# Set the look and style of the locate box if enabled.
# Valid values: box, redbox, cross, redcross (default: box)
# Set to 'box' will draw the traditional box.
# Set to 'redbox' will draw a red box.
# Set to 'cross' will draw a little cross to mark center.
# Set to 'redcross' will draw a little red cross to mark center.
locate_motion_style redbox
# Draws the timestamp using same options as C function strftime(3)
# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
# Text is placed in lower right corner
text_right %Y-%m-%d\n%T-%q
# Draw a user defined text on the images using same options as C function strftime(3)
# Default: Not defined = no text
# Text is placed in lower left corner
; text_left CAMERA %t
# Draw the number of changed pixed on the images (default: off)
# Will normally be set to off except when you setup and adjust the motion settings
# Text is placed in upper right corner
text_changes on
# 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.
# Default: %Y%m%d%H%M%S
# The idea is that %C can be used filenames and text_left/right for creating
# a unique identifier for each event.
text_event %Y%m%d%H%M%S
# Draw characters at twice normal size on images. (default: off)
text_double off
# Text to include in a JPEG EXIF comment
# May be any text, including conversion specifiers.
# The EXIF timestamp is included independent of this text.
;exif_text %i%J/%K%L
############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, picture_, movie_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir home/pi/Documents/motion
# File path for snapshots (jpeg, ppm or webp) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-snapshot
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
# File extension .jpg, .ppm or .webp is automatically added so do not include this.
# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
snapshot_filename %v-%Y%m%d%H%M%S-snapshot
# File path for motion triggered images (jpeg, ppm or .webp) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-%q
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q
# File extension .jpg, .ppm or .webp is automatically added so do not include this
# Set to 'preview' together with best-preview feature enables special naming
# convention for preview shots. See motion guide for details
picture_filename %v-%Y%m%d%H%M%S-%q
# File path for motion triggered ffmpeg films (movies) relative to target_dir
# Default: %v-%Y%m%d%H%M%S
# File extensions(.mpg .avi) are automatically added so do not include them
movie_filename %v-%Y%m%d%H%M%S
# File path for timelapse movies relative to target_dir
# Default: %Y%m%d-timelapse
# File extensions(.mpg .avi) are automatically added so do not include them
timelapse_filename %Y%m%d-timelapse
# Global Network Options
ipv6_enabled off
# Live Stream Server
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
# 50% scaled down substream (default: 0 = disabled)
# substream_port 8082
# Quality of the jpeg (in percent) images produced (default: 50)
stream_quality 80
# Output frames at 1 fps when no motion is detected and increase to the
# rate given by stream_maxrate when motion is detected (default: off)
stream_motion off
# Maximum framerate for stream streams (default: 1)
stream_maxrate 1
# Restrict stream connections to localhost only (default: on)
stream_localhost off
# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual stream rate by desired number of seconds
# Actual stream rate is the smallest of the numbers framerate and stream_maxrate
stream_limit 0
# Set the authentication method (default: 0)
# 0 = disabled
# 1 = Basic authentication
# 2 = MD5 digest (the safer authentication)
stream_auth_method 0
# Authentication for the stream. Syntax username:password
# Default: not defined (Disabled)
; stream_authentication username:password
# Percentage to scale the stream image for preview
# This is scaled on the browser side, motion will keep sending full frames
# Default: 25
; stream_preview_scale 25
# Have stream preview image start on a new line
# Default: no
; stream_preview_newline no
############################################################
# HTTP Based Control
############################################################
# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080
# Restrict control connections to localhost only (default: on)
webcontrol_localhost on
# Output for http server, select off to choose raw text plain (default: on)
webcontrol_html_output on
# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
; webcontrol_authentication username:password
# Parameters to include on webcontrol. 0=none, 1=limited, 2=advanced, 3=restricted
# Default: 0 (none)
webcontrol_parms 0
############################################################
# Tracking (Pan/Tilt)
#############################################################
# Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo, 6=servo)
# The generic type enables the definition of motion center and motion size to
# be used with the conversion specifiers for options like on_motion_detected
track_type 0
# Enable auto tracking (default: off)
track_auto off
# Serial port of motor (default: none)
;track_port /dev/ttyS0
# Motor number for x-axis (default: 0)
;track_motorx 0
# Set motorx reverse (default: 0)
;track_motorx_reverse 0
# Motor number for y-axis (default: 0)
;track_motory 1
# Set motory reverse (default: 0)
;track_motory_reverse 0
# Maximum value on x-axis (default: 0)
;track_maxx 200
# Minimum value on x-axis (default: 0)
;track_minx 50
# Maximum value on y-axis (default: 0)
;track_maxy 200
# Minimum value on y-axis (default: 0)
;track_miny 50
# Center value on x-axis (default: 0)
;track_homex 128
# Center value on y-axis (default: 0)
;track_homey 128
# ID of an iomojo camera if used (default: 0)
track_iomojo_id 0
# Angle in degrees the camera moves per step on the X-axis
# with auto-track (default: 10)
# Currently only used with pwc type cameras
track_step_angle_x 10
# Angle in degrees the camera moves per step on the Y-axis
# with auto-track (default: 10)
# Currently only used with pwc type cameras
track_step_angle_y 10
# Delay to wait for after tracking movement as number
# of picture frames (default: 10)
track_move_wait 10
# Speed to set the motor to (stepper motor option) (default: 255)
track_speed 255
# Number of steps to make (stepper motor option) (default: 40)
track_stepsize 40
############################################################
# External Commands, Warnings and Logging:
# You can use conversion specifiers for the on_xxxx commands
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# %f = filename with full path
# %n = number indicating filetype
# Both %f and %n are only defined for on_picture_save,
# on_movie_start and on_movie_end
# Quotation marks round string are allowed.
############################################################
# Do not sound beeps when detecting motion (default: on)
# Note: Motion never beeps when running in daemon mode.
quiet on
# Command to be executed when an event starts. (default: none)
# An event starts at first motion detected after a period of no motion defined by event_gap
; on_event_start value
# Command to be executed when an event ends after a period of no motion
# (default: none). The period of no motion is defined by option event_gap.
; on_event_end value
# Command to be executed when a picture (.ppm|.jpg) is saved (default: none)
# To give the filename as an argument to a command append it with %f
; on_picture_save value
# Command to be executed when a motion frame is detected (default: none)
; on_motion_detected value
# Command to be executed when motion in a predefined area is detected
# Check option 'area_detect'. (default: none)
; on_area_detected value
# Command to be executed when a movie file (.mpg|.avi) is created. (default: none)
# To give the filename as an argument to a command append it with %f
; on_movie_start value
# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)
# To give the filename as an argument to a command append it with %f
; on_movie_end value
# Command to be executed when a camera can't be opened or if it is lost
# NOTE: There is situations when motion don't detect a lost camera!
# It depends on the driver, some drivers dosn't detect a lost camera at all
# Some hangs the motion thread. Some even hangs the PC! (default: none)
; on_camera_lost value
# Command to be executed when a camera that was lost has been found (default: none)
# NOTE: If motion doesn't properly detect a lost camera, it also won't know it found one.
; on_camera_found value
#####################################################################
# Options require database options to be active also.
#####################################################################
# Log to the database when creating motion triggered picture file (default: on)
; sql_log_picture on
# Log to the database when creating a snapshot image file (default: on)
; sql_log_snapshot on
# Log to the database when creating motion triggered movie file (default: off)
; sql_log_movie off
# Log to the database when creating timelapse movies file (default: off)
; sql_log_timelapse off
# SQL query string that is sent to the database
# Use same conversion specifiers has for text features
# Additional special conversion specifiers are
# %n = the number representing the file_type
# %f = filename with full path
# Default value:
# Create tables :
##
# Mysql
# CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14));
#
# Postgresql
# CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp without time zone, event_time_stamp timestamp without time zone);
#
# insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
; sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')
############################################################
# Database Options
############################################################
# database type : mysql, postgresql, sqlite3 (default : not defined)
; database_type value
# database to log to (default: not defined)
# for sqlite3, the full path and name for the database.
; database_dbname value
# The host on which the database is located (default: localhost)
; database_host value
# User account name for database (default: not defined)
; database_user value
# User password for database (default: not defined)
; database_password value
# Port on which the database is located
# mysql 3306 , postgresql 5432 (default: not defined)
; database_port value
# Database wait time in milliseconds for locked database to
# be unlocked before returning database locked error (default 0)
; database_busy_timeout 0
# Video Loopback Device (vloopback project)
# Output images to a video4linux loopback device
# Specify the device associated with the loopback device
# For example /dev/video1 (default: not defined)
; video_pipe value
# Output motion images to a video4linux loopback device
# Specify the device associated with the loopback device
# For example /dev/video1 (default: not defined)
; motion_video_pipe value
# camera config files.
; camera /etc/motion/camera1.conf
; camera /etc/motion/camera2.conf
; camera /etc/motion/camera3.conf
; camera /etc/motion/camera4.conf
# Camera config directory
# Any files ending in '.conf' in this directory will be read
# as a camera config file.
; camera_dir /etc/motion/conf.d
rob585
(3 rep)
Apr 10, 2021, 09:54 AM
• Last activity: Apr 10, 2021, 07:09 PM
0
votes
1
answers
764
views
How to get two USB webcams to operate simultaneously on Raspberry Pi 4 running openSUSE Leap 15.2?
How do I get two USB webcams to operate simultaneously on a Raspberry Pi 4 running openSUSE Leap 15.2? I ultimately want this to work with [Motion](https://motion-project.github.io) and seem to have eliminated that as I also fail with just ffplay from the command line. I have two [webcams](https://w...
How do I get two USB webcams to operate simultaneously on a Raspberry Pi 4 running openSUSE Leap 15.2?
I ultimately want this to work with [Motion](https://motion-project.github.io) and seem to have eliminated that as I also fail with just ffplay from the command line.
I have two [webcams](https://www.amazon.co.uk/gp/product/B015VE4KP0) plugged in to a [powered USB hub](https://www.amazon.co.uk/gp/product/B07KFDFT4D) . Both webcams work independently but not together. As a test, plugging the webcams directly in to the Pi or removing power from the hub gives me **device descriptor read/64 error -110** so the hub *is* providing power correctly.
If I start the first cam as follows, I get a picture:
# ffplay -f v4l2 /dev/video0
But when I then start the second, I don't get a picture (the first will continue to work); we just wait here and don't appear to timeout (can't say I've waited for more than a few minutes, though):
# ffplay -loglevel debug -f v4l2 /dev/video2
ffplay version 3.4.8 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 7 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libx265 --enable-libxvid
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Initialized opengl renderer.
[video4linux2,v4l2 @ 0xffff40000b50] fd:11 capabilities:84a000010
[video4linux2,v4l2 @ 0xffff40000b50] Current input_channel: 0, input_name: Camera 1, input_std: 0
[video4linux2,v4l2 @ 0xffff40000b50] Querying the device for the current frame size
[video4linux2,v4l2 @ 0xffff40000b50] Setting frame size to 1280x720
[video4linux2,v4l2 @ 0xffff40000b50] The V4L2 driver changed the pixel format from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xffff40000b50] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xffff40000b50] The V4L2 driver changed the pixel format from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xffff40000b50] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xffff40000b50] The V4L2 driver changed the pixel format from 0x32315659 to 0x47504A4D
[video4linux2,v4l2 @ 0xffff40000b50] Trying to set codec:rawvideo pix_fmt:yuv422p
[video4linux2,v4l2 @ 0xffff40000b50] The V4L2 driver changed the pixel format from 0x50323234 to 0x47504A4D
[video4linux2,v4l2 @ 0xffff40000b50] Trying to set codec:rawvideo pix_fmt:yuyv422
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
Nothing in dmesg; journalctl shows this when first cam is started:
Dec 29 16:23:17 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Scheduling inhibition from ":1.14" "My SDL application" with cookie 18 and reason "Playing a game"
Dec 29 16:23:22 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Enforcing inhibition from ":1.14" "My SDL application" with cookie 18 and reason "Playing a game"
Dec 29 16:23:22 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Added change screen settings
Dec 29 16:23:22 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Added interrupt session
Dec 29 16:23:22 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Disabling DPMS due to inhibition
Dec 29 16:23:22 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Can't contact ck
...And then when the second is started
Dec 29 16:24:07 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Scheduling inhibition from ":1.14" "My SDL application" with cookie 19 and reason "Playing a game"
Dec 29 16:24:12 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Enforcing inhibition from ":1.14" "My SDL application" with cookie 19 and reason "Playing a game"
Dec 29 16:24:12 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Added change screen settings
Dec 29 16:24:12 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Added interrupt session
Dec 29 16:24:12 shed-pi4.xxx.xxx org_kde_powerdevil: powerdevil: Can't contact ck
Which might be the key or a red herring. The jury are still out according to Google!
If I stop ffplay for the first cam (video0), then the second 'hung' session (video2) will immediately spring in to life.
Other info:
# ls -lah /dev/v4l/by-path/
total 0
drwxr-xr-x 2 root root 120 Oct 21 15:01 .
drwxr-xr-x 4 root root 80 Oct 21 15:01 ..
lrwxrwxrwx 1 root root 12 Oct 21 15:01 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4.3:1.0-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 Oct 21 15:01 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4.3:1.0-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 Oct 21 15:01 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4.4:1.0-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 Oct 21 15:01 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4.4:1.0-video-index1 -> ../../video3
# ls -lah /dev/v4l/by-id/
total 0
drwxr-xr-x 2 root root 80 Oct 21 15:01 .
drwxr-xr-x 4 root root 80 Oct 21 15:01 ..
lrwxrwxrwx 1 root root 12 Oct 21 15:01 usb-HD_Camera_Manufacturer_USB_2.0_Camera-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 Oct 21 15:01 usb-HD_Camera_Manufacturer_USB_2.0_Camera-video-index1 -> ../../video1
# hwinfo --usb [Edit]
03: USB 00.1: 0000 Unclassified device
[Created at usb.122]
Unique ID: VfPh.nrd9O+1TtQ3
Parent ID: 33sj.xvTGa+XkbXF
SysFS ID: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.4/1-1.4.4:1.1
SysFS BusID: 1-1.4.4:1.1
Hardware Class: unknown
Model: "ARC International USB 2.0 Camera"
Hotplug: USB
Vendor: usb 0x05a3 "ARC International"
Device: usb 0x9310 "USB 2.0 Camera"
Driver: "uvcvideo"
Driver Modules: "uvcvideo"
Speed: 480 Mbps
Module Alias: "usb:v05A3p9310d0000dcEFdsc02dp01ic0Eisc02ip00in01"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #4 (Hub)
05: USB 00.2: 0000 Unclassified device
[Created at usb.122]
Unique ID: Wi1b.nrd9O+1TtQ3
Parent ID: 33sj.xvTGa+XkbXF
SysFS ID: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.3/1-1.4.3:1.2
SysFS BusID: 1-1.4.3:1.2
Hardware Class: unknown
Model: "ARC International USB 2.0 Camera"
Hotplug: USB
Vendor: usb 0x05a3 "ARC International"
Device: usb 0x9310 "USB 2.0 Camera"
Driver: "snd-usb-audio"
Driver Modules: "snd_usb_audio"
Speed: 480 Mbps
Module Alias: "usb:v05A3p9310d0000dcEFdsc02dp01ic01isc01ip00in02"
Driver Info #0:
Driver Status: snd_usb_audio is active
Driver Activation Cmd: "modprobe snd_usb_audio"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #4 (Hub)
# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 8, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 8, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 7, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 7, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
# v4l2-ctl --list-devices --verbose
USB 2.0 Camera: HD USB Camera (usb-0000:01:00.0-1.4.3):
/dev/video0
/dev/video1
USB 2.0 Camera: HD USB Camera (usb-0000:01:00.0-1.4.4):
/dev/video2
/dev/video3
VIDIOC_QUERYCAP: ok
I've been Googling all afternoon but so far drawn a blank. How can I get both cameras up and running simultaneously? I'm hoping that if I can get it working with ffplay then it will work with Motion.
Thanks in advance.
Marcus G
(63 rep)
Dec 29, 2020, 05:04 PM
• Last activity: Dec 30, 2020, 10:52 AM
2
votes
2
answers
697
views
Linux motion user - run it as ssh key as pi to remote server
This question is related to the [two](https://unix.stackexchange.com/questions/112087/broadcast-or-send-machine-readable-code-to-ssh-clients) [other](https://unix.stackexchange.com/questions/114080/run-linux-motion-app-as-user) questions I had earlier, about enabling Raspberry Pi to act as a motion...
This question is related to the [two](https://unix.stackexchange.com/questions/112087/broadcast-or-send-machine-readable-code-to-ssh-clients) [other](https://unix.stackexchange.com/questions/114080/run-linux-motion-app-as-user) questions I had earlier, about enabling Raspberry Pi to act as a motion sensor that will try to ssh into a more powerful server when it detects motion (the more power server will then do additional processing via a script). So here's what I did:
- On the Raspberry Pi, I installed Linux motion app
- I also used
ssh-keygen
on the Raspberry Pi and then using ssh-copy-id
copies public keys to the more power server, so that the Raspberry Pi can ssh
to the server without having to type in the password.
- On the motion.conf
file, there's a line for on_motion_detected
event for when the motion is detected by Raspberry Pi, on that line, I have something like:
>ssh user@more.powerful.server '/exec/some/script/here'
- But the script on the more powerful server is never executed because the motion daemon is running as user 'motion', rather than the user (pi) that did the ssh-keygen that the remote server accepts. I know this because:
- If I change the on_motion_detected
command to:
>on_motion_detected echo hello_world | wall
this command gets executed and I see it on all the terminals that are ssh'd into the Raspberry Pi
- Or, if instead of on the on_motion_detected line, I simply run ssh user@more.power.server '/exec/some/script/here'
on the Raspberry Pi's command line (as user 'pi'), it also gets triggered by the server.
So the question is, how do tell the Raspberry Pi's operating system to 'use' the key of the 'pi' user when the 'motion' user tries to ssh into the more powerful server, in that on_motion_detected
event?
Uzumaki Naruto
(157 rep)
May 18, 2014, 12:41 AM
• Last activity: Apr 28, 2020, 01:17 PM
0
votes
0
answers
320
views
Unknown config option "stream_tls" on motion 4.1.1
I want to use `stream_tls` option as [this link][1] which tells: > 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 connecti...
I want to use
stream_tls
option as this link which tells:
> 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
> webcontrol_cert and webcontrol_key file must also be specified.
When I add stream_tls
, webcontrol_tls
, webcontrol_key
and webcontrol_cert
, it gives me these logs:
[3626632:motion] [ALR] [ALL] conf_cmdparse: Unknown config option "stream_tls"
[3626632:motion] [ALR] [ALL] conf_cmdparse: Unknown config option "webcontrol_tls"
[3626632:motion] [ALR] [ALL] conf_cmdparse: Unknown config option "webcontrol_key"
[3626632:motion] [ALR] [ALL] conf_cmdparse: Unknown config option "webcontrol_cert"
I changed the configuration file /etc/motion/motion.conf
and these lines:
stream_tls on
webcontrol_tls on
webcontrol_key /etc/motion/motion.key
webcontrol_cert /etc/motion/motion.crt
In addition, I created /etc/motion/motion.key
and /etc/motion/motion.crt
by the following procedure:
openssl genrsa -out /etc/motion/motion.key 4096
openssl req -new -key /etc/motion/motion.key -out /etc/motion/motion.crt
My objective is to make motion
stream web page secure (https
). I don't know why it's happening. I'm sure the problem is not with .key
and .crt
file because if I just add stream_tls on
, it gives the same error for this option.
How can I solve this problem?
Mohi Rostami
(121 rep)
Feb 13, 2020, 07:56 AM
• Last activity: Feb 13, 2020, 05:08 PM
1
votes
3
answers
11956
views
Motion is taking an image every second even though it is setup not to
I am running motion on a Raspberry Pi with a surplus Microsoft Xbox camera. To the best of my knowlege I have set it up to only take an image every 30 minutes and to also create a daily timelapse with the images. However from the second I start it, motion is taking an image every second or so and sa...
I am running motion on a Raspberry Pi with a surplus Microsoft Xbox camera. To the best of my knowlege I have set it up to only take an image every 30 minutes and to also create a daily timelapse with the images. However from the second I start it, motion is taking an image every second or so and saving it to my snapshoots folder. I dont want this to happen! Of course I want the live feed visable via the web UI but I only want an image to be saved every half hour as well as the daily timelapse.
Here is what I belive are the relevant parts of my config files:
My /etc/motion/motion.conf: The entire thing is here: https://pastebin.com/32cZNeGU
# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 100
# Minimum time in seconds between 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.
minimum_frame_time 0
############################################################
# Motion Detection Settings:
############################################################
# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 9999
# Automatically tune the threshold down if possible (default: off)
threshold_tune off
# Noise threshold for the motion detection (default: 32)
noise_level 32
# Automatically tune the noise threshold (default: on)
noise_tune on
# Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined)
# Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.
# (l)abeling must only be used once and the 'l' must be the last letter.
# Comment out to disable
despeckle_filter EedDl
# Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3
# A script (on_area_detected) is started immediately when motion is 4 5 6
# detected in one of the given areas, but only once during an event. 7 8 9
# One or more areas can be specified with this option. Take care: This option
# does NOT restrict detection to these areas! (Default: not defined)
; area_detect value
# PGM file to use as a sensitivity mask.
# Full path name to. (Default: not defined)
; mask_file value
# Dynamically create a mask file during operation (default: 0)
# Adjust speed of mask changes from 0 (off) to 10 (fast)
smart_mask_speed 0
# Ignore sudden massive light intensity changes given as a percentage of the picture
# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled
lightswitch 0
# 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: 1 to thousands, recommended 1-5
minimum_motion_frames 1
# Specifies the number of pre-captured (buffered) pictures from before motion
# was detected that will be output at motion detection.
# Recommended range: 0 to 5 (default: 0)
# Do not use large values! Large values will cause Motion to skip video frames and
# cause unsmooth movies. To smooth movies use larger values of post_capture instead.
pre_capture 0
# Number of frames to capture after motion is no longer detected (default: 0)
post_capture 0
# Event Gap is the seconds of no motion detection that triggers the end of an event.
# An event is defined as a series of motion images taken within a short timeframe.
# Recommended value is 60 seconds (Default). 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. Movies don't have gaps anymore. An
# event ends right after no more motion is detected and post_capture is over.
event_gap 60
# Maximum length in seconds of a movie
# When value is exceeded a new movie file is created. (Default: 0 = infinite)
max_movie_time 0
# Always save images even if there was no motion (default: off)
emulate_motion off
############################################################
# Image File Output
############################################################
# Output 'normal' pictures when motion is detected (default: on)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_pictures off
# Output pictures with only the pixels moving object (ghost images) (default: off)
output_debug_pictures off
# The quality (in percent) to be used by the jpeg compression (default: 75)
quality 75
# Type of output images
# Valid values: jpeg, ppm (default: jpeg)
picture_type jpeg
############################################################
# FFMPEG related options
# Film (movies) file output, and deinterlacing of the video input
# The options movie_filename and timelapse_filename are also used
# by the ffmpeg feature
############################################################
# Use ffmpeg to encode movies in realtime (default: off)
ffmpeg_output_movies on
# Use ffmpeg to make movies with only the pixels moving
# object (ghost images) (default: off)
ffmpeg_output_debug_movies off
# Use ffmpeg to encode a timelapse movie
# Default value 0 = off - else save frame every Nth second
ffmpeg_timelapse 1800000
# The file rollover mode of the timelapse video
# Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual
ffmpeg_timelapse_mode daily
# Bitrate to be used by the ffmpeg encoder (default: 400000)
# This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)
ffmpeg_bps 400000
# Enables and defines variable bitrate for the ffmpeg encoder.
# ffmpeg_bps is ignored if variable bitrate is enabled.
# Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,
# or the range 1 - 100 where 1 means worst quality and 100 is best.
ffmpeg_variable_bitrate 0
# Codec to used by ffmpeg for the video compression.
# Timelapse videos have two options.
# 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.
# 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.
# Supported formats are:
# mpeg4 or msmpeg4 - gives you files with extension .avi
# msmpeg4 is recommended for use with Windows Media Player because
# it requires no installation of codec on the Windows client.
# swf - gives you a flash film with extension .swf
# flv - gives you a flash video with extension .flv
# ffv1 - FF video codec 1 for Lossless Encoding
# mov - QuickTime
# mp4 - MPEG-4 Part 14 H264 encoding
# mkv - Matroska H264 encoding
# hevc - H.265 / HEVC (High Efficiency Video Coding)
ffmpeg_video_codec hevc
# When creating videos, should frames be duplicated in order
# to keep up with the requested frames per second
# (default: true)
ffmpeg_duplicate_frames false
############################################################
# Snapshots (Traditional Periodic Webcam File Output)
############################################################
# Make automated snapshot every N seconds (default: 0 = disabled)
snapshot_interval 1800000
############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level, \n = new line,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event - do not use with text_event!
# You can put quotation marks around the text to allow
# leading spaces
############################################################
# Locate and draw a box around the moving object.
# Valid values: on, off, preview (default: off)
# Set to 'preview' will only draw a box in preview_shot pictures.
locate_motion_mode off
# Set the look and style of the locate box if enabled.
# Valid values: box, redbox, cross, redcross (default: box)
# Set to 'box' will draw the traditional box.
# Set to 'redbox' will draw a red box.
# Set to 'cross' will draw a little cross to mark center.
# Set to 'redcross' will draw a little red cross to mark center.
locate_motion_style box
# Draws the timestamp using same options as C function strftime(3)
# Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
# Text is placed in lower right corner
text_right %Y-%m-%d\n%T-%q
# Draw a user defined text on the images using same options as C function strftime(3)
# Default: Not defined = no text
# Text is placed in lower left corner
text_left %t Skycam facing South East %T *d frame%q noise%N
# Draw the number of changed pixed on the images (default: off)
# Will normally be set to off except when you setup and adjust the motion settings
# Text is placed in upper right corner
text_changes off
# 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.
# Default: %Y%m%d%H%M%S
# The idea is that %C can be used filenames and text_left/right for creating
# a unique identifier for each event.
text_event %Y%m%d%H%M%S
# Draw characters at twice normal size on images. (default: off)
text_double on
# Text to include in a JPEG EXIF comment
# May be any text, including conversion specifiers.
# The EXIF timestamp is included independent of this text.
;exif_text %i%J/%K%L
############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, picture_, movie_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
############################################################
# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /home/pi/skycam-snapshots
# File path for snapshots (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-snapshot
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
# File extension .jpg or .ppm is automatically added so do not include this.
# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
snapshot_filename %v-%Y%m%d%H%M%S-snapshot
# File path for motion triggered images (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-%q
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q
# File extension .jpg or .ppm is automatically added so do not include this
# Set to 'preview' together with best-preview feature enables special naming
# convention for preview shots. See motion guide for details
picture_filename %v-%Y%m%d%H%M%S-%q
# File path for motion triggered ffmpeg films (movies) relative to target_dir
# Default: %v-%Y%m%d%H%M%S
# File extensions(.mpg .avi) are automatically added so do not include them
movie_filename %v-%Y%m%d%H%M%S
# File path for timelapse movies relative to target_dir
# Default: %Y%m%d-timelapse
# File extensions(.mpg .avi) are automatically added so do not include them
timelapse_filename %Y%m%d-timelapse
############################################################
# Global Network Options
############################################################
# Enable IPv6 (default: off)
ipv6_enabled off
############################################################
# Live Stream Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
# Quality of the jpeg (in percent) images produced (default: 50)
stream_quality 75
# Output frames at 1 fps when no motion is detected and increase to the
# rate given by stream_maxrate when motion is detected (default: off)
stream_motion off
# Maximum framerate for stream streams (default: 1)
stream_maxrate 100
# Restrict stream connections to localhost only (default: on)
stream_localhost off
# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual stream rate by desired number of seconds
# Actual stream rate is the smallest of the numbers framerate and stream_maxrate
stream_limit 0
# Set the authentication method (default: 0)
# 0 = disabled
# 1 = Basic authentication
# 2 = MD5 digest (the safer authentication)
stream_auth_method 0
# Authentication for the stream. Syntax username:password
# Default: not defined (Disabled)
stream_authentication admin:admin
# Percentage to scale the stream image for preview
# Default: 25
; stream_preview_scale 25
# Have stream preview image start on a new line
# Default: no
; stream_preview_newline no
############################################################
# HTTP Based Control
############################################################
# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8181
# Restrict control connections to localhost only (default: on)
webcontrol_localhost on
# Output for http server, select off to choose raw text plain (default: on)
webcontrol_html_output on
# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
webcontrol_authentication admin:admin
############################################################
# External Commands, Warnings and Logging:
# You can use conversion specifiers for the on_xxxx commands
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# %f = filename with full path
# %n = number indicating filetype
# Both %f and %n are only defined for on_picture_save,
# on_movie_start and on_movie_end
# Quotation marks round string are allowed.
############################################################
# Do not sound beeps when detecting motion (default: on)
# Note: Motion never beeps when running in daemon mode.
quiet on
# Command to be executed when an event starts. (default: none)
# An event starts at first motion detected after a period of no motion defined by event_gap
; on_event_start value
# Command to be executed when an event ends after a period of no motion
# (default: none). The period of no motion is defined by option event_gap.
; on_event_end value
# Command to be executed when a picture (.ppm|.jpg) is saved (default: none)
# To give the filename as an argument to a command append it with %f
; on_picture_save value
# Command to be executed when a motion frame is detected (default: none)
; on_motion_detected value
# Command to be executed when motion in a predefined area is detected
# Check option 'area_detect'. (default: none)
; on_area_detected value
# Command to be executed when a movie file (.mpg|.avi) is created. (default: none)
# To give the filename as an argument to a command append it with %f
; on_movie_start value
# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)
# To give the filename as an argument to a command append it with %f
; on_movie_end value
# Command to be executed when a camera can't be opened or if it is lost
# NOTE: There is situations when motion don't detect a lost camera!
# It depends on the driver, some drivers dosn't detect a lost camera at all
# Some hangs the motion thread. Some even hangs the PC! (default: none)
; on_camera_lost value
############################################################
# Video Loopback Device (vloopback project)
############################################################
# Output images to a video4linux loopback device
# The value '-' means next available (default: not defined)
; video_pipe value
# Output motion images to a video4linux loopback device
# The value '-' means next available (default: not defined)
; motion_video_pipe value
##############################################################
# camera config files - One for each camera.
# Except if only one camera - You only need this config file.
# If you have more than one camera you MUST define one camera
# config file for each camera in addition to this config file.
##############################################################
# Remember: If you have more than one camera you must have one
# camera file for each camera. E.g. 2 cameras requires 3 files:
# This motion.conf file AND camera1.conf and camera2.conf.
# Only put the options that are unique to each camera in the
# camera config files.
camera /etc/motion/camera1.conf
; camera /etc/motion/camera2.conf
; camera /etc/motion/camera3.conf
; camera /etc/motion/camera4.conf
##############################################################
# Camera config directory - One for each camera.
##############################################################
#
camera_dir /etc/motion/conf.d
Here is my /etc/motion/camera1.conf: (This is the entire file)
# /etc/motion/camera1.conf
#
# This config file was generated by motion 4.0
###########################################################
# Capture device options
############################################################
# Camera Id
# Consistent identification number to assign to each camera across multiple
# invocations of Motion.
# Default: The order when the camera file was read
# camera_id = 1
# Videodevice to be used for capturing (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0
# The video input to be used (default: -1)
# Should normally be set to 1 for video/TV cards, and -1 for USB cameras
input -1
# Draw a user defined text on the images using same options as C function strftime(3)
# Default: Not defined = no text
# Text is placed in lower left corner
text_left %t Skycam facing SE %T *d frame%q noise%N
############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, picture_, mpeg_ and timelapse_filename
# you can use conversion specifiers
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second,
# %v = event, %q = frame number, %t = camera id number,
# %D = changed pixels, %N = noise level,
# %i and %J = width and height of motion area,
# %K and %L = X and Y coordinates of motion center
# %C = value defined by text_event
# Quotation marks round string are allowed.
############################################################
# Target base directory for pictures and films
# Recommended to use absolute patch. (Default: current working directory)
#target_dir /tmp/motion/cam1
# File path for motion triggered images (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-%q
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q
# File extension .jpg or .ppm is automatically added so do not include this
# Set to 'preview' together with best-preview feature enables special naming
# convention for preview shots. See motion guide for details
picture_filename CAM1_%v-%Y%m%d%H%M%S-%q
############################################################
# Live Stream Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
# Command to be executed when a picture (.ppm|.jpg) is saved (default: none)
# The filename of the picture is appended as an argument for the command.
#on_picture_save /usr/local/motion-extras/camparse2.pl
# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)
# Filename of movie is appended as an argument for the command.
#on_movie_end /usr/local/motion-extras/mpegparse2.pl
NoviceUbuntuGeek
(143 rep)
Oct 29, 2017, 08:22 PM
• Last activity: Dec 26, 2019, 02:24 PM
-1
votes
1
answers
132
views
Transfer localhost:8081 to my Webserver via FTP
I have a raspberry pi with `motion` installed. I have a `mjpg` at `localhost:8081` and want to transfer it to an other webserver on the internet, so it's kind of a relay. I don't know where to find the `mjpg` on the file system for easy transfer, it's not in the configured folder. So, what's the bes...
I have a raspberry pi with
motion
installed. I have a mjpg
at localhost:8081
and want to transfer it to an other webserver on the internet, so it's kind of a relay. I don't know where to find the mjpg
on the file system for easy transfer, it's not in the configured folder. So, what's the best way to transfer my localhost:8081
to my webserver? It shows the live image of my webcam.
cli
(1 rep)
Apr 14, 2019, 10:08 AM
• Last activity: Apr 19, 2019, 05:49 PM
1
votes
1
answers
1478
views
Motion stops streaming on movement (and no logs produced)
I am trying to get a hello-world stream working from a USB webcam to a browser over a local network using Motion. (On a Raspberry Pi). When I run `service motion start` on the RPi and go to `http://192.168.0.xyz:8081` on my PC, the streaming works as expected. But when there is any movement, in Fire...
I am trying to get a hello-world stream working from a USB webcam to a browser over a local network using Motion. (On a Raspberry Pi).
When I run
service motion start
on the RPi and go to http://192.168.0.xyz:8081
on my PC, the streaming works as expected. But when there is any movement, in Firefox it stops and says "Connection was reset". Refreshing sometimes makes it work, but sometimes gives a "Could not connect" message. In chrome the picture just freezes.
I am not trying to use any motion-detection features for the moment, and have disabled all such options (that I have found).
cat /tmp/motion.log
is empty.
Installation was as follows. (Everything was done as root to make things a bit simpler.)
apt-get update
apt-get install motion -y
I then changed the following options in /etc/motion/motion.conf
daemon off
setup_mode off
output_pictures off
output_debug_pictures off
target_dir /var/lib/motion
stream_port 8081
stream_motion off
stream_localhost off
Then I run
service motion start
What am I doing wrong?
Jayy
(227 rep)
Dec 20, 2016, 02:22 PM
• Last activity: Apr 13, 2019, 05:24 PM
2
votes
0
answers
884
views
Motion with MJPEG format in OpenWRT?
Right now my router implemented by OpenWRT. The router has motion and webcam for IP cam. But when I activated motion, the following error message appears: [1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue [1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue [1] [CRT] [VID] mjpegtoyuv4...
Right now my router implemented by OpenWRT. The router has motion and webcam for IP cam.
But when I activated motion, the following error message appears:
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
[CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue
My webcam is a Logitech c270, and I believe it supports the MJPEG format.
v4l2_palette 8
which it tells the router to use MJPEG for the webcam.
I followed this website to solve the problem, but I can't find the file that suppose to be edited (file:common_video.c perhaps?).
https://github.com/Mr-Dave/motion/issues/65
Andika Trisna Adhi
(29 rep)
May 15, 2016, 08:57 AM
• Last activity: Aug 21, 2018, 12:54 AM
1
votes
1
answers
376
views
"Motion" video motion detecting software framerate issues
I am trying to configure motion (https://motion-project.github.io/) to record video files. No matter what value I set the `framerate` option the video files that are created all appear to have a framerate of between 1 and 2 FPS. I am running on a Raspberry Pi Zero. Is it possible that the frame rate...
I am trying to configure motion (https://motion-project.github.io/) to record video files.
No matter what value I set the
framerate
option the video files that are created all appear to have a framerate of between 1 and 2 FPS.
I am running on a Raspberry Pi Zero. Is it possible that the frame rate is being throttled or limited by available memory or processor speed of raspi zero?
Anyone have any insight into this issue?
Here is my config file: https://pastebin.com/28teAEiJ
WillD
(193 rep)
Jul 4, 2018, 08:43 PM
• Last activity: Jul 4, 2018, 11:28 PM
0
votes
1
answers
419
views
motion blue and black image on built in server - saved images are ok
I'm experimenting motion on my desktop, My webcam: Logitech, Inc. Webcam C270 Output Images and video are ok but the image on built in server aren't. They are like blue and black - almost monochromatic but sometimes it get gray also. I've tried open with vlc and it's ok - I think it's related with t...
I'm experimenting motion on my desktop,
My webcam: Logitech, Inc. Webcam C270
Output Images and video are ok but the image on built in server aren't. They are like blue and black - almost monochromatic but sometimes it get gray also.
I've tried open with vlc and it's ok - I think it's related with the video compression before transmit it to the server.
[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
[0:motion] [NTC] [ALL] motion_startup: Motion 4.0.1 Started
[0:motion] [NTC] [ALL] motion_startup: Logging to syslog
[0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
[0:motion] [NTC] [ENC] ffmpeg_init: ffmpeg libavcodec version 56.60.100 libavformat version 56.40.101
[0:motion] [NTC] [ALL] main: Motion running in setup mode.
[0:motion] [NTC] [ALL] main: Camera 0 is from /etc/motion/motion.conf
[0:motion] [NTC] [ALL] main: Camera 0 is device: /dev/video0 input -1
[0:motion] [NTC] [ALL] main: Stream port 8081
[0:motion] [NTC] [ALL] main: Waiting for threads to finish, pid: 2787
[1:ml1] [NTC] [ALL] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
[0:web_control] [NTC] [STR] http_bindsock: listening on 127.0.0.1 port 8080
[0:web_control] [NTC] [STR] httpd_run: Started motion-httpd server on port 8080 (auth Disabled)
[1:ml1] [NTC] [VID] v4l2_get_capability:
------------------------
cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:0825)"
cap.bus_info: "usb-0000:00:12.2-1"
cap.capabilities=0x84200001
------------------------
[1:ml1] [NTC] [VID] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] v4l2_select_input: - CAMERA
[1:ml1] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1:ml1] [NTC] [VID] v4l2_set_pix_format: Config palette index 17 (YU12) doesn't work.
[1:ml1] [NTC] [VID] v4l2_set_pix_format: Supported palettes:
[1:ml1] [NTC] [VID] v4l2_set_pix_format: (0) YUYV (YUYV 4:2:2)
[1:ml1] [NTC] [VID] v4l2_set_pix_format: 0 - YUYV 4:2:2 (compressed : 0) (0x56595559)
[1:ml1] [NTC] [VID] v4l2_set_pix_format: (1) MJPG (Motion-JPEG)
[1:ml1] [NTC] [VID] v4l2_set_pix_format: 1 - Motion-JPEG (compressed : 1) (0x47504a4d)
[1:ml1] [NTC] [VID] v4l2_set_pix_format Selected palette YUYV
[1:ml1] [NTC] [VID] v4l2_do_set_pix_format: Testing palette YUYV (320x240)
[1:ml1] [NTC] [VID] v4l2_do_set_pix_format: Using palette YUYV (320x240) bytesperlines 640 sizeimage 153600 colorspace 00000008
[1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255
[1:ml1] [NTC] [VID] v4l2_scan_controls: "Brightness", default 128, current 128
[1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255
[1:ml1] [NTC] [VID] v4l2_scan_controls: "Contrast", default 32, current 32
[1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255
[1:ml1] [NTC] [VID] v4l2_scan_controls: "Saturation", default 32, current 32
[1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,2
[1:ml1] [NTC] [VID] v4l2_scan_controls: "Power Line Frequency", default 2, current 2
[1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255
[1:ml1] [NTC] [VID] v4l2_scan_controls: "Gain", default 64, current 192
[1:ml1] [NTC] [VID] vid_v4lx_start: Using V4L2
[1:ml1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [STR] http_bindsock: listening on 127.0.0.1 port 8081
[1:ml1] [NTC] [ALL] motion_init: Started motion-stream server on port 8081 (auth Disabled)

Elias Bencz
(1 rep)
Sep 22, 2017, 10:38 PM
• Last activity: Oct 1, 2017, 12:23 PM
0
votes
1
answers
582
views
Show Motion stream on multiple web page
I am running motion, and so far everything work nicely, I can access the stream on port 8081, without problem. Is there a way to show the stream of the same webcam on multiple port ? If yes, how ? I tried setting up this in `motion.conf` : stream_port 8081 stream_port 8082 But only the last port is...
I am running motion, and so far everything work nicely, I can access the stream on port 8081, without problem.
Is there a way to show the stream of the same webcam on multiple port ? If yes, how ? I tried setting up this in
motion.conf
:
stream_port 8081
stream_port 8082
But only the last port is reachable. How can both be reachable ?
user96649
(211 rep)
May 9, 2017, 08:48 AM
• Last activity: May 9, 2017, 01:52 PM
2
votes
1
answers
522
views
who is accessing /dev/video0
I have a streaming video feed set up with the motion package. something like this: https://www.youtube.com/watch?v=jGkHSU-UPLU Works great. What I want to know, is who is connecting to my streaming media feed? It's supposed to just be my boyfriend. The light on my web camera is always on, even when...
I have a streaming video feed set up with the motion package.
something like this: https://www.youtube.com/watch?v=jGkHSU-UPLU
Works great. What I want to know, is who is connecting to my streaming media feed?
It's supposed to just be my boyfriend.
The light on my web camera is always on, even when he says he isn't viewing. I'm a little put off by this. Is there anyway to get more info about who (IP address) is viewing my stream?
Does the camera stay on even when no one is connected?
Brooke Fogg-Wolfe
(143 rep)
Dec 9, 2014, 12:24 AM
• Last activity: Oct 3, 2016, 01:09 AM
2
votes
0
answers
163
views
using motion to trigger snapshot when movement stops
I am trying to use motion software (but I could use just any other linux software) in order to "log" some manual work by snapshots. So imagine I want to make a stop-motion film with my LEGO(r) toys (just an example, but for better understanding), and my webcam should take one snapshot when my hands...
I am trying to use motion software (but I could use just any other linux software) in order to "log" some manual work by snapshots. So imagine I want to make a stop-motion film with my LEGO(r) toys (just an example, but for better understanding), and my webcam should take one snapshot when my hands get out of the way. There are tons of docs in the Internet to achieve the opposite (record when move detected), but none this way:
1. wait until there is movement in the field of view
2. detect movement, so wait until movement stops
3. movement stops, so take an snapshot.
Is this possible with motion, cheese, or other webcam software?
viridis
(41 rep)
Jan 20, 2016, 02:13 PM
• Last activity: Sep 9, 2016, 02:44 AM
Showing page 1 of 20 total questions