Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (64)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

Sur d’autres sites (6673)

  • How to convert mp4 to mp3 in Android Java ?

    16 août 2023, par Akshit

    I have the mp4 link of a video but don't have a link for the mp3 version of that mp4 video. So is there any way that I can convert that mp4 video to mp3 in Android ? I saw some resources but nothing works for me. I have two ways in which I believe this can be achieved

    


      

    1. Convert the mp4 link to mp3 directly. (Not Sure if this is achievable)
    2. 


    3. Download the mp4 on the device with the help of a link and then use some code to convert that mp4 to mp3.
    4. 


    


    I also tried some solutions which are available online

    


    https://github.com/tanersener/mobile-ffmpeg

    


    I tried the above library to achieve the final goal. But got : Async command execution failed with returnCode=1.

    


    This error in the code I am using is :

    


    private class Mp4ToMp3ConverterTask extends AsyncTask {
    @Override
    protected String doInBackground(String... params) {
        String mp4FilePath = params[0];
        String mp3OutputPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/output.mp3";

        String[] ffmpegCommand = {"-i", mp4FilePath, "-vn", "-ar", "44100", "-ac", "2", "-b:a", "192k", mp3OutputPath};


        Config.enableStatisticsCallback(new StatisticsCallback() {
            public void apply(Statistics newStatistics) {
                Log.d("Dekh", String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime()));
            }
        });

        long executionIdd = FFmpeg.executeAsync(ffmpegCommand, new ExecuteCallback() {
            @Override
            public void apply(final long executionId, final int returnCode) {
                if (returnCode == RETURN_CODE_SUCCESS) {
                    Log.i("Dekh", "Async command execution completed successfully.");
                } else if (returnCode == RETURN_CODE_CANCEL) {
                    Log.i("Dekh", "Async command execution cancelled by user.");
                } else {
                    Log.i("Dekh", String.format("Async command execution failed with returnCode=%d.", returnCode));
                }
            }
        });

        FFmpeg.cancel(executionIdd);

        return mp3OutputPath;
    }
}


    


    Solution number 2 which I used is :

    


    https://androidprogrammatically425516919.wordpress.com/2020/04/21/how-to-convert-video-to-audio-in-android-programmatically/

    


    But I got an error here also : Failed to instantiate extractor.
    
And another error is : java.io.FileNotFoundException: open failed: EISDIR (Is a directory)

    


    I tried the online available solution to solve these errors but nothing worked. Such as granting write permission. Providing a valid location to save the output.

    


    But nothing works so far. Please help me on this. Thank you.

    


  • AWS Lambda in Node JS with FFMPEG Lambda Layer

    29 mars 2023, par mwcwge23

    I'm trying to make a Lambda that takes a video and puts a watermark image on it.
I'm using Lambda with NodeJS and FFMPEG Lambda Layer I took from here :
https://serverlessrepo.aws.amazon.com/applications/us-east-1/145266761615/ffmpeg-lambda-layer

    


    I got these two errors and I don't have a clue what do I did wrong :
errors

    


    Please help me :)

    


    (by the way, if you have an easier solution to put a watermark image on video that'll also be great)

    


    That's my code (trying to put a watermark image on a video file) :

    


    const express = require("express");
const childProcess = require("child_process");
const path = require("path");
const fs = require("fs");
const util = require("util");
const os = require("os");
const { fileURLToPath } = require("url");
const { v4: uuidv4 } = require("uuid");
const bodyParser = require("body-parser");
const awsServerlessExpressMiddleware = require("aws-serverless-express/middleware");
const AWS = require("aws-sdk");
const workdir = os.tmpdir();

const s3 = new AWS.S3();

// declare a new express app
const app = express();
app.use(bodyParser.json());
app.use(awsServerlessExpressMiddleware.eventContext());

// Enable CORS for all methods
app.use(function (req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "*");
  next();
});

const downloadFileFromS3 = function (bucket, fileKey, filePath) {
  "use strict";
  console.log("downloading", bucket, fileKey, filePath);
  return new Promise(function (resolve, reject) {
    const file = fs.createWriteStream(filePath),
      stream = s3
        .getObject({
          Bucket: bucket,
          Key: fileKey,
        })
        .createReadStream();
    stream.on("error", reject);
    file.on("error", reject);
    file.on("finish", function () {
      console.log("downloaded", bucket, fileKey);
      resolve(filePath);
    });
    stream.pipe(file);
  });
};

const uploadFileToS3 = function (bucket, fileKey, filePath, contentType) {
  "use strict";
  console.log("uploading", bucket, fileKey, filePath);
  return s3
    .upload({
      Bucket: bucket,
      Key: fileKey,
      Body: fs.createReadStream(filePath),
      ACL: "private",
      ContentType: contentType,
    })
    .promise();
};

const spawnPromise = function (command, argsarray, envOptions) {
  return new Promise((resolve, reject) => {
    console.log("executing", command, argsarray.join(" "));
    const childProc = childProcess.spawn(
        command,
        argsarray,
        envOptions || { env: process.env, cwd: process.cwd() }
      ),
      resultBuffers = [];
    childProc.stdout.on("data", (buffer) => {
      console.log(buffer.toString());
      resultBuffers.push(buffer);
    });
    childProc.stderr.on("data", (buffer) => console.error(buffer.toString()));
    childProc.on("exit", (code, signal) => {
      console.log(`${command} completed with ${code}:${signal}`);
      if (code || signal) {
        reject(`${command} failed with ${code || signal}`);
      } else {
        resolve(Buffer.concat(resultBuffers).toString().trim());
      }
    });
  });
};

