mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-10 03:55: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
|
// Create stream and pipe to capacitor
|
||||||
return new Promise((resolve, reject) => {
|
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)
|
const youtubeStream = ffmpeg(ffmpegInput)
|
||||||
.inputOptions(ffmpegInputOptions)
|
.inputOptions(ffmpegInputOptions)
|
||||||
.noVideo()
|
.noVideo()
|
||||||
|
@ -374,17 +385,8 @@ export default class {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
const capacitor = new WriteStream();
|
|
||||||
|
|
||||||
youtubeStream.pipe(capacitor);
|
youtubeStream.pipe(capacitor);
|
||||||
|
|
||||||
// Cache video if necessary
|
|
||||||
if (shouldCacheVideo) {
|
|
||||||
const cacheStream = this.fileCache.createWriteStream(this.getHashForCache(url));
|
|
||||||
|
|
||||||
capacitor.createReadStream().pipe(cacheStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve(capacitor.createReadStream());
|
resolve(capacitor.createReadStream());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue