Motion - Support Question 2005x 08x 18x 152208

motion dies running as daemon, fails to create mpg even in debug mode

Question

I have a stock Fedora core 4 system, all packages are installed with yum. I installed motion 3.2.3 from the rpm available. I had everything working just fine on a Fedora Core 2 system.

Even though I have the ffmpeg option set in my motion.conf file, it seems to be ignored. Motion will run just fine until motion is detected and then exit.

I don't see why there is a permission problem, the jpg and snapshots are created in the same directory with no issues.

Here is a snippet from /var/log/messages

-------------------------------
Aug 18 09:19:18 trinity motion: [0] Processing thread 0 - config file
motion.conf
Aug 18 09:19:18 trinity motion: [0] Motion running as daemon process
Aug 18 09:19:18 trinity motion: [1] Thread is from motion.conf
Aug 18 09:27:42 trinity motion: [1] url_fopen - error opening file .avi ...
check access rights to target directory: Permission denied
Aug 18 09:27:42 trinity motion: [1] ffopen_open error creating file [.avi]:
Permission denied
Aug 18 09:27:42 trinity motion: [1] netcam camera handler: finish set,
exiting
Aug 18 09:27:43 trinity motion: [1] Motion terminating

Here is my config file:

------------------------------------
############################################################
# Daemon
############################################################
daemon on
############################################################
# Basic Setup Mode
############################################################
setup_mode off
###########################################################
# Capture device options
############################################################
videodevice /dev/video0
; tunerdevice /dev/tuner0
input 8
norm 0
frequency 0
rotate 0
width 320
height 240
framerate 10
netcam_url http://camera1/VIDEO.CGI
; netcam_proxy value
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
############################################################
# Round Robin (multiple inputs on same video device name)
############################################################
roundrobin_frames 1
roundrobin_skip 1
switchfilter off
############################################################
# Motion Detection Settings:
############################################################
threshold 100
threshold_tune off
noise_level 32
noise_tune off
night_compensate on
despeckle EedDl
;mask_file
smart_mask_speed 0
lightswitch 0
minimum_motion_frames 1
pre_capture 1
post_capture 1
gap 60
minimum_gap 0
max_mpeg_time 0
low_cpu 0
output_all off
############################################################
# Image File Output
############################################################
output_normal on
output_motion off
quality 75
ppm off
############################################################
# Film (mpeg) File Output - ffmpeg based
############################################################
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec mpeg4
############################################################
# Snapshots (Traditional Periodic Webcam File Output)
############################################################
snapshot_interval 10
############################################################
# Text Display
# %Y = year, %m = month, %d = date,
# %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
# %v = event, %q = frame number, \n = new line,
# %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
# You can put quotation marks around the text to allow
# leading spaces
############################################################
locate on
text_right %Y-%m-%d\n%T-%q
text_left Front_Door
text_changes on
text_double off
############################################################
# Target Directories and filenames For Images And Films
# For the options snapshot_, jpeg_, 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
# %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
# Quotation marks round string are allowed.
############################################################
target_dir /data/Video/cameras/camera1
snapshot_filename snapshot
jpeg_filename %Y_%m_%d/%H/%v-%H%M%S-%q
ffmpeg_filename %Y_%m_%d/%H/%v-%H%M%S
timelapse_filename %Y_%m_%d/timelapse
############################################################
# Live Webcam Server
############################################################
webcam_port 8081
webcam_quality 50
webcam_motion off
webcam_maxrate 1
webcam_localhost off
webcam_limit 0
############################################################
# HTTP Based Control
############################################################
control_port 0
control_localhost off
control_html_output off
; control_authentication username:password
############################################################
# Tracking (Pan/Tilt)
############################################################
track_type 0
; track_port value
track_motorx -1
track_maxx 0
track_iomojo_id 0
track_speed 255
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
# %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
# Quotation marks round string are allowed.
############################################################
quiet on
; on_event_start value
on_event_end /usr/bin/monitor/setWeb.pl
; on_picture_save value
; on_motion_detected value
; on_movie_start value
; on_movie_end
############################################################
# Common Options For MySQL and PostgreSQL database features.
# Options require the MySQL/PostgreSQL options to be active also.
############################################################
sql_log_image off
sql_log_snapshot off
sql_log_mpeg off
sql_log_timelapse off
############################################################
# Database Options For MySQL
############################################################
; mysql_db motion
; mysql_host 
; mysql_user 
; mysql_password 
############################################################
# Database Options For PostgreSQL
############################################################
; pgsql_db value
; pgsql_host value
; pgsql_user value
; pgsql_password value
; pgsql_port 5432
############################################################
# Video Loopback Device (vloopback project)
############################################################
; video_pipe value
; motion_video_pipe value
##############################################################
# Thread 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 thread
# config file for each camera in addition to this config file.
##############################################################
; thread /usr/local/etc/thread1.conf
; thread /usr/local/etc/thread2.conf
; thread /usr/local/etc/thread3.conf
; thread /usr/local/etc/thread4.conf

