我在树莓派上安装了运动,一旦我在相机前进行“运动/移动”,它就会崩溃。
错误如下:
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [ENC] ffmpeg_open: url_fopen - error opening file /var/lib/motion/01-20161109144955.avi ... check access rights to target directory:
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [EVT] event_ffmpeg_newfile: ffopen_open error creating (new) file [/var/lib/motion/01-20161109144955.avi]:
Nov 9 14:49:55 raspberrypi motion: [1] [NTC] [ALL] motion_detected: Motion detected - starting event 1
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [ALL] myfopen: Error opening file /var/lib/motion/01-20161109144955-03.jpg with mode w:
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [ALL] put_picture: Can't write picture to file /var/lib/motion/01-20161109144955-03.jpg - check access rights to target directory#012Thread is going to finish due to this fatal error:
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [ALL] myfopen: Error opening file /var/lib/motion/01-20161109144955-04.jpg with mode w:
Nov 9 14:49:55 raspberrypi motion: [1] [ERR] [ALL] put_picture: Can't write picture to file /var/lib/motion/01-20161109144955-04.jpg - check access rights to target directory#012Thread is going to finish due to this fatal error:
我知道这与权限有关,但我已经在
/tmp
中创建了运动目录并设置了 chown motion:motion motion
,根据我的理解,这不应给出此类错误。
正如您从粘贴的日志摘录中看到的,文件写入发生在
/var/lib/motion/
目录中。因此,如果您更正该目录的权限,它应该可以工作。或者更改应用程序的设置以写入 /tmp/motion 目录。
请参阅
target_dir
上的运动选项 http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions