Fix ffmpeg binary resolution

This commit is contained in:
SrGooglo 2025-05-15 14:10:15 +00:00
parent d589168e73
commit d0410ed244
5 changed files with 16 additions and 6 deletions

View File

@ -8,8 +8,9 @@ RUN apt install -y --no-install-recommends git
RUN apt install -y --no-install-recommends ssh RUN apt install -y --no-install-recommends ssh
RUN apt install -y --no-install-recommends curl RUN apt install -y --no-install-recommends curl
RUN apt install -y --no-install-recommends nscd RUN apt install -y --no-install-recommends nscd
RUN apt install -y --no-install-recommends bash
RUN apt install -y --no-install-recommends which
RUN apt install -y --no-install-recommends ca-certificates RUN apt install -y --no-install-recommends ca-certificates
RUN apt install -y --no-install-recommends ffmpeg
# Create workdir # Create workdir
RUN mkdir -p /comty-server RUN mkdir -p /comty-server
@ -41,6 +42,12 @@ RUN /comty-server/nginx-bin -v
RUN chmod -R 777 /comty-server RUN chmod -R 777 /comty-server
RUN chown -R node:node /comty-server RUN chown -R node:node /comty-server
# Install manual server dependencies
RUN mkdir -p /root/.local/bin
RUN "/comty-server/scripts/installLatestFfmpeg.sh"
RUN mv /root/.local/bin/ffmpeg /bin/ffmpeg
RUN mv /root/.local/bin/ffprobe /bin/ffprobe
# Set user to node # Set user to node
USER node USER node

View File

@ -57,6 +57,10 @@ export class FFMPEGLib extends EventEmitter {
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!bin) {
return reject("No binary provided")
}
const process = child_process.exec( const process = child_process.exec(
`${bin} ${args}`, `${bin} ${args}`,
{ {

View File

@ -108,9 +108,9 @@ export default class MultiqualityHLSJob extends FFMPEGLib {
fs.mkdirSync(outputPath, { recursive: true }) fs.mkdirSync(outputPath, { recursive: true })
} }
try {
const inputProbe = await Utils.probe(this.params.input) const inputProbe = await Utils.probe(this.params.input)
try {
const result = await this.ffmpeg({ const result = await this.ffmpeg({
args: cmdStr, args: cmdStr,
cwd: outputPath, cwd: outputPath,

View File

@ -105,9 +105,9 @@ export default class SegmentedAudioMPDJob extends FFMPEGLib {
fs.mkdirSync(outputPath, { recursive: true }) fs.mkdirSync(outputPath, { recursive: true })
} }
try {
const inputProbe = await Utils.probe(this.params.input) const inputProbe = await Utils.probe(this.params.input)
try {
const ffmpegResult = await this.ffmpeg({ const ffmpegResult = await this.ffmpeg({
args: segmentationCmd, args: segmentationCmd,
onProcess: (process) => { onProcess: (process) => {

View File

@ -1,4 +1,3 @@
import path from "node:path"
import fs from "node:fs" import fs from "node:fs"
import Upload from "@shared-classes/Upload" import Upload from "@shared-classes/Upload"