Skip to content

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

@rohith5429

Description

@rohith5429

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}
            />
          )}
        />

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions