haaimaging.blogg.se

Ffmpeg python generate mp4 in memory
Ffmpeg python generate mp4 in memory








ffmpeg python generate mp4 in memory

Option 2: Don't use a stdin pipe for process1. Both threads must be okay with being blocked. Option 1: Use threads (or python multiprocessing, gevent, etc) so that one thread is responsible for pumping data into process1, and another thread that's responsible for pumping data out of process1 and into process2. Here are a few options I can think of off the top of my head: This is a common issue when working with blocking pipes, regardless of choice of language. The reason it's a problem in this example but fine in the tensorflow example is that each of the ffmpeg processes in the tensorflow example only uses one pipe, whereas process1 here has both an input and output pipe (and only a single python thread). So then both your python process and process1 are blocked, and no progress is made. However, because nothing is reading from process1's output stream process1 blocks and waits. Process1 reads a bit of data, does some work, then writes to its output stream. Because you're reading and writing individual pipe file descriptors with a single python process, you're encountering a deadlock: The line blocks and waits until process1 is finished reading all the data that's written.










Ffmpeg python generate mp4 in memory