Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (103)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (15960)

  • 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' }
  • 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.

    



    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.

    



    Here are the steps I have performed so far :

    



      

    • 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.
    • 


    • 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.
    • 


    • Tested this command :
    • 


    



    

    

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

    


    


    




    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.

    



      

    • Then, tried splitting the concatenation and transcode into two steps :
    • 


    



    

    

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

    


    


    




    This did basically the same thing as before.

    



      

    • Tried using the libx265 encoder instead. Same result.
    • 


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


    



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

    


  • 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>