You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
check available ffmpeg, check -ar offset setting
This commit is contained in:
committed by
GitHub
parent
64f41b93ae
commit
2c73d7ef19
@@ -1,8 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
const ffmpegStaticPath = require('ffmpeg-static');
|
const checkFFmpeg = require('./checkFFmpeg');
|
||||||
const {serverConfig} = require('../server_config')
|
const {serverConfig} = require('../server_config');
|
||||||
|
|
||||||
|
let ffmpegStaticPath;
|
||||||
|
|
||||||
|
function runStream() {
|
||||||
/*
|
/*
|
||||||
Stdin streamer is part of 3LAS (Low Latency Live Audio Streaming)
|
Stdin streamer is part of 3LAS (Low Latency Live Audio Streaming)
|
||||||
https://github.com/JoJoBond/3LAS
|
https://github.com/JoJoBond/3LAS
|
||||||
@@ -243,7 +246,7 @@ class FallbackProviderMp3 extends AFallbackProvider {
|
|||||||
return [
|
return [
|
||||||
"-fflags", "+nobuffer+flush_packets", "-flags", "low_delay", "-rtbufsize", "32", "-probesize", "32",
|
"-fflags", "+nobuffer+flush_packets", "-flags", "low_delay", "-rtbufsize", "32", "-probesize", "32",
|
||||||
"-f", "s16le",
|
"-f", "s16le",
|
||||||
"-ar", this.Server.SampleRate.toString(),
|
"-ar", Number(this.Server.SampleRate.toString()) + Number(serverConfig.audio.samplerateOffset),
|
||||||
"-ac", this.Server.Channels.toString(),
|
"-ac", this.Server.Channels.toString(),
|
||||||
"-i", "pipe:0",
|
"-i", "pipe:0",
|
||||||
"-c:a", "libmp3lame",
|
"-c:a", "libmp3lame",
|
||||||
@@ -274,7 +277,7 @@ class FallbackProviderWav extends AFallbackProvider {
|
|||||||
return [
|
return [
|
||||||
"-fflags", "+nobuffer+flush_packets", "-flags", "low_delay", "-rtbufsize", "32", "-probesize", "32",
|
"-fflags", "+nobuffer+flush_packets", "-flags", "low_delay", "-rtbufsize", "32", "-probesize", "32",
|
||||||
"-f", "s16le",
|
"-f", "s16le",
|
||||||
"-ar", this.Server.SampleRate.toString(),
|
"-ar", Number(this.Server.SampleRate.toString()) + Number(serverConfig.audio.samplerateOffset),
|
||||||
"-ac", this.Server.Channels.toString(),
|
"-ac", this.Server.Channels.toString(),
|
||||||
"-i", "pipe:0",
|
"-i", "pipe:0",
|
||||||
"-c:a", "pcm_s16le",
|
"-c:a", "pcm_s16le",
|
||||||
@@ -327,4 +330,10 @@ for (let i = 2; i < (process.argv.length - 1); i += 2) {
|
|||||||
}
|
}
|
||||||
const Server = StreamServer.Create(Options);
|
const Server = StreamServer.Create(Options);
|
||||||
Server.Run();
|
Server.Run();
|
||||||
//# sourceMappingURL=3las.server.js.map
|
//# sourceMappingURL=3las.server.js.map
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFFmpeg().then((ffmpegResult) => {
|
||||||
|
ffmpegStaticPath = ffmpegResult;
|
||||||
|
runStream();
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user