Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rec dir not found if picam not executed out of picam dir #165

Open
MittaAxt opened this issue Sep 30, 2021 · 2 comments
Open

rec dir not found if picam not executed out of picam dir #165

MittaAxt opened this issue Sep 30, 2021 · 2 comments

Comments

@MittaAxt
Copy link

MittaAxt commented Sep 30, 2021

Hi all

I have setup the picam as described and was able to run it on top of the node-rtsp server, so I get the image, I get the sound, all fine.
As soon as I tried to record via touch in the hook folder no file was recorded.
It turned out that I had to specify the statedir and the hookdir, as I run picam from a different folder than picam, but as there is no recdir paramenter I could specify I always have to switch to the dir of the binary before executing it.

my previous used command from my home dir:
admin@rasperry:~ $ /home/admin/picam/picam --rtspout --alsadev hw:2,0

If executed that way, it fails due to missing statedir and recording doesnt start even if I add the --statedir parameter
running
admin@rasperry:~/picam $ ./picam --rtspout --alsadev hw:2,0
works fine

unfortunately this means that I can't run the picam binary from a script, as long as the script is not located within the picam folder.

suggestion would be to add a recdir parameter, as statedir and hooksdir is already there and it works with these parameters, even if the binary is not executed from the picam folder.

@iizukanao
Copy link
Owner

Can you first cd then run ./picam in your script?

cd /home/admin/picam && ./picam --rtspout --alsadev hw:2,0

@MittaAxt
Copy link
Author

MittaAxt commented Oct 18, 2021

had to do it now that way thx for the hint. maybe you can help me also with another topic for the recording part

I'm using
echo -e "dir=/home/user/picam/rec/archive/$(date +%Y-%m-%d)\nfilename=$(date +%Y-%m-%d-%H_%M_%S).ts" > /home/user/picam/hooks/start_record'
at the moment. As you can see I'm currently recording the file directly to the archive.
Reason behind this was that the archive folder is a network drive.
I tried to just set the filename to the filename you see above, but in this case the file was not moved to the archive folder after the recording was done. I assumed that has sth to do with the custom filename and decided to record the file directly to the network drive, but it seems that this might impact the recording quality, as I have a lot of tearing and low fps in th recorded videos, which was not the case while testing it.
It might also come from the --ex and --wb values I've set, but in order to test this I would like to know if it is possible to set a recording dir and an archive dir in the start_record file or what have to be done to move the final recorded file to the archive, if I write the file to shm previously (except using cron to check for files and move them over to archive :D)

BTW great job on picam and the node-rtsp server, thanks to you i'm finally able to setup my cams with sound recording on motion :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants