Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (80)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • 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" (...)

Sur d’autres sites (14957)

  • Convert mediarecorder blobs to a type that google speech to text can transcribe

    5 janvier 2021, par Manesha Ramesh

    I am making an app where the user browser records the user speaking and sends it to the server which then passes it on to the Google speech to the text interface. I am using mediaRecorder to get 1-second blobs which are sent to a server. On the server-side, I send these blobs over to the Google speech to the text interface. However, I am getting an empty transcriptions.

    



    I know what the issue is. Mediarecorder's default Mime Type id audio/WebM codec=opus, which is not accepted by google's speech to text API. After doing some research, I realize I need to use ffmpeg to convert blobs to LInear16. However, ffmpeg only accepts audio FILES and I want to be able to convert BLOBS. Then I can send the resulting converted blobs over to the API interface.

    



    server.js

    



    wsserver.on('connection', socket => {
    console.log("Listening on port 3002")
    audio = {
        content: null
    }
  socket.on('message',function(message){
        // const buffer = new Int16Array(message, 0, Math.floor(data.byteLength / 2));
        // console.log(`received from a client: ${new Uint8Array(message)}`);
        // console.log(message);
        audio.content = message.toString('base64')
        console.log(audio.content);
        livetranscriber.createRequest(audio).then(request => {
            livetranscriber.recognizeStream(request);
        });


  });
});


    



    livetranscriber

    



    module.exports = {
    createRequest: function(audio){
        const encoding = 'LINEAR16';
const sampleRateHertz = 16000;
const languageCode = 'en-US';
        return new Promise((resolve, reject, err) =>{
            if (err){
                reject(err)
            }
            else{
                const request = {
                    audio: audio,
                    config: {
                      encoding: encoding,
                      sampleRateHertz: sampleRateHertz,
                      languageCode: languageCode,
                    },
                    interimResults: false, // If you want interim results, set this to true
                  };
                  resolve(request);
            }
        });

    },
    recognizeStream: async function(request){
        const [response] = await client.recognize(request)
        const transcription = response.results
            .map(result => result.alternatives[0].transcript)
            .join('\n');
        console.log(`Transcription: ${transcription}`);
        // console.log(message);
        // message.pipe(recognizeStream);
    },

}


    



    client

    



     recorder.ondataavailable = function(e) {
            console.log('Data', e.data);

            var ws = new WebSocket('ws://localhost:3002/websocket');
            ws.onopen = function() {
              console.log("opening connection");

              // const stream = websocketStream(ws)
              // const duplex = WebSocket.createWebSocketStream(ws, { encoding: 'utf8' });
              var blob = new Blob(e, { 'type' : 'audio/wav; base64' });
              ws.send(blob.data);
              // e.data).pipe(stream); 
              // console.log(e.data);
              console.log("Sent the message")
            };

            // chunks.push(e.data);
            // socket.emit('data', e.data);
        }


    


  • Revision b50e518ab6 : Require webm when explicitly requested https://code.google.com/p/webm/issues/de

    31 janvier 2015, par Johann

    Changed Paths :
     Modify /vpxenc.c



    Require webm when explicitly requested

    https://code.google.com/p/webm/issues/detail?id=906

    Change-Id : I72841078ff81152d21d84ccf4d5548e757685a6d

  • google function : TypeError : Cannot read property 'name' of undefined

    9 décembre 2019, par Juggernaught

    I’m trying to use Google cloud function to transcode videos from a storage bucket and outputs into another bucket using code posted online but with a few adjustments.

    but I get the following error :

    TypeError : Cannot read property ’name’ of undefined at transcodeVideo
    (/srv/index.js:17:56) at /worker/worker.js:825:24 at at
    process._tickDomainCallback (internal/process/next_tick.js:229:7)

    Index.js

    const {Storage} = require('@google-cloud/storage');
    const projectId = 'cc18-223318';
    const storage = new Storage({
       projectId: projectId,
    });
    const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
    const ffmpeg = require('fluent-ffmpeg');

    const transcodedBucket = storage.bucket('2400p');
    const uploadBucket = storage.bucket('inpuut');
    ffmpeg.setFfmpegPath(ffmpegPath);

    exports.transcodeVideo = function transcodeVideo(event, callback) {
     const file = event.data;
     // Ensure that you only proceed if the file is newly created, and exists.
     if (file.metageneration !== '1' || file.resourceState !== 'exists') {
       callback();
       return;
     }

     // Open write stream to new bucket, modify the filename as needed.
     const remoteWriteStream = transcodedBucket.file(file.name.replace('.webm', '.mp4'))
       .createWriteStream({
         metadata: {
           metadata: file.metadata, // You may not need this, my uploads have associated metadata
           contentType: 'video/mp4', // This could be whatever else you are transcoding to
         },
       });

     // Open read stream to our uploaded file
     const remoteReadStream = uploadBucket.file(file.name).createReadStream();

     // Transcode
     ffmpeg()
       .input(remoteReadStream)
       .outputOptions('-c:v libx264') // Change these options to whatever suits your needs
       .outputOptions('-c:a copy')
       .outputOptions('-vf "scale=4800:2400"')
       .outputOptions('-b:a 160k')
       .outputOptions('-b:a 160k')
       .outputOptions('-x264-params mvrange=511')
       .outputOptions('-f mp4')
       .outputOptions('-preset slow')
       .outputOptions('-movflags frag_keyframe+empty_moov')
       .outputOptions('-crf 18')
       // https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/346#issuecomment-67299526
       .on('start', (cmdLine) => {
         console.log('Started ffmpeg with command:', cmdLine);
       })
       .on('end', () => {
         console.log('Successfully re-encoded video.');
         callback();
       })
       .on('error', (err, stdout, stderr) => {
         console.error('An error occured during encoding', err.message);
         console.error('stdout:', stdout);
         console.error('stderr:', stderr);
         callback(err);
       })
       .pipe(remoteWriteStream, { end: true }); // end: true, emit end event when readable stream ends
    };