kmed27 14 Posted September 14, 2019 Share Posted September 14, 2019 Hi I am trying to get Emby to add my cameras videos automatically but seem to be struggling with permissions. I have created a folder on my nas for my cctv camera and it creates the mp4 files in it via NFS. I have ended up giving full permission to everything and everyone in the synology folder but I keep getting xxxxxx.mp4: Permission denied I have given Embysvr custom permissions with everything ticked take ownership, change permissions etc. I have tried setting the NFS to map users to admin and then tried map to guest. It appears that ffmpeg/ffprobe still don't have permissions? 2019-09-14 09:28:51.145 Info App: [LinuxMount] Checking we can attempt to mount [/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4], Extension = [.mp4], Operating System = [Linux], Executables Available = [True]. 2019-09-14 09:28:51.145 Info App: [LinuxMount] Checking we can attempt to mount [/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4], Extension = [.mp4], Operating System = [Linux], Executables Available = [True]. 2019-09-14 09:28:51.145 Info MediaEncoder: ProcessRun 'extract-image' Execute: /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ss 00:00:10.000 -i file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/packages/EmbyServer/target/var/cache/temp/a686c478-2973-4adb-8692-0a65dd9bd0c9.jpg" 2019-09-14 09:28:51.181 Info MediaEncoder: ProcessRun 'extract-image' Started. 2019-09-14 09:28:51.198 Info MediaEncoder: ProcessRun 'extract-image' Process exited with code 1 2019-09-14 09:28:51.682 Error MediaEncoder: ffmpeg image extraction failed for file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" (output file not found) 2019-09-14 09:28:51.682 Error MediaEncoder: Thumbnail-Filter extraction failed, will attempt standard way. Input: file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" 2019-09-14 09:28:51.682 Info MediaEncoder: ProcessRun 'extract-image' Execute: /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ss 00:00:10.000 -i file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2" -f image2 "/var/packages/EmbyServer/target/var/cache/temp/37c5be2c-b402-41cb-8934-22bc45bf83ae.jpg" 2019-09-14 09:28:51.718 Info MediaEncoder: ProcessRun 'extract-image' Started. 2019-09-14 09:28:51.734 Info MediaEncoder: ProcessRun 'extract-image' Process exited with code 1 2019-09-14 09:28:52.218 Error MediaEncoder: ffmpeg image extraction failed for file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" (output file not found) 2019-09-14 09:28:52.221 Error App: Error in Screen Grabber *** Error Report *** Version: 4.2.1.0 Command line: /volume1/@appstore/EmbyServer/releases/4.2.1.0/EmbyServer.dll -package synology -programdata /var/packages/EmbyServer/target/var -ffmpeg /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/ffmpeg/bin/ffprobe -ffdetect /var/packages/EmbyServer/target/ffmpeg/bin/ffdetect -restartexitcode 121 Operating system: Unix 4.4.59.0 64-Bit OS: True 64-Bit Process: True User Interactive: True Runtime: file:///volume1/@appstore/EmbyServer/3rdparty/netcore/2.2.1/runtime/System.Private.CoreLib.dll Processor count: 4 Program data path: /var/packages/EmbyServer/target/var Application directory: /volume1/@appstore/EmbyServer/releases/4.2.1.0 System.Exception: System.Exception: ffmpeg image extraction failed for file:"/volume1/general/Camera/EF00000000018190/motion/20190914/084129-av-1.mp4" (output file not found) at Emby.Server.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(ReadOnlyMemory`1 inputPath, ReadOnlyMemory`1 container, MediaStream videoStream, Nullable`1 streamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useThumbNailFilter, CancellationToken cancellationToken) at Emby.Server.MediaEncoding.Encoder.MediaEncoder.ExtractImage(ReadOnlyMemory`1 inputPath, ReadOnlyMemory`1 container, MediaStream videoStream, Nullable`1 streamIndex, MediaProtocol protocol, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, CancellationToken cancellationToken) at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken) Source: Emby.Server.MediaEncoding TargetSite: Void MoveNext() I can type the ffprobe/ffmpeg from a dos prompt in windows and it works. The only way I can get it to work in emby server is by selecting the folder in synology and RE-applying the permissions to subfolders. After that I can do a re-scan in emby and it adds the file and thumbnail. I have been messing about with permissions etc for days now but not getting anywhere. Can anyone help or give advice on what else to try please. Thanks Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 14, 2019 Share Posted September 14, 2019 Hi, yes it would appear that way. Did you check the permissions of all the subfolders and files? Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 14, 2019 Author Share Posted September 14, 2019 (edited) Hi Luke, Yes, It appears that when the camera creates the daily folder and the files via NFS they only have one user ADMIN or GUEST depending on whether I select "map to admin/guest" in the nfs settings. The parent folders have full permission for everyone at the moment. I am not sure how to get it to create with other permissions. (p.s. thanks for the Tizen update with play next) Edited September 14, 2019 by kmed27 Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 15, 2019 Share Posted September 15, 2019 @@FrostByte do you have any tips? Link to comment Share on other sites More sharing options...
FrostByte 5049 Posted September 15, 2019 Share Posted September 15, 2019 I'm using Synology Surveillance Center which creates my mp4 files and places them in its own folder. I didn't do a whole lot of permissions setting and I don't have NFS service enabled either. When I set up SC I just let it create its shared folder using the default name and location, then I gave 'embysvr' read/write permissions to the shared folder and added the shared folder as library to Emby. I've set real-time monitoring of the 'surveillance' folder by Emby and my videos automatically just show up in Emby so my wife can watch her chickens, sheep, etc on our Samsung TV Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 15, 2019 Author Share Posted September 15, 2019 I tried Synology Surveillance Center but after a lot of testing, I found that it's motion detection is pretty awful, the cameras own detection is excellent which is why I changed to to use it and NFS to store them. DS Cam was good but hardly any videos were showing up, if I increased the sensitivty it just detected cloud movement but not a person unless they were close. For some reason it wouldn't work when I set detection to use camera. So I started checking out the cameras own detection which seems pretty perfect it picks up all movements but doesn't report changes when cloud or sun suddenly change. So as everything was working great, it was storing and notifying me that it had recorded motion, I just needed a way to view them when away from home. I then thought it would be great to use Emby, as I thought it would be an easy way to access the videos from my phone. BUT I then hit the permissions problem... Link to comment Share on other sites More sharing options...
FrostByte 5049 Posted September 15, 2019 Share Posted September 15, 2019 Okay, ya I have SC set to use the cameras algorithm and "Keep original camera settings". It appears to be working for me. I get a lot of activity during the day with the barn animals no cloud movements, etc. Not much at night though luckily with no predators unless my dogs are outside and then it will track them. Plan is to set another one up in the front of the house to do what you're doing and look for visitors. Hopefully I'll have better luck than you Sorry, not much help with NFS (never used it) Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 15, 2019 Author Share Posted September 15, 2019 Thanks, It looks like it the camera is causing the problem as I noticed it is storing the mp4 as -r-x-----T so I am not sure how to get around it Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 15, 2019 Share Posted September 15, 2019 @@Pain do you have any tips? Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 19, 2019 Share Posted September 19, 2019 @@kmed27 did you figure this out? Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 19, 2019 Author Share Posted September 19, 2019 Not yet, I have emailed the camera manufacturer to see if they will modify the firmware to create the files with full permissions, fingers crossed 1 Link to comment Share on other sites More sharing options...
FrostByte 5049 Posted September 19, 2019 Share Posted September 19, 2019 (edited) Not yet, I have emailed the camera manufacturer to see if they will modify the firmware to create the files with full permissions, fingers crossed Are you able to do something like this and set inherit permissions of the parent folder and applying to all files, folders, etc? All new files should be created with the same permissions then. Edited September 19, 2019 by FrostByte Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 19, 2019 Author Share Posted September 19, 2019 Are you able to do something like this and set inherit permissions of the parent folder and applying to all files, folders, etc? All new files should be created with the same permissions then. Hi, thanks Yes I have set them and when I apply them it modifies all the files created to get the permissions but it doesn't seem to apply automatically to new files created. So, I have to re-apply it on a regular basis to get the permissions and then manualy run rescan in emby to pick them up. I have literally given god permissions to folder for absolutely everything and everyone but still no luck. I also tried running setfacl from ssh but it doesn't recognise the command! so unable to do that either. Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 27, 2019 Author Share Posted September 27, 2019 I have created a sheduled task/script to re-apply the acl permissions to the folders every hour but I currently have to wait until the next day after the scheduled emby "scan all media libraries" to see them. The "real time monitoring" doesn't pick them up though, presumably because the permissions are changed later?, I assume it only triggers on file creation? @@Luke is there anyway for me to add a scheduled scan of this library? (not scan all media libraries). Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 27, 2019 Share Posted September 27, 2019 That's currently not possible. Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 27, 2019 Author Share Posted September 27, 2019 OK, Thanks Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 28, 2019 Share Posted September 28, 2019 The "real time monitoring" doesn't pick them up though, presumably because the permissions are changed later?, I assume it only triggers on file creation? It triggers on a few things, but if a file suddenly becomes visible due to changing permissions, I'm not sure that will trigger it. Link to comment Share on other sites More sharing options...
FrostByte 5049 Posted September 28, 2019 Share Posted September 28, 2019 You shouldn't really have to do all this, but what if your script also moved the file after changing permissions? The camera would create the file in one folder, then your script would change the acl and move it into a folder which Emby monitors in real time. At least a temporary fix until something better comes up. Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 28, 2019 Author Share Posted September 28, 2019 Thanks FrostByte, I couldn't think to start with how I would know which files/folders have been added or altered. Then I thought, if I create a new folder for Emby to use, apply the acls to the old folder then just move everything from the old folder to the new one. I then won't need to know which have been changed. I'll give it a try anyway, see what happens. 1 Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 29, 2019 Share Posted September 29, 2019 Let us know how that goes. Thanks. Link to comment Share on other sites More sharing options...
kmed27 14 Posted September 30, 2019 Author Share Posted September 30, 2019 I have managed to write a small script (which grew ) It first checks for any new videos added and emails the count to me as "Motion Detected nn". It then changes the permissions on all the files. And finally moves them from the Camera folder to my new Emby folder, where Emby now picks them up :D. I struggled at first with the move as I had forgot that 'mv' will not merge files/folders but everything (touch wood!!) seems to be working fine now. Thanks for all the suggestions. 1 Link to comment Share on other sites More sharing options...
Luke 37060 Posted September 30, 2019 Share Posted September 30, 2019 Thanks for the feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now