Repository navigation
视频片段倒放、定格和曲线变速 - #84
Open
devin-ai-integration[bot] wants to merge 10 commits into
Open
devin-ai-integration[bot] wants to merge 10 commits into
devin-ai-integration[bot] wants to merge 10 commits into
Conversation
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Open
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Contributor
Author
There was a problem hiding this comment.
Devin Review found 9 findings. Devin automatically fixed all 9 findings.
Fixed by Devin (9)
- Shortened freeze frames in Jianying — JianYing target duration now uses the timeline length directly; it is only recomputed from the source when the source runs out.
- Trimmed footage in reverse exports — VideoTrack.sourceTime clamps to offsetL so sub-frame samples never reach trimmed footage; unit test added.
- Frozen picture changes after trimming — Trim conversion only snaps to whole frames within 1 ms of rounding error, so freeze clips keep their fractional source frame; unit test added.
- Unreadable projects after custom-curve saves — Curve y values are saved unrounded so tiny valid speeds survive reload.
- Reversed trims remove the wrong end — Reversed clips map timeline left trim to offsetR and right trim to offsetL.
- Freeze frames advance to another image — Freeze clips now span 0.001 source frames so they stay on one decoded image at any fps.
- Shifted footage after reversed-curve splits — Reversed mapping is offsetL + F(end) - F(f+1), independent of average speed; split boundary uses the same forward integral. Unit test covers continuity.
- Trimmed video starts on the previous frame — Trim drags now shift the source offset by the rounded timeline-frame delta times speed, matching the rounded clip edge; a 1x clip keeps whole-frame offsets. Unit test added.
- Full clip extension leaves frames trimmed — Dragging a trim to 0 ms or the full media length now clears that side's offset instead of applying a rounded shift; unit test added.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
叠在 #83 上。视频片段新增倒放、定格、曲线变速,预览、MP4 导出、工程保存、剪映草稿和 MCP 都支持。
时间映射集中到
src/render/speed.ts:时间轴帧到素材帧的换算都经过sourceFrameAt/timelineFrameAt,VideoTrack.sourceTime、关键帧(keyframeFrame)、导出取帧共用。片段长度改用平均速度effectiveSpeed = speed × curveMean(speedCurve),timeline-kit 的裁剪换算、setSpeed、MCP 也一样。sliceCurve切成两段,切开后显示为「自定义」。导出音频按映射逐采样重采样(curvedBuffer),音调随速度变化;预览每帧把playbackRate设为当前速度。freezeFrame)。在播放头处分割片段,中间插入一个只播 1 个素材帧、speed = 1/时长的静音视频片段(默认 3 秒),同轨后面的片段后移。不生成新素材,所以预览、导出、工程保存都直接复用视频片段的逻辑。PackedClip.sc(曲线点列)、rv(倒放)。materials.speeds[].curve_speed.speed_points(mode: 1,y 换算成相对平均速度),倒放没有对应字段,记入skipped。update_clip新增speedCurve(预设名、none或点列)和reversed;新增freeze_frame({ clipId, time, duration })。测试:
speed.test.ts、speedEffects.test.ts单测;MCP e2e 覆盖倒放、曲线、定格、MP4 导出时长、剪映curve_speed、保存刷新后恢复。Link to Devin session: https://app.devin.ai/sessions/a882af08b80c444280600c6cdc988c2e
Open in Devin Desktop: https://app.devin.ai/desktop/session/a882af08b80c444280600c6cdc988c2e?variant=devin
Requested by: @x007xyz
🟢 Devin fixed all 9 findings · Follow Devin's work