Is Hardware-Accelerated Video Decoding Better for CPU and Memory Efficiency? #1869
Unanswered
vutung1671997
asked this question in
1. Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🧠 Context
I’m building a real-time RTSP video streaming application using PyAV and evaluating the performance of software decoding vs. hardware-accelerated decoding, specifically looking at CPU and RAM usage per Full HD stream.
Software Decoder (Direct Stream Setup)
✅ All flags and parameters take effect as expected.
⚠️ CPU usage is moderate due to software decoding.
✅ RAM usage is low, around 80 MB per Full HD RTSP stream.
**Hardware Decoder (Custom Context Setup)
❌ RAM usage is much higher, around 200–300 MB per Full HD RTSP stream.
✅ CPU usage is lower thanks to hardware acceleration.
Method | CPU Usage | RAM Usage (Per Stream) | Flags Effective
Software Decoder (Direct) | Moderate | ~80 MB | ✅ Yes
Hardware Decoder (Custom) | Low | ~200–300 MB | ❌ No
🤔 Questions
Why are the decoding flags (e.g., thread_type, skip_frame, flags2, flags) ignored or ineffective when using a manually created hardware decoder context?
Is there a proper way to apply these parameters for hardware-accelerated codecs in PyAV?
Is the increased memory usage a known limitation of hardware decoding, or is there a workaround to reduce the footprint?
Let me know if you'd like to add a section for hardware specs or attach profiling logs as well!
📦 Current Setup
PyAV Version: 14.3.0 (or your current version)
Python Version: 3.12.0 (specify the Python version you are using)
🖥 Hardware Specifications
CPU: Intel Core i5-13500
GPU: NVidia T1000 8GB
RAM: 32 GB
OS: Windows 11
Hardware Acceleration: cuda
Beta Was this translation helpful? Give feedback.
All reactions