@milkstraw/traceframe 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/render.mjs +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milkstraw/traceframe",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Record scripted browser flows and render smooth cursor overlays into video.",
5
5
  "keywords": [
6
6
  "playwright",
package/src/render.mjs CHANGED
@@ -87,7 +87,8 @@ export function buildFilterScript({ trace, scale, audio }) {
87
87
  const trim = number(Math.max(0, -audio.offset))
88
88
  const delay = number(Math.max(0, audio.offset) * 1000)
89
89
  // Reset the selected stream before trimming: its first sample may start after the container's video.
90
- filters.push(`[${input}:a:0]asetpts=PTS-STARTPTS,atrim=start=${trim},asetpts=PTS-STARTPTS,adelay=${delay}:all=1,apad[finalAudio]`)
90
+ // Preserve real gaps before sample-count filters, tolerating normal recorder timestamp jitter.
91
+ filters.push(`[${input}:a:0]asetpts=PTS-STARTPTS,aresample=async=1:min_hard_comp=0.02,atrim=start=${trim},asetpts=PTS-STARTPTS,adelay=${delay}:all=1,apad[finalAudio]`)
91
92
  }
92
93
  return filters.join(';')
93
94
  }