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

need help in Rendering the timeline based on the FPS of the video #65

Open
rohith5429 opened this issue Feb 20, 2025 · 0 comments
Open

Comments

@rohith5429
Copy link

how do i calculate the timeline based on the FPS instead of the time,

const CustomScale = ({ scale, fps, currentFrame }) => {
  const seconds = Math.floor(scale / fps);
  const frames = Math.floor(scale % fps);

  const formattedTime = `${frames.toString().padStart(2, '0')}`;

  return <div>{formattedTime}</div>;
};
        <Timeline
          scale={1}
          scaleWidth={160}
          startLeft={startLeft}
          editorData={timelineData}
          effects={mockEffect}
          hideCursor={false}
          autoScroll={true}
          ref={timelineStateRef}
          style={{ width: `${videoState.duration * 24 * scaleWidth}px` }}
          maxScaleCount={totalFrames}
          getScaleRender={(scale) => (
            <CustomScale 
              scale={scale} 
              fps={24}
              currentFrame={currentFrame}
            />
          )}
        />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant