How to run encoding using multiple cores? #1015
Unanswered
kundanshrivastava
asked this question in
1. Help
Replies: 3 comments
-
@mikeboers @jlaine @markreidvfx Guys will you please help me here, thanks in Advance |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Any progress on this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
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
Beta Was this translation helpful? Give feedback.
All reactions