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

Issue with video speed being affected by scene framerate #322

Open
KirbysDarkNebula opened this issue Nov 12, 2024 · 3 comments · May be fixed by #350
Open

Issue with video speed being affected by scene framerate #322

KirbysDarkNebula opened this issue Nov 12, 2024 · 3 comments · May be fixed by #350

Comments

@KirbysDarkNebula
Copy link

KirbysDarkNebula commented Nov 12, 2024

As the title describes, videos get sped up or slowed down to accommodate for scene framerate:
If the scene framerate is 60fps and a given video is 30fps the video will play at 2x speed (ONLY the video, the audio maintains its speed)
Likewise if a video is 60fps and the scene framerate is 30fps the video will play at 0.5x speed, while the audio remains normal

Weirdly enough this discordance between audio and video remains when applying time stretching, if you try to "undo" the effects of 2x speed by slowing the video down by 50% (setting stretch to 200) then the video goes back to normal as expected but the audio also gets slowed down to by 50%.

(Edit: I'm using version 1.0.0-beta1)

@KirbysDarkNebula
Copy link
Author

KirbysDarkNebula commented Nov 27, 2024

After checking some more I realised the problem is the way the program handles scene framerates and video framerates.
There is no transcoding or adjusting of any kind for video, it just sets the video frames to timeline frames, so if a video has 30 frames in 1 second, after importing into a 30fps scene it'll be mapped 1:1, but if you import that same video into a 60fps scene it will STILL be mapped 1:1, making the video play faster than it should.

example
600 frames scene @ 30fps, 20 seconds of duration
We add a 10 seconds long video @ 30fps, the video plays normally, each video frame is mapped to a scene frame, 1:1
600 frames scene @ 60fps, 10 seconds of duration
We add a 10 seconds long video @ 30fps, the video plays twice as fast, each video frame is mapped to a scene frame 1:1, instead of maintaining the video frame for 2 scene frames.

I'm currently looking through the code to see where exactly this takes place.

@KirbysDarkNebula
Copy link
Author

Found it, I'll try to submit a fix that takes scene framerate into account when calculating the video framerate later!

@rodlie
Copy link
Member

rodlie commented Nov 27, 2024

That would be awesome 👍

@rodlie rodlie added this to the 1.0.0 milestone Nov 27, 2024
@KirbysDarkNebula KirbysDarkNebula linked a pull request Nov 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants