Recherche avancée

Médias (91)

Autres articles (40)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (4188)

  • how to convert any audio file to wav on server side with node.js [on hold]

    9 juin 2014, par pufmaigre

    my dear stackoverflow

    I spent hours looking for an efficient and pretty way to transcode audio on server side, and I found a lot of informations... actually too much informations.

    Sox for Node.js looks fine but there are not so much documentation, I was unable to convert a mp3 to wav with it :

    https://www.npmjs.org/package/sox

    Then fluent ffmpeg sounds good but I have the feeling I will loose a lot of time to achieve my goal with it :

    https://github.com/fluent-ffmpeg/node-fluent-ffmpeg

    and then i found some more obscure stuff like those ones :

    https://github.com/andrewrk/node-plan-transcode

    https://github.com/benvanik/node-transcoding

    I’m not sure it’s really the "stackoverflow spirit" but I’m asking you wich way would you choose to achieve my goal because I’m feeling lost in the codec jungle.

    thanks in advance !! love :)

  • Ffmpeg won't cut excerpt of video correctly

    6 mai 2022, par user17661390

    I am using a DOS batch to automate and cut excerpts of various high definition videos (mkv's with more than 1GB each).
The script is very convenient and runs fast and fine, but Ffmpeg is not doing its job correctly (it seems Murphy's law is inexorably enthralled into technology, things never come easy, which is why I love and hate it).

    


    Anyway, to cut a long story short, each time the batch job runs, a code like below is executed. Note the path to ffmpeg is specified, since it's not in the PATH environment variable, so the below form works always.

    


    "C:\ffmpeg\bin\ffmpeg.exe" -y -i "D:\S01\SATC - S01E03 - Bay of Married Pigs.mkv" -ss 00:18:05 -to 00:19:15 -codec copy "002-SATC - S01E03 - Bay of Married Pigs-00_18_05-00_19_15.mp4"


    


    The problem is that the first 6 seconds or so of the resulting video has no video, only audio with a frozen image that only starts to move after about 6 seconds, which is a huge defect, not to mention very annoying (a big let down, after all my meticulous scripting work :(). And this happens for most of the files, except a few ones.

    


    Even though this is copying and changing the format from mkv to mp4, per another thread on this site (https://askubuntu.com/questions/396883/how-to-simply-convert-video-files-i-e-mkv-to-mp4), this is not re-encoding, so this is not the issue. Actually, the same problem occurs even if I don't change the format from mkv to mp4.

    


    Even though I foresee a "there's no way to fix this", let me ask : is there a way to fix this ? Hopefully there is a way.

    


  • Bluemix node js build pack to support webm audio conversion

    31 août 2018, par Nimmy Mohandas

    Even after adding ffmpeg to bluemix node js build pack(I tried this https://github.com/BlueChasm/nodejs-buildpack-ffmpeg), it doesn’t support webm audio format conversion.Could anyone please suggest alternate ways to support this issue ?

    Description : I want to do speech to text conversion using Google speech recognition. I am using react native for front-end development. I recorded the voice and generated a webm audio file. Since the google speech recognition doesn’t support webm file format, I converted it into wav format using fluent-ffmpeg. It is working perfectly in my local system, but when I deploy it to the IBM cloud foundry using ffmpeg buildpack(https://github.com/BlueChasm/nodejs-buildpack-ffmpeg), it generates a file without extension. Following are my code,

    router.post('/st', audioUpload.single('audio'), function(req, res, next) {
           if (!req.file) {
               return res.json({ status: false, error: 'No input given!' });
           }

           /**
            * convert to .wav
            */


           ffmpeg(req.file.path)
               .toFormat('wav')
               .inputOptions(['-r 32000',
                   '-ac 1'
               ])

               .on('error', (err) => {
                   console.log('An error occurred: ' + err.message);
               })
               .save(path.join(__dirname, '..', 'uploads/audio/file.wav'))

           .on('end', () => {

               st.detectAudioFile(path.join(__dirname, '..', 'uploads/audio/file.wav')).then(data => {
                       fs.unlink(path.join(__dirname, '..', 'uploads/audio/file.wav'), function(err) {
                           if (err) return res.send(err);
                           const response = data[0];
                           const transcription = response.results
                               .map(result => result.alternatives[0].transcript)
                               .join('\n');
                           return res.json({ transcription });
                       }), fs.unlink(req.file.path, function(err) {
                           if (err) return res.json(err);
                       })

                   })
                   .catch(err => {
                       res.send({

                           status: false,
                           error_code: 400,
                           err: err.error || err.message
                       });
                   });
           })
       })

    //speech-to-text.js

    const fs = require('fs');
    const speech = require('@google-cloud/speech');


    var detectAudioFile = function(fileName) {

       const Speechclient = new speech.SpeechClient({})

       // Reads a local audio file and converts it to base64
       const file = fs.readFileSync(fileName);

       const audioBytes = file.toString('base64');
       const audio = {
           content: audioBytes,
       };
       const config = {
           // encoding: "FLAC",
           // sampleRateHertz: 44100,

           languageCode: 'en-US',
       };
       const request = {
           audio: audio,
           config: config,
       };
       return Speechclient
           .recognize(request);

    }



    module.exports = {
       detectAudioFile
    }

    `