I am using a camera on my Linux-based computer. I want to store the camera feed directly into my Synology Network attached storage (NAS) which I am accessing through SSH over an ethernet cable. I am able to copy previously captured videos through scp but I want to directly store the feed on Synology NAS. I have tried multiple ways available on internet like:
ffmpeg -f v4l2 -framerate 90 -i /dev/video0 - | sshpass -p passw -P 223 [email protected] 'cat>/volume1/dir1/dir2/'
and
sshpass -p passw -P 223 [email protected] 'cat>/volume1/dir1/dir2/' < < (ffmpeg ffmpeg -f v4l2 -framerate 90 -i /dev/video0 - )
In the first command it starts recording but error comes as SSHPASS: FAILED TO RUN COMMAND : no such file or directory.
My ffmpeg code runs well while recording locally, my only problem is to directly save it to NAS(Machine B) over ssh and NOT intermediately store it on machine A. IDK if its possible or not. DOes any of you guys have done this before. if so please help. Thankyou in advance.
cat>/volume1/dir1/dir2/
will never work because the trailing slash in/volume1/dir1/dir2/
indicates this has to resolve to a file of the type directory. You cannot redirect a stream of bytes to a directory itself.