You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to run PyAV container encoding on multiple CPU's
Expected behavior
by adding flags:
self.stream.thread_count = 4
self.stream.thread_type = 3
Its should work on 4 thread but i don't see that is working as performance not improved at all
Actual behavior
Encoding should start working on multicore passed by self.stream.thread_count = 4 and self.stream.thread_type = 3 arguments.
Research
I have done the following:
Inside _init():
self.container = av.open(path, mode="w")
self.stream = self.container.add_stream("h264", rate=round(frame_rate))
self.stream.pix_fmt = "yuv420p"
self.stream.thread_count = 4
self.stream.thread_type = 3
self.stream.bit_rate = bit_rate
Adding data to container:
#type of src is numpy array
frame = av.VideoFrame.from_ndarray(src, format="rgba")
self.container.mux(self.stream.encode(frame))
Additional context
I am writing the webm video form numpy array data and its working fine but its too slow, therefor exploring the multi core option
Activity