Page 1 of 1

Failed to open video device /dev/video0: Permission deniedFailed to open video device /dev/video0: Permission denied

Posted: Sat Sep 10, 2016 4:24 am
by wangkai241
Failed to open video device /dev/video0: Permission denied
my system is ubuntu16.04 dasktop,
The log is as follows
2016-09-10 12:21:22.740040 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:21:22.571620 zmc_dvideo0 13136 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:21:22.512676 zmc_dvideo0 13136 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:21:22.417063 zmc_dvideo0 13136 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:21:22.361846 zmc_dvideo0 13136 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:21:22.307227 zmc_dvideo0 13136 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:21:22.258174 undef 13136 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:21:22.111140 zmdc 13136 INF 'zmc -d /dev/video0' started at 16/09/10 12:21:22 zmdc.pl
2016-09-10 12:21:22.110060 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:21:22, pid = 13136 zmdc.pl
2016-09-10 12:21:22.045730 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:18:42.639340 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:18:42.592337 zmc_dvideo0 13128 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:18:42.543884 zmc_dvideo0 13128 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:18:42.448503 zmc_dvideo0 13128 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:18:42.404315 zmc_dvideo0 13128 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:18:42.361129 zmc_dvideo0 13128 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:18:42.304181 undef 13128 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:18:42.163660 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:18:42, pid = 13128 zmdc.pl
2016-09-10 12:18:42.163660 zmdc 13128 INF 'zmc -d /dev/video0' started at 16/09/10 12:18:42 zmdc.pl
2016-09-10 12:18:42.101680 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:17:22.733800 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:17:22.675773 zmc_dvideo0 13117 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:17:22.621627 zmc_dvideo0 13117 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:17:22.454814 zmc_dvideo0 13117 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:17:22.399581 zmc_dvideo0 13117 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:17:22.345710 zmc_dvideo0 13117 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:17:22.285986 undef 13117 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:17:22.103410 zmdc 13117 INF 'zmc -d /dev/video0' started at 16/09/10 12:17:22 zmdc.pl
2016-09-10 12:17:22.103400 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:17:22, pid = 13117 zmdc.pl
2016-09-10 12:17:22.054470 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:16:42.647140 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:16:42.478666 zmc_dvideo0 13111 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:16:42.419692 zmc_dvideo0 13111 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:16:42.357238 zmc_dvideo0 13111 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:16:42.302434 zmc_dvideo0 13111 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:16:42.248163 zmc_dvideo0 13111 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:16:42.168942 undef 13111 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:42.083390 zmdc 13111 INF 'zmc -d /dev/video0' started at 16/09/10 12:16:42 zmdc.pl
2016-09-10 12:16:42.083180 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:16:42, pid = 13111 zmdc.pl
2016-09-10 12:16:42.017070 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:16:22.646876 web_php 13063 WAR Unable to determine path for arp command, type -p arp returned '127' output is: -p: not found arp is /usr/sbin/arp /usr/share/zoneminder/www/skins/classic/views/monitorprobe.php 300
2016-09-10 12:16:22.512789 undef 13105 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:22.487640 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:16:22.429633 zmc_dvideo0 13103 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:16:22.370580 zmc_dvideo0 13103 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:16:22.308074 zmc_dvideo0 13103 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:16:22.263822 zmc_dvideo0 13103 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:16:22.221008 zmc_dvideo0 13103 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:16:22.174655 undef 13103 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:22.056970 zmdc 13103 INF 'zmc -d /dev/video0' started at 16/09/10 12:16:22 zmdc.pl
2016-09-10 12:16:22.056070 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:16:22, pid = 13103 zmdc.pl
2016-09-10 12:16:22.012090 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:16:12.643990 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:16:12.585681 zmc_dvideo0 13102 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:16:12.526818 zmc_dvideo0 13102 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:16:12.464121 zmc_dvideo0 13102 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:16:12.408864 zmc_dvideo0 13102 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:16:12.281503 zmc_dvideo0 13102 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:16:12.200705 undef 13102 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:12.112060 zmdc 13102 INF 'zmc -d /dev/video0' started at 16/09/10 12:16:12 zmdc.pl
2016-09-10 12:16:12.111510 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:16:12, pid = 13102 zmdc.pl
2016-09-10 12:16:12.055460 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:16:07.766660 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:16:07.660725 zmc_dvideo0 13096 FAT Failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 684
2016-09-10 12:16:07.603928 zmc_dvideo0 13096 INF Starting Capture version 1.29.0 zmc.cpp 250
2016-09-10 12:16:07.539175 zmc_dvideo0 13096 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:16:07.483981 zmc_dvideo0 13096 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:16:07.430548 zmc_dvideo0 13096 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:16:07.377297 undef 13096 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:07.067040 zmdc 13096 INF 'zmc -d /dev/video0' started at 16/09/10 12:16:07 zmdc.pl
2016-09-10 12:16:07.067040 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:16:07, pid = 13096 zmdc.pl
2016-09-10 12:16:07.020560 zmdc 12985 INF Starting pending process, zmc -d /dev/video0 zmdc.pl
2016-09-10 12:16:06.973100 zmdc 12985 ERR 'zmc -d /dev/video0' exited abnormally, exit status 255 zmdc.pl
2016-09-10 12:16:06.744765 zmc_dvideo0 13081 INF No direct match for the selected palette ( zm_local_camera.cpp 412
2016-09-10 12:16:06.689563 zmc_dvideo0 13081 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 347
2016-09-10 12:16:06.579421 zmc_dvideo0 13081 ERR Automatic format selection failed to open video device /dev/video0: Permission denied zm_local_camera.cpp 1142
2016-09-10 12:16:06.519091 undef 13081 INF No Server ID or Name specified in config. Not using Multi-Server Mode. zm_config.cpp 139
2016-09-10 12:16:06.165610 zmdc 12985 WAR Can't find process with command of 'zma -m 1' zmdc.pl
2016-09-10 12:16:05.740550 zmdc 12985 INF 'zmc -d /dev/video0' starting at 16/09/10 12:16:05, pid = 13081 zmdc.pl
2016-09-10 12:16:05.739260 zmdc 13081 INF 'zmc -d /dev/video0' started at 16/09/10 12:16:05 zmdc.pl
2016-09-10 12:16:05.517980 zmdc 12985 WAR Can't find process with command of 'zmc -d /dev/video0' zmdc.pl
2016-09-10 12:16:05.302090 zmdc 12985 WAR Can't find process with command of 'zma -m 1' zmdc.pl
2016-09-10 12:12:40.109730 zmwatch 13020 INF Watchdog pausing for 30 seconds zmwatch.pl
2016-09-10 12:12:40.058780 zmwatch 13020 INF Watchdog starting zmwatch.pl
2016-09-10 12:12:39.876540 zmfilter 13010 INF Scanning for events zmfilter.pl
2016-09-10 12:12:39.856570 zmdc 13020 INF 'zmwatch.pl' started at 16/09/10 12:12:39 zmdc.pl
2016-09-10 12:12:39.856550 zmdc 12985 INF 'zmwatch.pl' starting at 16/09/10 12:12:39, pid = 13020 zmdc.pl
2016-09-10 12:12:39.544500 zmdc 13015 INF 'zmaudit.pl -c' started at 16/09/10 12:12:39 zmdc.pl
2016-09-10 12:12:39.544490 zmdc 12985 INF 'zmaudit.pl -c' starting at 16/09/10 12:12:39, pid = 13015 zmdc.pl
2016-09-10 12:12:39.272220 zmdc 13010 INF 'zmfilter.pl' started at 16/09/10 12:12:39 zmdc.pl
2016-09-10 12:12:39.272210 zmdc 12985 INF 'zmfilter.pl' starting at 16/09/10 12:12:39, pid = 13010 zmdc.pl
2016-09-10 12:12:39.051250 zmpkg 12967 INF Starting up services zmpkg.pl
2016-09-10 12:12:36.044950 zmdc 12985 INF Server starting at 16/09/10 12:12:36 zmdc.pl
2016-09-10 12:12:35.322820 zmpkg 12967 INF Command: start zmpkg.pl
2016-09-10 12:12:35.255680 zmpkg 12967 INF Sanity checking States table... zmpkg.pl

Re: Failed to open video device /dev/video0: Permission deniedFailed to open video device /dev/video0: Permission denied

Posted: Sat Sep 10, 2016 4:38 am
by dmroeder
Not sure if it's best practice bit I gave video0 full permission.

sudo chmod 777 /dev/video0

Re: Failed to open video device /dev/video0: Permission deniedFailed to open video device /dev/video0: Permission denied

Posted: Sat Sep 10, 2016 1:28 pm
by knight-of-ni
Setting the permissions on the device directly is not permanent. That will only work until the machine is rebooted.

Instead, find what group the device is a part of:

Code: Select all

ls -l /dev/video0
Then add the webserver user account to that group. You may have to reboot in order for the group to take affect.

If you installed ZoneMinder from a package, then you might consider contacting the package maintainer to have this done for you in the packing script.