Environment

Motion version: 3.2.3
ffmpeg version: 0.4.9-pre1, build 4753
Libraries: ffmpeg, mysql, postgresql
Server OS: Fedora Core 4, Kernel 2.6.12-1.1398_FC4

-- JohnDoll - 18 Aug 2005

Follow up

I've tried to reproduce your error without luck . I've launch motion from command line as i guess you did with your config file :

./motion -c motion.conf
[0] Processing thread 0 - config file motion.conf
[0] Motion going to daemon mode

Aug 18 20:57:19 develop2 motion: [0] Processing thread 0 - config file motion.conf
Aug 18 20:57:19 develop2 motion: [0] Motion running as daemon process
Aug 18 20:57:19 develop2 motion: [1] Thread is from motion.conf
Aug 18 20:57:30 develop2 motion: [1] url_fopen - error opening file /tmp/2005_08_18/20/01-205730.avi ... 
check access rights to target directory: Permission denied
Aug 18 20:57:30 develop2 motion: [1] ffopen_open error creating file [/tmp/2005_08_18/20/01-205730.avi]: 
Permission denied
Aug 18 20:57:30 develop2 motion: [1] Error opening file /tmp/2005_08_18/20/01-205729-09.jpg with mode w: 
Permission denied
Aug 18 20:57:30 develop2 motion: [1] Can't write picture to file /tmp/2005_08_18/20/01-205729-09.jpg - 
check access rights to target directory: Permission denied
Aug 18 20:57:30 develop2 motion: [1] Error opening file /tmp/2005_08_18/20/01-205730-00.jpg with mode w: 
Permission denied
Aug 18 20:57:30 develop2 motion: [1] Can't write picture to file /tmp/2005_08_18/20/01-205730-00.jpg - 
check access rights to target directory: Permission denied
Aug 18 20:57:30 develop2 motion: [1] netcam camera handler: finish set, exiting
Aug 18 20:57:30 develop2 motion: [1] Motion terminating

I see that your error is pointing to .avi file strange ... but in your log message i don't see any error for jpeg files.

-- AngelCarpintero - 18 Aug 2005

I guess the rpm download of motion is no good for FC4, I compiled motion from source and the issue is gone. -- JohnDoll - 19 Aug 2005

Answer

My guess is that you did not have the same ffmpeg RPM installed as I had when I built the RPM.

The RPM is built on an Fedora Core 4 system with ffmpeg RPMs from Livna.

Which RPM do you have of ffmpeg?

rpm -qi ffmpeg

rpm -qi ffmpeg-devel

If you used the RPM with ffmpeg compiled from sources then the problem may be that it either cannot find the libavcodec.so and libavframe.so files or does not have permissions to it.

-- KennethLavrsen - 19 Aug 2005
Topic revision: r4 - 19 Aug 2005, KennethLavrsen
Copyright © 1999-2024 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.