[Bug]: frame extraction by timestamp operation can be very slow #44
Labels
Bug 🐞
Something's wrong with Deffcode APIs.
Good Work 🌟
Good Issue/PR for newcomers to learn from.
Priority Normal ⚪
High Priority Issue/PR.
WIP 🏗️
Work in Progress
Projects
Milestone
Description
This recipe demonstrated extracting a single frame by a timestamp via the FFdecoder API.
However, the frame extraction time goes up when the timestamp gets bigger.
The extraction time is so slow such that this API is not usable for my use case. Thus, filing a bug report for an expedited fix.
Looked deeper into the generated ffmpeg command, I found that the generated command is not optimal. A better approach is to use Input Seeking instead of Output Seeking, ref.
Here is an example generated command:
Notice that the
-ss
flag is placed after the input file, i.e.-i video_file_path
.If we place the
-ss
flag before the input file, this operation becomes a lot more faster. E.g.Changing the ordering of the flag should be a quick fix for this issue.
Hoping we could get it fixed soon.
Issue Checklist
Expected behaviour
Extracting a single frame by a timestamp via the FFdecoder API should be fast regardless of the timestamp.
Actual behaviour
The extraction time is so slow such that this API is not usable for my use case.
Steps to reproduce
Terminal log output
Python Code(Optional)
No response
DeFFcode Version
0.2.5
Python version
3.11
Operating System version
macOS M1 ( Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64)
Any other Relevant Information?
No response
The text was updated successfully, but these errors were encountered: