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

【BUG】拖动一个视频文件到中间位置,剪切会出错 #19

Open
yczkhx-ths opened this issue Mar 8, 2024 · 1 comment
Open
Assignees

Comments

@yczkhx-ths
Copy link

描述
拖动一个视频文件到中间位置,剪切会出错,数据计算有误
因为offset计算的时候直接和剪切点计算的,但是视频不一定是顶格从0开始的;
除此之外,frameCount和time也未更新

image

TrackContro文件中剪切的操作应该修改为

    active.end = splitTime;
    active.offsetR = active.frameCount - active.end + active.start; // offset减去前面的空白量
    active.frameCount -= active.offsetR; // 重新计算frameCount 和time
    active.time = parseInt(`${active.frameCount / baseFps * 1000}`);
    copy.start = splitTime;
    copy.offsetL = splitTime - 1 - active.start;
    copy.frameCount -= copy.offsetL;
    copy.time = parseInt(`${copy.frameCount / baseFps * 1000}`);
    copy.id = getId();
    trackStore.addTrack(copy, trackStore.selectTrackItem.line, false, 0);
@policymakers
Copy link

你好,请问你弄好导出了吗?

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

3 participants