Jump to content


Photo

Help needed with permissions

synology permissions real time monitoring

  • Please log in to reply
21 replies to this topic

#1 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 14 September 2019 - 04:58 AM

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

 

 



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 14 September 2019 - 12:28 PM

Hi, yes it would appear that way. Did you check the permissions of all the subfolders and files?



#3 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 14 September 2019 - 01:15 PM

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 by kmed27, 14 September 2019 - 01:17 PM.


#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 14 September 2019 - 10:40 PM

@FrostByte do you have any tips?



#5 FrostByte OFFLINE  

FrostByte

    Advanced Member

  • ForumMod
  • 4548 posts
  • Local time: 02:36 PM
  • LocationThe UP

Posted 14 September 2019 - 11:25 PM

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



#6 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 15 September 2019 - 03:12 AM

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...



#7 FrostByte OFFLINE  

FrostByte

    Advanced Member

  • ForumMod
  • 4548 posts
  • Local time: 02:36 PM
  • LocationThe UP

Posted 15 September 2019 - 07:33 AM

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)



#8 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 15 September 2019 - 08:57 AM

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 :(



#9 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 15 September 2019 - 01:43 PM

@Pain do you have any tips?



#10 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 19 September 2019 - 12:58 AM

@kmed27 did you figure this out?



#11 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 19 September 2019 - 04:15 AM

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 :unsure:


  • FrostByte likes this

#12 FrostByte OFFLINE  

FrostByte

    Advanced Member

  • ForumMod
  • 4548 posts
  • Local time: 02:36 PM
  • LocationThe UP

Posted 19 September 2019 - 07:25 AM

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 :unsure:

 

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.  

 

5d83640466170_perm.png


Edited by FrostByte, 19 September 2019 - 07:31 AM.


#13 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 19 September 2019 - 08:58 AM

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. :(



#14 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 27 September 2019 - 10:51 AM

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).



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 27 September 2019 - 10:58 AM

That's currently not possible.

#16 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 27 September 2019 - 11:32 AM

OK, Thanks



#17 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 28 September 2019 - 12:11 AM

 

 

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.



#18 FrostByte OFFLINE  

FrostByte

    Advanced Member

  • ForumMod
  • 4548 posts
  • Local time: 02:36 PM
  • LocationThe UP

Posted 28 September 2019 - 05:20 AM

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.



#19 kmed27 OFFLINE  

kmed27

    Advanced Member

  • Members
  • 78 posts
  • Local time: 07:36 PM

Posted 28 September 2019 - 05:54 AM

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.


  • FrostByte likes this

#20 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 146626 posts
  • Local time: 02:36 PM

Posted 29 September 2019 - 11:13 AM

Let us know how that goes. Thanks.







Also tagged with one or more of these keywords: synology, permissions, real time monitoring

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users