app.post("/api/addWatermark", async (req, res) => {
  try {
    const bucketName = "bucketName ";
    const uniqeName = uuidv4() + Date.now();
    const outputPath = path.join(workdir, uniqeName + ".mp4");
    const key = "file_example_MP4_480_1_5MG.mp4";
    const localFilePath = path.join(workdir, key);
    const watermarkPngKey = "watermark.png";
    const watermarkLocalFilePath = path.join(workdir, watermarkPngKey);

    downloadFileFromS3(bucketName, key, localFilePath)
      .then(() => {
        downloadFileFromS3(bucketName, watermarkPngKey, watermarkLocalFilePath)
          .then(() => {
            fs.readFile(localFilePath, (err, data) => {
              if (!err && data) {
                console.log("successsss111");
              }
            });
            fs.readFile(watermarkLocalFilePath, (err, data) => {
              if (!err && data) {
                console.log("successsss222");
              }
            });

            fs.readFile(outputPath, (err, data) => {
              if (!err && data) {
                console.log("successsss3333");
              }
            });

            spawnPromise(
              "/opt/bin/ffmpeg",
              [
                "-i",
                localFilePath,
                "-i",
                watermarkLocalFilePath,
                "-filter_complex",
                `[1]format=rgba,colorchannelmixer=aa=0.5[logo];[0][logo]overlay=5:H-h-5:format=auto,format=yuv420p`,
                "-c:a",
                "copy",
                outputPath,
              ],
              { env: process.env, cwd: workdir }
            )
              .then(() => {
                uploadFileToS3(
                  bucketName,
                  uniqeName + ".mp4",
                  outputPath,
                  "mp4"
                );
              });
           });
      });
  } catch (err) {
    console.log({ err });
    res.json({ err });
  }
});

app.listen(8136, function () {
  console.log("App started");
});

module.exports = app;



    


  • Backgroundworker quits itself and calls Runworkercompleted function

    5 mai 2017, par yjs990427

    I am using youtube-dl in a cmd process running in a backgroundworker process in wpf application to update its status to a text box asynchronously. There are times in my application that ffmpeg has to work in through the process. However, at the time that ffmpeg process is called (right after youtube-dl’s work is finished) and starts running, backgroundworker calls Runworkercompleted method and kills itself. ffmpeg is called from youtube-dl.

    Is there any fix that make the backgroundworker still work until the ffmpeg’s work is done ? Thanks.

    My DoWork method :

    private void downloadWorker_DoWork(object sender, DoWorkEventArgs e)
           {
               BackgroundWorker worker = sender as BackgroundWorker;
               Process process = new Process();
               string[] scripts = (string[])e.Argument;

               string dir = scripts[0];
               string scriptText = scripts[1];

               process.StartInfo.FileName = "cmd.exe";
               process.StartInfo.WorkingDirectory = dir;
               process.StartInfo.Arguments = "/C set path=%path%;" + System.AppDomain.CurrentDomain.BaseDirectory + "&" + scriptText;
               process.StartInfo.CreateNoWindow = true;
               process.StartInfo.UseShellExecute = false;
               process.StartInfo.RedirectStandardOutput = true;
               process.StartInfo.RedirectStandardInput = true;
               process.StartInfo.RedirectStandardError = true;

               process.Start();

               while (!process.StandardOutput.EndOfStream)
               {
                   if (downloadWorker.CancellationPending)   // if and only if user calls Abort
                   // would this if statement be the problem?
                   {
                       foreach (var youtube in Process.GetProcessesByName("youtube-dl"))
                       {
                           youtube.Kill();
                       }
                       process.Kill();
                       e.Cancel = true;
                       return;
                   }
                   else
                   {
                       string line = process.StandardOutput.ReadLine();
                       worker.ReportProgress(1, line);                  // reports its status to UI
                   }
               }
           }

    My RunWorkerCompleted method :

    private void downloadWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
           {
               if (e.Error != null)
               {
                   MessageBox.Show(e.Error.Message);
               }
               else if (e.Cancelled == true)
               {
                   MessageBox.Show("Download Aborted!\r\nYou will need to delete the .part file in the download folder.", "Abort");
               }
               else if (musicCheckBox.IsChecked == true)
               {
                   MessageBox.Show("Music Download finished.", "Successful");
               }
               else if (videoCheckBox.IsChecked == true)
               {
                   MessageBox.Show("Video Download finished.", "Successful");
               }
               // CMDoutputTextBox.Text = "";
               downloadBtn.Content = "Download!";
               downloadBtn.IsEnabled = true;
           }

    edit : The backgroundworker produces this output and calls RunWorkerFinished method. ffmpeg does nothing after the output.

    [ffmpeg] Converting video from mp4 to mkv, Destination: TAEYEON 태연_Why_Music Video-WkdtmT8A2iY.mkv