Skip to content
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

Overhaul Timecode APIs #168

Open
LukeM-Github opened this issue May 28, 2020 · 4 comments
Open

Overhaul Timecode APIs #168

LukeM-Github opened this issue May 28, 2020 · 4 comments

Comments

@LukeM-Github
Copy link

I glanced at the code, it seems to be assuming constant frame rate.

@Breakthrough
Copy link
Owner

Breakthrough commented Jun 16, 2020

This is correct.

Adding support for variable frame rate videos will really drive a lot of underlying API changes, which I am willing to do, but will require to rethink how timestamps are stored within PySceneDetect internally to achieve this in an efficient matter. I'll try to come up with a good design,

@Breakthrough Breakthrough changed the title Time stamps are all wrong with variable frame rate video Support for variable frame rate (timestamps are currently wrong with VFR videos) Jul 29, 2020
@Breakthrough Breakthrough added this to the v1.0 milestone Jul 6, 2021
@Breakthrough
Copy link
Owner

I think I have a good initial design, will post here when there are some unit tests showing how timecodes will be stored in v1.0. The idea is to store both a frame number, time in seconds, framerate, and a tag if the framerate is variable or not. Unit tests should make this much more clear, so will post an update here when they are ready in the 1.0 branch.

@Breakthrough Breakthrough removed this from the v1.0 milestone Jul 17, 2023
@Breakthrough
Copy link
Owner

Timecodes as of v0.6 are now obtained directly from the underlying VideoStream (via OpenCV VideoCapture or PyAV), but timecode calculations still assume a constant frame rate. This should improve accuracy for the majority of use cases, but there still remains a significant amount of work to be done for supporting VFR material.

Anyone willing to share samples for testing is encouraged to upload them here to this issue for analysis.

@hokaso
Copy link

hokaso commented Sep 4, 2023

Timecodes as of v0.6 are now obtained directly from the underlying VideoStream (via OpenCV VideoCapture or PyAV), but timecode calculations still assume a constant frame rate. This should improve accuracy for the majority of use cases, but there still remains a significant amount of work to be done for supporting VFR material.

Anyone willing to share samples for testing is encouraged to upload them here to this issue for analysis.

I have a better idea, that is, first transcode the vfr video into a smaller size cfr video, then perform scene detection on the cfr video, and then apply the cfr timeline information to the vfr video. I have tested, is completely no problem.

@Breakthrough Breakthrough changed the title Support for variable frame rate (timestamps are currently wrong with VFR videos) Overhaul Timecode APIs Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants