Recherche avancée

Médias (1)

Mot : - Tags -/livre électronique

Autres articles (102)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (9151)

  • How see if the client aborted the request in nodejs

    9 février 2023, par Pitzho

    I'm trying do a mp4 converter, but if the client cancel the request, continues the conversion, how I stop the conversion if the client cancel the request ?

    


    Code from conversor :

    


        // Start the ffmpeg child process
    const ffmpegProcess = cp.spawn(ffmpeg, [
    // Remove ffmpeg's console spamming
    '-loglevel', '8', '-hide_banner',
    // Redirect/Enable progress messages
    '-progress', 'pipe:3',
    // Set inputs
    '-i', 'pipe:4',
    '-i', 'pipe:5',
    // Map audio & video from streams
    '-map', '0:a',
    '-map', '1:v',
    // Keep encoding
    '-c:v', 'copy',
    // Define output file
    token + formato,
  ], {
    windowsHide: true,
    stdio: [
      /* Standard: stdin, stdout, stderr */
      'inherit', 'inherit', 'inherit',
      /* Custom: pipe:3, pipe:4, pipe:5 */
      'pipe', 'pipe', 'pipe', 'pipe'
    ],
  });

  ffmpegProcess.stdio[3].on('data', (err) => {
    console.log(res.status())
  });
  
  audio.pipe(ffmpegProcess.stdio[4]);
  video.pipe(ffmpegProcess.stdio[5]);
  
  ffmpegProcess.stdio[6].on('error', (err) => {
    // Remover token do objeto
    delete inUseTokens[token];
    res.status(500).send(err.message);
  });

  ffmpegProcess.stdio[6].on('close', () => {
    console.log("convertido!")
    res.render('downloated', {formato: formato, title: titulo, token: token, thumbnail: thumbnail, seconds: seconds})
    })
  });


    


    I don't know how I can solve this...

    


  • Auto delete .ts and .m3u8 files once client receives all .ts files

    11 mars 2019, par Abhishek Mehandiratta

    So I created an express server that gets an mp3 file (which is stored locally right now, but will be taken from mongo db later) and uses ffmpeg to make .m3u8 and .ts files. The files are successfully sent to the client and there are no errors while playing it on the client. I used hls.js to play these files in Chrome. But the server still has those files stored locally. Is there any way the server can know when to delete these files that it stored locally ? There are a lot of files generated by ffmpeg so I can’t just let them stay there forever.

    I used the ffmpeg part of code from hls-server github repo.

    my server file

    index.js

    // just used to run ffmpeg for conversion
    var command = ffmpeg('inp.mp3')
     .on('start', function (commandLine) {
       console.log('command', commandLine);
     }).addOptions([
       '-c:a aac',
       '-b:a 64k',
       '-vn',
       '-hls_list_size 0',
       '-segment_time 10',
     ]).output('files\\output.m3u8');

    var express = require('express');
    var app = express();
    // express middleware to serve individual .ts and .m3u8 files when requested
    app.use(express.static('./files/'));

    app.get('/', function (req, res) {
     command.on('end', function () {
       console.log('done');
       res.write(`
       <code class="echappe-js">&lt;script src=&quot;https://cdn.jsdelivr.net/hls.js/latest/hls.min.js&quot;&gt;&lt;/script&gt;
    &lt;script&gt;<br />
         function onLevelLoaded (event, data) {<br />
           var level_duration = data.details.totalduration;<br />
           console.log(level_duration, data);<br />
         }<br />
         if(Hls.isSupported()) {<br />
           var audio = new Audio();<br />
           var hls = new Hls();<br />
           // requesting files from here<br />
           hls.loadSource('http://localhost:8000/output.m3u8');<br />
           hls.attachMedia(audio);<br />
           hls.on(Hls.Events.LEVEL_LOADED, onLevelLoaded);<br />
           hls.on(Hls.Events.FRAG_BUFFERED, (e, d) =&gt; {<br />
             console.log(e, d);<br />
           });<br />
         }<br />
       &lt;/script&gt;

    `) ;
    res.end() ;
    }).run() ;
    }) ;

    app.listen(8000) ;

  • What is wrong with this code ? Not working on Windows 10 / Ubuntu 14

    3 avril 2017, par Somename

    Trying to convert a .gif to .mp4 :

    var express = require('express');
    var bodyParser = require('body-parser');
    var app = express();
    var ffmpeg = require('fluent-ffmpeg');  

    var proc = new ffmpeg({ source: 'myfile.gif' })
     .withAspect('4:3')
     .withSize('640x480')
     .applyAutopadding(true, 'white')
     .saveToFile('myfile.avi', function(stdout, stderr) {
       console.log('file has been converted succesfully');
     });

    app.listen(3000, function() {  
       console.log("Server Running on 3000");
    });

    Getting the same error on Windows 10 and Ubuntu 14 : Error: Cannot find ffmpeg.

    What is wrong with the code ? Please help.