mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-12 21:05:29 +01:00
Add back -re option on uncached streams
This commit is contained in:
parent
49664be9e1
commit
9f9469f682
|
@ -364,6 +364,17 @@ export default class {
|
|||
|
||||
// Create stream and pipe to capacitor
|
||||
return new Promise((resolve, reject) => {
|
||||
const capacitor = new WriteStream();
|
||||
|
||||
// Cache video if necessary
|
||||
if (shouldCacheVideo) {
|
||||
const cacheStream = this.fileCache.createWriteStream(this.getHashForCache(url));
|
||||
|
||||
capacitor.createReadStream().pipe(cacheStream);
|
||||
} else {
|
||||
ffmpegInputOptions.push('-re');
|
||||
}
|
||||
|
||||
const youtubeStream = ffmpeg(ffmpegInput)
|
||||
.inputOptions(ffmpegInputOptions)
|
||||
.noVideo()
|
||||
|
@ -374,17 +385,8 @@ export default class {
|
|||
reject(error);
|
||||
});
|
||||
|
||||
const capacitor = new WriteStream();
|
||||
|
||||
youtubeStream.pipe(capacitor);
|
||||
|
||||
// Cache video if necessary
|
||||
if (shouldCacheVideo) {
|
||||
const cacheStream = this.fileCache.createWriteStream(this.getHashForCache(url));
|
||||
|
||||
capacitor.createReadStream().pipe(cacheStream);
|
||||
}
|
||||
|
||||
resolve(capacitor.createReadStream());
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue