How to use the @ffmpeg-installer/ffmpeg.path.replace function in @ffmpeg-installer/ffmpeg

To help you get started, we’ve selected a few @ffmpeg-installer/ffmpeg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HaveAGitGat / Tdarr / server / main.js View on Github external
'createSample'(filePath) {

    console.log(filePath)
    var inputFile = filePath
    var outputFile = filePath.split(".")

    outputFile[outputFile.length - 2] = outputFile[outputFile.length - 2] + " - TdarrSample"
    outputFile = outputFile.join(".")

    outputFile = outputFile.split("/")
    outputFile = homePath + "/Tdarr/Samples/" + outputFile[outputFile.length - 1]

    var inputFileUnix = inputFile.replace(/'/g, '\'\"\'\"\'');
    var outputFileUnix = outputFile.replace(/'/g, '\'\"\'\"\'');
    var ffmpegPathUnix = ffmpegPath.replace(/'/g, '\'\"\'\"\'');



    var preset1 = "-ss 00:00:1"
    var preset2 = "-t 00:00:30 -map 0:v? -map 0:a? -map 0:s? -map 0:d? -c copy"

  //  var preset1 = "-ss 00:00:1"
  //  var preset2 = "-t 00:00:30 -c copy -map 0"


    if (fs.existsSync(outputFile)) {
      fs.unlinkSync(outputFile)
    }


    if (process.platform == 'win32') {

@ffmpeg-installer/ffmpeg

Platform independent binary installer of FFmpeg for node projects

LGPL-2.1
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis