Recherche avancée

Médias (91)

Autres articles (52)

  • MediaSPIP : Modification des droits de création d’objets et de publication définitive

    11 novembre 2010, par

    Par défaut, MediaSPIP permet de créer 5 types d’objets.
    Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
    Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (10721)

  • Converting ffmpeg & ffprobe outputs to variables in an ffmpeg AWS Lambda Layer

    7 mars 2019, par Gracie

    I have two tasks I am trying to perform with the ffmpeg AWS Lambda layer.

    1) Convert an audio file from stereo to mono (with ffmpeg)

    2) Get the duration of the audio file and pass the result to a variable (with ffprobe)

    const { spawnSync } = require("child_process");
    const { readFileSync, writeFileSync, unlinkSync } = require("fs");
    const util = require('util');
    var fs = require('fs');

    exports.handler = (event, context, callback) => {

       // Windows 10 ffmpeg command to convert stereo to ffmpeg is
       // ffmpeg -i volando.flac -ac 1 volando-mono.flac

       // Convert from stereo to mono
       spawnSync(
           "/opt/bin/ffmpeg",
           [
               "-i",
               `volando.flac`,
               "-ac",
               "1",
               `/tmp/volando-mono.flac`
           ],
           { stdio: "inherit" }
       );

       //Pass result to a variable
       //var duration = stdio;

       //Read the content from the /tmp directory
       fs.readdir("/tmp/", function (err, data) {
           if (err) throw err;
           console.log('Contents of tmp file: ', data);
       });

       // Get duration of Flac file
       // Windows 10 ffmpeg command is
       // ffprobe in.wav -show_entries stream=duration -select_streams a -of compact=p=0:nk=1 -v 0
       spawnSync(
           "/opt/bin/ffprobe",
           [
               `in.wav`,
               "-show_entries",
               "stream=duration",
               "-select_streams",
               "a",
               "-of",
               "compact=p=0:nk=1",
               "-v",
               "0"
           ],
           { stdio: "inherit" }

           //Pass result to a variable
           //var duration = stdio;
       );

    };

    Can anyone who has had success with this ffmpeg Lambda layer help get an output for these commands ?

    Here are some resources regarding the FFmpeg Lambda layer :

    https://serverless.com/blog/publish-aws-lambda-layers-serverless-framework/
    https://github.com/serverlesspub/ffmpeg-aws-lambda-layer
    https://devopstar.com/2019/01/28/serverless-watermark-using-aws-lambda-layers-ffmpeg/

  • How to generate video thumbnail in NodeJs ?

    8 septembre 2020, par Schüler

    I am trying to generate video thumbnail but I am not getting an idea how to do that, I tried using fluent-ffmpeg & Video-thumbnail libraries but I don't know how to use them. Please, someone, help me
Note I cannot usersocket.io in my project

    



    I have tried this

    



    const ffmpeg = require('fluent-ffmpeg');
const ffmpeg_static = require('ffmpeg-static');    
 ffmpeg(req.file.path)
          .screenshots({
            timestamps: [0.0],
            filename: 'xx.png',
            folder: upload_folder
          }).on('end', function() {
            console.log('done');
          });


    



    getting this error

    



    events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find ffmpeg


    


  • How can I get duration of a video in java program using ffmpeg ?

    4 mars 2019, par J Jain

    I want to get duration of video and save it to database. I am running a java program to convert video into mp4 format, after conversion I want to get the duration of video.

    [How to extract duration time from ffmpeg output ?

    I have gone threw this link, that command is running well in cmd, but it is giving ’exit code = 1’ with java program.

    Here is code :-

    String videoDuration = "" ;
    List args1 = new ArrayList() ;

       args1.add("ffmpeg");
       args1.add("-i");
       args1.add(videoFilePath.getAbsolutePath());
       args1.add("2>&1");
       args1.add("|");
       args1.add("grep");
       args1.add("Duration");
       args1.add("|");
       // args.add("awk");
       // args.add("'" + "{print $2}" + "'");
       // args.add("|");
       args1.add("tr");
       args1.add("-d");
       args1.add(",");

       String argsString = String.join(" ", args1);

       try
       {
           Process process1 = Runtime.getRuntime().exec(argsString);
           logger.debug(strMethod + " Process started and in wait mode");
           process1.waitFor();
           logger.debug(strMethod + " Process completed wait mode");
           // FIXME: Add a logger increment to get the progress to 100%.
           int exitCode = process1.exitValue();
           if (exitCode != 0)
           {
               throw new RuntimeException("FFmpeg exec failed - exit code:" + exitCode);
           }
           else
           {
               videoDuration = process1.getOutputStream().toString();
           }
       }
       catch (IOException e)
       {
           e.printStackTrace();
           new RuntimeException("Unable to start FFmpeg executable.");
       }
       catch (InterruptedException e)
       {
           e.printStackTrace();
           new RuntimeException("FFmpeg run interrupted.");
       }
       catch (Exception ex)
       {
           ex.printStackTrace();
       }

       return videoDuration;

    Updated Code :-

      List<string> args1 = new ArrayList<string>();

       args1.add("ffprobe");
       args1.add("-i");
       args1.add(videoFilePath.getAbsolutePath());
       args1.add("-show_entries");
       args1.add("format=duration");
       args1.add("-v");
       args1.add("quiet");
       args1.add("-of");
       args1.add("csv=\"p=0\"");
       args1.add("-sexagesimal");

       String argsString = String.join(" ", args1);

       try
       {
           Process process1 = Runtime.getRuntime().exec(argsString);
       }
       catch (InterruptedException e)
       {
               e.printStackTrace();
           }
    </string></string>