jbilcke-hf HF staff commited on
Commit
9061179
·
1 Parent(s): 5f8adfe

fix fatal flaw

Browse files
src/core/exporters/storyboardSegmentToVideoFile.ts CHANGED
@@ -30,7 +30,7 @@ export async function storyboardSegmentToVideoFile({
30
  })
31
 
32
  const interfaceSegments = filterSegments(
33
- ClapSegmentFilteringMode.START,
34
  segment,
35
  clap.segments,
36
  ClapSegmentCategory.INTERFACE
@@ -59,7 +59,7 @@ export async function storyboardSegmentToVideoFile({
59
  }
60
 
61
  const dialogueSegments = filterSegments(
62
- ClapSegmentFilteringMode.START,
63
  segment,
64
  clap.segments,
65
  ClapSegmentCategory.DIALOGUE
 
30
  })
31
 
32
  const interfaceSegments = filterSegments(
33
+ ClapSegmentFilteringMode.BOTH,
34
  segment,
35
  clap.segments,
36
  ClapSegmentCategory.INTERFACE
 
59
  }
60
 
61
  const dialogueSegments = filterSegments(
62
+ ClapSegmentFilteringMode.BOTH,
63
  segment,
64
  clap.segments,
65
  ClapSegmentCategory.DIALOGUE
src/core/exporters/videoSegmentToVideoFile.ts CHANGED
@@ -24,16 +24,19 @@ export async function videoSegmentToVideoFile({
24
  join(outputDir, `tmp_asset_${segment.id}.${base64Info.extension}`)
25
  )
26
  const interfaceSegments = filterSegments(
27
- ClapSegmentFilteringMode.START,
28
  segment,
29
  clap.segments,
30
  ClapSegmentCategory.INTERFACE
31
  )
32
 
 
 
33
  const interfaceSegment = interfaceSegments.at(0)
34
  if (interfaceSegment) {
35
  // here we are free to use mp4, since this is an internal intermediary format
36
  const videoSegmentWithOverlayFilePath = join(outputDir, `tmp_asset_${segment.id}_with_interface.mp4`)
 
37
  await addTextToVideo({
38
  inputVideoPath: videoSegmentFilePath,
39
  outputVideoPath: videoSegmentWithOverlayFilePath,
@@ -49,11 +52,11 @@ export async function videoSegmentToVideoFile({
49
  }
50
 
51
  const dialogueSegments = filterSegments(
52
- ClapSegmentFilteringMode.START,
53
  segment,
54
  clap.segments,
55
  ClapSegmentCategory.DIALOGUE
56
- ).map(s => s.assetUrl.startsWith("data:audio/"))
57
 
58
  const dialogueSegment = dialogueSegments.at(0)
59
  if (dialogueSegment) {
 
24
  join(outputDir, `tmp_asset_${segment.id}.${base64Info.extension}`)
25
  )
26
  const interfaceSegments = filterSegments(
27
+ ClapSegmentFilteringMode.BOTH,
28
  segment,
29
  clap.segments,
30
  ClapSegmentCategory.INTERFACE
31
  )
32
 
33
+ console.log(`clapWithVideoToVideoFile: got ${interfaceSegments.length} interface segments for shot ${segment.id} [${segment.startTimeInMs}:${segment.endTimeInMs}]`)
34
+
35
  const interfaceSegment = interfaceSegments.at(0)
36
  if (interfaceSegment) {
37
  // here we are free to use mp4, since this is an internal intermediary format
38
  const videoSegmentWithOverlayFilePath = join(outputDir, `tmp_asset_${segment.id}_with_interface.mp4`)
39
+
40
  await addTextToVideo({
41
  inputVideoPath: videoSegmentFilePath,
42
  outputVideoPath: videoSegmentWithOverlayFilePath,
 
52
  }
53
 
54
  const dialogueSegments = filterSegments(
55
+ ClapSegmentFilteringMode.BOTH,
56
  segment,
57
  clap.segments,
58
  ClapSegmentCategory.DIALOGUE
59
+ ).filter(s => s.assetUrl.startsWith("data:audio/"))
60
 
61
  const dialogueSegment = dialogueSegments.at(0)
62
  if (dialogueSegment) {