1

I am trying to record my motion videos inside the directory /media/pi/camera. This directory has the following permissions:

drwxrwxr-x 2 motion motion 4096 Aug 9 20:04 camera

I set the same permissions as my previous directory for motion videos had (/var/lib/motion).

I configured target_dir inside /etc/motion/motion.conf as: target_dir /media/pi/camera (I am literally copying and pasting here).

Finally, I run sudo service motion start like before, and I am keep getting the following error:

[1] [ERR] [ENC] [Aug 09 20:38:56] ffmpeg_open: url_fopen - error opening file /media/pi/camera/01-20170809203856.avi ... check access rights to target directory: [1] [ERR] [EVT] [Aug 09 20:38:56] event_ffmpeg_newfile: ffopen_open error creating (new) file [/media/pi/camera/01-20170809203856.avi]:

I also tried to run sudo /etc/init.d/motion start but it did not help.

However, if I run sudo motion then it works (it records a few seconds and saves a video normally inside /media/pi/camera.

My best guess was that sudo service motion start starts motion as another user. But even then, I gave 777 permissions to the folder and it still doesn't want to save videos there. I use motion Version 3.2.12+git20140228.

Has anybody got any clue what I am doing wrong, or is that a problem with motion?

chao
  • 111
  • 3

0 Answers0