-
Notifications
You must be signed in to change notification settings - Fork 309
FFmpeg Performance - Let's GO! #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…jects. About 1.5% less CPU calls, and more even memory allocations (less spikey).
… backwards, with time print-outs.
…2. This increases performance by a factor of 3X.
… FFmpegUtilities.h)
… running unit tests for FFmpegReader)
…e not found" errors when running unit tests.
…t for video scaling. Total improvement of 8-9% when testing h.264 encoding @ 720p.
… thread to a hard #. Also, minor refactor to reduce duplication of capacity.
…nce() method. Also changing FF_THREADS and OMP_THREADS to use # of processors on device.
…iting VIDEO encoders to 16 threads and audio encoders to 2 threads.
…xperiment with caching during export. It works great!
…. This will be called from openshot-qt in Python, to speed up exports.
Member
Author
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1014 +/- ##
===========================================
+ Coverage 57.29% 57.32% +0.03%
===========================================
Files 198 198
Lines 18148 18168 +20
===========================================
+ Hits 10397 10415 +18
- Misses 7751 7753 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to OpenShot/libopenshot-audio#165
Large performance improvements for FFmpegReader (decoding up to 300% faster). This was mostly due to fixing unaligned memory allocations. Improved performance of FFmpegWriter by 9% (utilizing a single SwsContext and reusing it). Improving
VideoCacheThreadso it can be used to further speed up FFmpegWriter (upwards of 30% faster when everything is working together).Threading & caching
FF_NUM_PROCESSORS→VIDEO/AUDIO; cap threads (video = 16, audio = 2)VIDEO_CACHE_MAX_FRAMES; DRY up capacity logicVideoCacheThreadvia SWIG (Python/Ruby/Java)VideoCacheThread&FFmpegWriterintoopenshot-examplefor export caching & Valgrind testsPerformance
SwsContext+ frames (+8–9% H.264 @720p)FFmpegReaderbuffers to 32-byte (AVX2) via cross-platform malloc/free (×3 speed)Settings(no header/Instance duplication; auto-detect CPU threads)Mac & CI fixes
_MSC_VER→_WIN32; use aligned free for QImage/frame buffers on Win32