-
Notifications
You must be signed in to change notification settings - Fork 49
[wip] Update VideoDecoder init #799
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the benchmarks! That's quite interesting. It'd be interesting to use the If that's faster than |
I believe this is it - I updated the PR description with my updated benchmarking script and results. By reducing the JSON size to contain only the necessary information, the performance of Edit: Here's my alternative code for benchmarking the
|
897e15d
to
0d661f5
Compare
This PR enables
custom_frame_mappings
to be used in the Python VideoDecoder.read_custom_frame_mappings()
. This parses a JSON str or JSON file to extractall_frames
,is_key_frame
,duration
.seek_mode
ifcustom_frame_mappings
is passed in to avoid the exact mode scan during initialization.Benchmarking
I wrote a short benchmarking script to test the initialization times of
custom_frame_mappings
versusexact
.custom_frame_mapping
mode was quicker thanexact
mode if theffprobe
command used to generate the frame mapping json used the-show_entries
option to reduce the JSON size.With this optimization the performance improvement increased with longer videos.
Without this optimization, using the full
ffprobe
output,exact
mode was faster.The results on
nasa_13013.mp4
:The results on a generated video,
mandelbrot_1920x1080_120s.mp4
:The benchmarking code: