iizukanao / picam

Audio/video recorder for Raspberry Pi with language agnostic API
GNU Lesser General Public License v2.1
489 stars 78 forks source link

Issue Naming File With Hooks - PiCam Running As Subprocess (Python) #177

Closed HallmanLabs closed 2 years ago

HallmanLabs commented 2 years ago

Hello and thanks for the picam library, for the most part it's doing great for my development.

However, I am having constant issues getting custom filenames set. I have tried to use the exact way it's shown in the documentation (echo -e "dir=/tmp\nfilename=myout.ts" > hooks/start_record) and everytime I run it, I get picam returning a segmentation fault. I tried to run this in console directly while picam is running, then I tried using os.system() calls + subprocess in Python, nothing has worked yet. Do you need to do a combination of touch and echo on that start_record file? I assume you don't, as echo -e will create that file.

For my attempts in Python, I have proper delays in place and I tried using absolute filepaths for everything, didn't help.

I call picam like this, after doing an os.system call to cd into the directory (this all works fine): p=subprocess.Popen(["./picam", "-w 1920", "-h 1080", "-v 2133333", "--alsadev hw:1,0", "--verbose"], shell=True]) Is it normal that alsadev requires it to run as Shell?

I tried to just use "filename=test3.ts" inside start_record, but that failed too. Not sure what is going on, but it's the last thing I need to get going for this development. Anything I add inside of start_record, literally halts picam and it freezes the terminal output (where it repeatedly shows capture info -> 30 fps k= a-v= c-a= u= d= pts=)

PiCam Version: 2.0.4 FFMPEG Version: 4.3.3 Hardware: RPi 4b 8GB OS: Raspbian 32-bit Kernel version: 5.15

Thanks in advance!

iizukanao commented 2 years ago

Sorry for the inconvenience. I have confirmed the bug and will fix it.

iizukanao commented 2 years ago

This issue has been fixed in version 2.0.5. Thank you for reporting the issue!