![]() ).Īt this point I am playing with an alternative, which is to replace p. Now, on second thought, that may not be necessary, considering that imageio is already reading from the pipe (see e.g. python-ffmpeg.py This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. ![]() Taking a step back: my reason for using the communicate() to send b'q' was that I wanted to play safe, taking into account the warning from the subprocess docs against using stdin.write with pipes. Looking at the source for communicate(), there is quite a lot going on there, including some additional threading. I haven't seen the issue with some other webcams. Flush stdout and stderr until the process terminates. IFAIK that call does: Send the bytes over stdin, then closes stdin. This seems to occur only with some usb-webcams, such as my laptop's builtin cam. Since you once proposed to use p.communicate(b'q') to terminate the ffmpeg process, I was hoping you might have some ideas :) It looks like that call to communicate() is hanging. In my case I don't see any indefinite blocking, but on occasion the communicate(b'q') call will block for several seconds (up to approx. ![]() However, since that time, I have also encountered blocking issues related to communicate that appear to be random. I have been having some second thoughts about the communicate(b'q') call myself.Īt the time, the communicate(b'q') approach seemed to fix my immediate problem ( imageio/imageio#343), and on my side it does work, in principle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |