How do I manage multi rtsp more efficiently? #929
Unanswered
mifenfeifen
asked this question in
1. Help
Replies: 1 comment
-
As far as the actual decoding goes, FFmpeg and PyAV will be similar. I wonder if there is a bunch of overhead serializing the Numpy array for the queue. It might even be serializing the frame, and stream, and etc.. I'm not sure. I vaguely remember there being an ability to decode at lower res, if that would be interesting for you. If this is all you'll be using PyAV for, you can also go back to the ffmpeg cli and have it pipe frames back to you so you dont have the JPEG and disk overhead. Maybe like:
(that is not tested) |
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
I have tens of rtsp video stream to recv and to calc the frames. Now the problem is that recv multi rtsp stream at the time may occupy the most cpu resource.
ffmpeg command-line
I had tried to use subproccess to exec the ffmpeg cmd to do that, the cpu goes to 70% —— I think it make sense. The only problem is that it seems it can only save the image into disk, and I have to read the pic from disk. That's a little bit complex.
pyav
So I use the pyav lib to do the job.
the code snippet is to calc
SO in my code, there are multi
Decode
processes and oneCalc
process.Expected behavior
The code can do the same work same the command-line, and has the similar performance.
Actual behavior
My code using pyav works, but the performance is not well. Ignoring the
Calc
process, the 32Decode
processes drive the cpu 100%.Investigation
Research
I have done the following:
Beta Was this translation helpful? Give feedback.
All reactions