From 766241eaec8ec65eb865bb05fde1c64dedf7b19f Mon Sep 17 00:00:00 2001 From: vexorian Date: Sun, 24 Jan 2021 00:00:15 -0400 Subject: [PATCH] Tweaks and fixes to music player. --- src/ffmpeg.js | 14 ++++++-------- src/plexTranscoder.js | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index e264cf6..00ace6c 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -227,15 +227,13 @@ class FFMPEG extends events.EventEmitter { //add 150 milliseconds just in case, exact duration seems to cut out the last bits of music some times. duration = `${streamStats.duration + 150}ms`; } - videoComplex = `;[${inputFiles++}:0]loop=loop=-1:size=1:start=0[looped]`; - videoComplex += `;[looped]format=yuv420p[formatted]`; - let stream = "scaled"; + videoComplex = `;[${inputFiles++}:0]format=yuv420p[formatted]`; videoComplex +=`;[formatted]scale=w=${iW}:h=${iH}:force_original_aspect_ratio=1[scaled]`; - if (this.ensureResolution) { - stream = "padded"; - videoComplex += `;[scaled]pad=${iW}:${iH}:(ow-iw)/2:(oh-ih)/2[padded]`; - } - videoComplex +=`;[${stream}]realtime[videox]`; + videoComplex += `;[scaled]pad=${iW}:${iH}:(ow-iw)/2:(oh-ih)/2[padded]`; + videoComplex += `;[padded]loop=loop=-1:size=1:start=0[looped]`; + videoComplex +=`;[looped]realtime[videox]`; + //this tune apparently makes the video compress better + // when it is the same image stillImage = true; } else if (this.opts.errorScreen == 'static') { ffmpegArgs.push( diff --git a/src/plexTranscoder.js b/src/plexTranscoder.js index 2c3fbc6..21dd1ed 100644 --- a/src/plexTranscoder.js +++ b/src/plexTranscoder.js @@ -355,7 +355,7 @@ lang=en` if (typeof(mediaContainer) !== 'undefined') { for( let i = 0; i < mediaContainer.Metadata.length; i++) { console.log("got art: " + mediaContainer.Metadata[i].thumb ); - this.albumArt.path = `${this.server.uri}${mediaContainer.Metadata[i].thumb}?${this.transcodingArgs}`; + this.albumArt.path = `${this.server.uri}${mediaContainer.Metadata[i].thumb}?X-Plex-Token=${this.server.accessToken}`; } } } catch (err) {