|
@@ -124,12 +124,13 @@ class YouTubeVideoClipEventEmitter extends EventEmitter implements ClipEventEmit |
|
|
ffmpegProcessAudioStreamArgs.push(clipDuration); |
|
|
ffmpegProcessAudioStreamArgs.push(clipDuration); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const cacheFilename = 'output.webm'; // todo label this on the cache |
|
|
const ffmpegProcessArgs = [ |
|
|
const ffmpegProcessArgs = [ |
|
|
...ffmpegProcessVideoStreamArgs, |
|
|
...ffmpegProcessVideoStreamArgs, |
|
|
...ffmpegProcessAudioStreamArgs, |
|
|
...ffmpegProcessAudioStreamArgs, |
|
|
'-map', '0:v', |
|
|
'-map', '0:v', |
|
|
'-map', '1:a', |
|
|
'-map', '1:a', |
|
|
'output.webm', |
|
|
|
|
|
|
|
|
cacheFilename, |
|
|
]; |
|
|
]; |
|
|
this.emit('process', { |
|
|
this.emit('process', { |
|
|
type: 'postprocess', |
|
|
type: 'postprocess', |
|
@@ -142,8 +143,8 @@ class YouTubeVideoClipEventEmitter extends EventEmitter implements ClipEventEmit |
|
|
this.emit('end'); |
|
|
this.emit('end'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const output = readFileSync('output.webm'); |
|
|
|
|
|
unlinkSync('output.webm'); |
|
|
|
|
|
|
|
|
const output = readFileSync(cacheFilename); |
|
|
|
|
|
unlinkSync(cacheFilename); |
|
|
this.emit('process', { |
|
|
this.emit('process', { |
|
|
type: 'postprocess', |
|
|
type: 'postprocess', |
|
|
phase: 'success', |
|
|
phase: 'success', |
|
|