Recherche avancée

Médias (0)

Mot : - Tags -/médias

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (104)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (7044)

  • 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>
  • Concatenation and Transcoding of MPEG-TS files FFMPEG

    20 décembre 2020, par SquawkBirdies

    I have a DVR which records over-the-air TV and saves the recordings in the MPEG-TS format, splitting each episode across multiple files, each 500 MB in size.

    &#xA;&#xA;

    To simplify archiving, I have been trying to write a shell script to automate the process of concatenating the files together and transcoding them into a more common video format, like h.264.

    &#xA;&#xA;

    Here are the steps I have performed so far :

    &#xA;&#xA;

      &#xA;
    • I wanted to make sure that the files I was getting were valid in the first place. To test this, each section was transcoded in Handbrake before being merged using ffmpeg's concat command. This worked, but was manual and added an annoying black frame between each section.
    • &#xA;

    • I wrote a shell script to find all the sections of an episode in a folder and put the file names into a text file that the concat demuxer could parse.
    • &#xA;

    • Tested this command :
    • &#xA;

    &#xA;&#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    ffmpeg -hide_banner -f concat -i video_files_tmp.txt -c:v libx264 -pix_fmt yuv420p -c:a aac $2$OUTPUT_FILE_NAME

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

    During the transcode, this would throw many warnings and errors, such as "PES packet size mismatch". At some point, it would warn that more than 1,000 frame were skipped. When the output was played, it would skip frames and result in a file where the video froze partway through but the audio continued playing. I tried adding -vsync 0 to the output as well.

    &#xA;&#xA;

      &#xA;
    • Then, tried splitting the concatenation and transcode into two steps :
    • &#xA;

    &#xA;&#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    ffmpeg -hide_banner -f concat -i video_files_tmp.txt -c copy output_tmp.ts&#xD;&#xA;ffmpeg -hide_banner -i output_tmp.ts -c:v libx265 -pix_fmt yuv420p -c:a aac $2$OUTPUT_FILE_NAME

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;&#xA;

    This did basically the same thing as before.

    &#xA;&#xA;

      &#xA;
    • Tried using the libx265 encoder instead. Same result.
    • &#xA;

    • Then, I tried just playing the concatenated MPEG-TS file directly, which also would freeze at some point during the playback.
    • &#xA;

    &#xA;&#xA;

    I was wondering about what ffmpeg flags or options to set to get this working, or other options I could try ? Thanks !

    &#xA;

  • Command failed ffmpeg in Lambda function (Node js)

    14 février 2019, par Arun

    I am trying to convert a video file to an audio file inside the lambda function. But I keep getting FFmpeg command failed error. I put FFmpeg binary exe file inside the project directory. but still, I am getting the same error. I tried this ( Lambda not connecting to ffmpeg ) but my issue is not solving yet. Any helps ?? thanks,

    Here is my lambda function code

    process.env.PATH = process.env.PATH + ':/tmp/';
    process.env['FFMPEG_PATH'] = '/tmp/ffmpeg';
    const BIN_PATH = process.env['LAMBDA_TASK_ROOT'];
    process.env['PATH'] = process.env['PATH'] + ':' + BIN_PATH;

    const fs = require('fs');
    const AWS = require('aws-sdk');

    AWS.config.update({
       region : 'us-east-2'
    });
    const s3 = new AWS.S3({apiVersion: '2006-03-01'});


    exports.handler = (event, context, callback) => {
       require('child_process').exec(
           'cp /var/task/ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg;',
           function (error, stdout, stderr) {
               if (error) {
                   console.log('Erro occured',error);
               } else {
                   var ffmpeg = require('ffmpeg');
                   var params = {
                       Bucket: "bucket_name",
                       Key: event.Records[0].s3.object.key
                   };
                   s3.getObject(params, function(err, data) {
                       if (err) {
                           console.log("Error", err);
                       }
                       fs.writeFile("/tmp/vid.mp4", data.Body, function (err) {
                           if (err) console.log(err.code, "-", err.message);
                           return callback(err);
                       }, function() {
                           try {
                               var stats = fs.statSync("/tmp/vid.mp4");
                               console.log("size of the file1 ", stats["size"]);
                               try {
                                   console.log("Yeah");
                                   var process = new ffmpeg('/tmp/vid.mp4');
                                   process.then(function (video) {
                                       // Callback mode
                                       console.log("video function ", video);
                                       video.fnExtractSoundToMP3('/tmp/video.mp3', function (error, file) {
                                           if (!error)
                                               console.log('Audio file: ' + file);
                                           else console.log('error video ', error);
                                       });
                                   }, function (err) {
                                       console.log('Error: ' + err);
                                   });
                               } catch (e) {
                                   console.log(e.code);
                                   console.log(e.msg);
                               }
                           } catch (e) {
                               console.log("file is not complete", e);
                           }
                       });
                       return callback(err);
                   });
               }
           }
       )
    }

    Error message

    { Error: Command failed: ffmpeg -i /tmp/vid.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 /tmp/video.mp3

       at ChildProcess.exithandler (child_process.js:275:12)
       at emitTwo (events.js:126:13)
       at ChildProcess.emit (events.js:214:7)
       at maybeClose (internal/child_process.js:925:16)
       at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
       killed: false,
           code: null,
       signal: 'SIGSEGV',
       cmd: 'ffmpeg -i /tmp/vid.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 /tmp/video.mp3' }