Fix:FFprobe requires path update config #302

This commit is contained in:
advplyr 2022-01-10 17:57:51 -06:00
parent 018cebb0f5
commit 712aad2f14
3 changed files with 8 additions and 1 deletions

View File

@ -83,6 +83,7 @@ setup_config_interactive() {
METADATA_PATH=$DATA_PATH/metadata
CONFIG_PATH=$DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$PORT"
echo "$config_text"
@ -105,6 +106,7 @@ setup_config() {
METADATA_PATH=$DEFAULT_DATA_PATH/metadata
CONFIG_PATH=$DEFAULT_DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$DEFAULT_PORT"
echo "$config_text"

View File

@ -12,6 +12,7 @@ if (isDev) {
process.env.METADATA_PATH = devEnv.MetadataPath
process.env.AUDIOBOOK_PATH = devEnv.AudiobookPath
process.env.FFMPEG_PATH = devEnv.FFmpegPath
process.env.FFPROBE_PATH = devEnv.FFProbePath
}
const PORT = process.env.PORT || 80

View File

@ -256,7 +256,11 @@ function parseProbeData(data, verbose = false) {
// Updated probe returns AudioProbeData object
function probe(filepath, verbose = false) {
return ffprobe(filepath)
var options = {}
if (process.env.FFPROBE_PATH) {
options.path = process.env.FFPROBE_PATH
}
return ffprobe(filepath, options)
.then(raw => {
var rawProbeData = parseProbeData(raw, verbose)
if (!rawProbeData || !rawProbeData.audio_stream) {