bensondaled / pseyepy

PSEye-py: a python interface to the PS3Eye camera
Apache License 2.0
78 stars 26 forks source link

Stream to file leads to WinError 2 Exception #11

Open osskar12 opened 3 years ago

osskar12 commented 3 years ago

Hi, i am trying to capture video on Python using the Ps3eye and pseyepy using this code:

from pseyepy import Camera,Stream
c = Camera()
s = Stream(c, file_name="test_movie.avi")

I got everything to work, using Display(camera) i can see the video, but the saving of the video using Stream results in the following exception:

Exception` in thread Thread-9: Traceback (most recent call last): File "C:\Users\osswa\anaconda3\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\osswa\anaconda3\lib\site-packages\pseyepy\io.py", line 193, in run ff = self.klass(timestamps=True, **mpm) File "C:\Users\osswa\anaconda3\lib\site-packages\pseyepy\io.py", line 96, in init self.proc = sp.Popen(self.cmd, stdin=sp.PIPE, stderr=sp.PIPE) File "C:\Users\osswa\anaconda3\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\osswa\anaconda3\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system can't find the specified file

No video file is created, but a test_movie_time_0.txt file is created in the folder of the python script.

I assume theres something wrong with my FFmpeg, but i cant find the issue. I set the system PATH variable to the FFmpeg\bin folder, and using the basic ffmpeg commands with already existing files works as well.

osskar12 commented 3 years ago

I still couldn´t solve this issue.

Could the reason be line 85 in io.py?

self.cmd =     ['/usr/local/bin/ffmpeg',
....
]

As far as i understand, '/usr/local/bin/ffmpeg' is a path in Linux, but i am using Windows.