I have a Pi 3 with Stretch on it and I'm trying to get Motion to work correctly. In particular I want it to stream to a browser that I'll be able to access. I was able to successfully get the stream to work once. So it's not an issue with the default local host value in the configuration file.
After I got it working once I tried adding it to the rc.local file so it would restart automatically if there was a power failure. After adding it to the file I decided to test it out and reboot the Pi. Now I can't get it to stream at all or save files based on motion detection.
If I check to see if the service is running it says it is, but there are errors. See below for what it gives.
pi@raspberrypi:~ $ sudo service motion status
motion.service - LSB: Start Motion detection
Loaded: loaded (/etc/init.d/motion; generated; vendor preset: enabled)
Active: active (running) since Mon 2018-06-25 16:22:54 CDT; 2min 42s ago
Docs: man:systemd-sysv-generator(8)
Process: 2573 ExecStop=/etc/init.d/motion stop (code=exited, status=0/SUCCESS)
Process: 2612 ExecStart=/etc/init.d/motion start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/motion.service
└─2622 /usr/bin/motion
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [VID] v4l2_scan_controls: "Red Balance", default 1000, current
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [VID] v4l2_scan_controls: found control 0x0098090f, "Blue Balance", ra
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [VID] v4l2_scan_controls: "Blue Balance", default 1000, curren
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [STR] http_bindsock: listening on 127.0.0.1 port 8081
Jun 25 16:22:55 raspberrypi motion[2622]: [1:ml1] [NTC] [ALL] motion_init: Started motion-stream server on port 8081 (auth Dis
Jun 25 16:23:00 raspberrypi motion[2622]: [1:ml1] [ERR] [ENC] ffmpeg_set_outputfile: Permission denied. ./01-20180625162259.mk
Jun 25 16:23:00 raspberrypi motion[2622]: [1:ml1] [ERR] [ENC] ffmpeg_open: Could not set the stream
Jun 25 16:23:00 raspberrypi motion[2622]: [1:ml1] [ERR] [EVT] event_ffmpeg_newfile: ffopen_open error creating (new) file [./0
Jun 25 16:23:00 raspberrypi motion[2622]: [1:ml1] [NTC] [ALL] motion_detected: Motion detected - starting event 1
My guess is that the line "ffmpeg_set_outputfile: Permission denied. ./01-20180625162259.mk" is tell me the problem, but I can't figure out how to fix it. Thanks in advanced for any ideas any of you might have.