Answer the question
In order to leave comments, you need to log in
3d graphics in python, which library to use?
Hello. The task is this, there is a video file. The task is to display a video file on the screen and draw 3d graphics, primitives, such as a rotating cube on top.
Now I do it like this, I read the frame with the help of imread, with the help of opencv and drawline I draw what I need. Display video frame by frame using imshow.
The problem is that opencv uses the CPU to draw lines, and it slows down, I want to use the GPU for drawing and output to free the CPU, which library would you recommend?
Now I'm looking at OpenGL, but maybe there is something simpler? The task seems to be not difficult for me to bother with OpenGL.
Answer the question
In order to leave comments, you need to log in
I would generate 3D primitives on a transparent background in one thing,
and merge with the original video using ffmpeg. On the fly, quite.
You are solving the problem from the wrong end. OpenCV is a very fast library (especially if you use it correctly, avoid unnecessary memory allocations for arrays, etc.). Try to read (decode) the video asynchronously or in a separate thread. For example, you can use FileVideoStream from imutils.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question