Repository navigation
recorder: 新增「BGM 跟随视频剪辑」选项(剪辑策略四条的现状核对) - #4
Open
std-external wants to merge 1 commit into
Open
std-external wants to merge 1 commit into
std-external wants to merge 1 commit into
Conversation
…ng clip switches The recorder already exposes the pause-screen and failed-attempt switches; the BGM cursor was only pinned to source time for rhythm-sensitive rooms. This adds an opt-in setting that pins every room's clips to the video, and a policy regression test for it (plus a stub so the recorder harness still compiles).
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.
来源:群里(Celeste Coders)对录像「剪辑策略」提的四条需求。先核对了现有实现,再补上确实缺的那条。
现有实现核对(四条里两条仓库本来就有,一条只对节奏敏感房间生效)
保留暂停画面,默认关 = 暂停期间不录(现状不变),开启后暂停画面进片Source/QolSettings.cs:331、Source/AutoRecorder.cs:218、:258、UISource/QolSettingsOverlay.cs:1698保留死亡前的失败尝试,默认关 = 死亡那一段照旧切掉;开启后死亡/复活留在片里不被切Source/QolSettings.cs:334、Source/AutoRecorder.cs:373、:433、UISource/QolSettingsOverlay.cs:1699Source/AutoRecorder.cs:972、Source/RecordingTimeline.cs:10、Source/MusicEventReplayRenderer.cs:74本次改动
新增设置
RecordingBgmFollowsVideo(Source/QolSettings.cs:341;UI 在Source/QolSettingsOverlay.cs:1705,画质声音页):RhythmMapDetector.IsRhythmSensitive),其余房间由重建 BGM 跨剪切点连续播放。BgmFollowsVideo,即 BGM 读取真实源时间、跟着画面一起被剪(bgm_follows_video这条链路本来就通,这里只是把「谁来决定」交给用户)。BGM 拼接 = 自动对齐与拼接时显示(Source/QolSettingsOverlay.cs:1683的BgmRebuildOnly):跟随游戏现场模式本来就是随视频裁切,这个开关没有意义。BeginRun(Source/AutoRecorder.cs:529)里同步初始化,避免首个房间快照之前创建的片段漏掉这个标记。没做的一条:SL 过场
load 后到玩家按第一个键前的冻结段目前会作为「开头冻结帧」留在新分支的开头(ManualSlPresented在第一个干净呈现帧就重开分支,Source/AutoRecorder.cs:626-648;这段静止时间 >50ms 会让内容时钟重新锚定,于是成片里就是一帧挂住)。没做它的原因:StIntroRespawn只覆盖 0.6s 的复活表演,SRT 读档后的静止并不走那个状态),可用的实现是在ManualSlPresented里加输入门闩:没输入就不重开分支。这样改会让manualSlSuspended一直挂着——玩家如果一直不碰键,录像就停在那儿不恢复,需要真实游戏 + SRT 才能验证这个边界。剪辑冻结帧(RecordingRemoveFreezeFrames)已经能把这段剪掉,只是它同时会剪掉别的冻结帧。所以先把「要一个专门的输入门闩」记在这里,等确认 SRT 读档后的实际时序(尤其读档完成 → 第一次按键之间到底有没有游戏更新)再单独提。如果希望现在就按「有输入才重开分支 + 超时兜底」写,我可以在这个 PR 里补。
行为边界(补:渐进式 BGM 与剪辑方向)
Audio.SetMusicParam:progress/fade/escape/end/calm/boss_pitch),换曲才是MusicTrigger/AltMusicTrigger。日志把换曲、start/stop/pause/seek 与每次参数变化都记下来(Source/MusicCapture.cs:25-32、:129-135),导出时逐 clip 重放:保留段内的变层点按源时刻重放(MusicEventReplayRenderer.cs:86-90、:150);clip 起点的初始状态取该源时间的最后一条 row(:77、:91-119)——落在被剪掉区间里的变层会在拼接点直接跳到当时状态,不做 ramp、不做层间淡入淡出。Source/AutoRecorder.cs:844-857),边界时刻来自事件当时的采集时钟,即从每段起点往后量;唯一从后往前的是死亡回放的尾巴缓冲(CaptureRecentClips逆序 +RetainTail,AutoRecorder.cs:899-911、Source/RecordingTimeline.cs:13-20)。RecordingBgmFollowsVideo不决定方向,只决定forceSync(MusicEventReplayRenderer.cs:74)。Σ clip.DurationSeconds(MusicEventReplayRenderer.cs:20):比片尾长的音乐被截断、不补静音、不拉伸;源 PCM 丢块按时间戳留缺口(docs/capture-architecture.md:120)。所有边界以采集时钟为准,缺帧映射时退化到量化后的TimeAt(Source/NativeRoomRecording.cs:64-75)。docs/capture-architecture.md:221-223)。这些行为是哪来的(免得算到本 PR 头上)
6cefe74initAutoRecorder.cs、RecordingTimeline.cs自仓库 init 即在)e9717ca71c77feforceSync、ApplyInitial、parameter行重放(变层点按源时刻重放是这里就有的)1489942(本 PR)RecordingBgmFollowsVideo(默认 false)+ UI 一行 + 测试,未改MusicEventReplayRenderer.cs验证
CELESTE_ROOT=<everest/lib-stripped> dotnet build Source/MicroblocksQolUtils.csproj -c Release:成功,0 warning。dotnet run --project Tests/Recorder/Recorder.csproj -- <tmpdir>:162 checks 全绿(本地按已知的 harness 缺口补齐Tests/Recorder/Stubs.cs的 stub 后才能编过,这部分只留在本地工作区、不在本 PR 里;本 PR 对Stubs.cs只加了新设置字段那一行)。Tests/Recording.Policy新增 8 项检查(强制开启后普通/节奏房间都跟随、清掉开关后回到按房间判断),编译通过;本机无法运行:只有lib-stripped(IL 被剥)和 Everest 打过补丁的Celeste.dll,AreaKey.get_SID()会抛InvalidProgramException——master 上同样如此,不是本次改动引入的。Source/AutoRecorder.cs、Source/QolSettings.cs、Source/QolSettingsOverlay.cs、Tests/Recorder/Stubs.cs、Tests/Recording.Policy/Program.cs)。