Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (93)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (9465)

  • conflicting of headers between ffmpeg and s3

    2 août 2021, par Juliette

    I have the code below in my server.js file for a web app that uses express for the backend and a built create react app that it serves.

    


    require('rootpath')();
const path = require('path');
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const cors = require('cors');

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(cookieParser());

app.use(cors());


app.use(function(req, res, next) {
  res.header("Cross-Origin-Embedder-Policy", "require-corp");
  res.header("Cross-Origin-Opener-Policy", "same-origin");
  next();
});

// Have Node serve the files for our built React app
app.use(express.static(path.resolve(__dirname, 'build')));

// file api routes
app.use('/accounts', require('./accounts/accounts.controller'));

// file api routes
app.use('/files', require('./files/files.controller'));


// All other GET requests not handled before will return our React app
app.get('*', (req, res) => {
    res.sendFile(path.resolve(__dirname, 'build', 'index.html'));
});

// start server
const port = process.env.PORT || 2002;
app.listen(port, () => console.log('Server listening on port ' + port));


    


    The issue here is that I need this segment of code for my ffmpeg file upload to occur otherwise it throws a SharedArrayBuffer error :

    


       app.use(function(req, res, next) {
      res.header("Cross-Origin-Embedder-Policy", "require-corp");
      res.header("Cross-Origin-Opener-Policy", "same-origin");
      next();
    });


    


    However, when I leave this code in, another part of my program breaks down which gets presigned urls from s3 and plays audio. The issue whenever I play audios from my s3 bucket there is this :

    


    ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep


    


    The s3 code is this :

    


    function getTemporaryURL({ data }) {

  const customer_id = data['customer-id'];
  const sound_id = data['sound-id'];
  
  return new Promise((resolve, reject) => {
    //get presigned url

    var myBucket = process.env.NODE_APP_BUCKET_NAME;
    var myKey = "sounds/" + customer_id + "/" + sound_id + ".wav"; 
    const signedUrlExpireSeconds = 120;
    try {
      const url = s3.getSignedUrl('getObject', {
        Bucket: myBucket,
        Key: myKey,
        ResponseContentDisposition: 'attachment',
        Expires: signedUrlExpireSeconds
      });
      resolve(url)
    }
    catch {
      console.log('S3 Object does not exist');
      resolve('');
    }
  });
}


    


    How can I modify my server.js to accommodate both of my needs ?

    


  • Convert RTSP stream to MP4

    24 mars 2021, par edua_glz

    I have a IP Camera that supports RTSP, and I need to display this stream to multiple clients using HTML5.

    



    Since HTML Video tag doesn't support RTSP, I'm calling ffmpeg to encode it to a WEBM stream, but the result is very glitchy and distorts the original stream.

    



    The command im using is the following :
ffmpeg -i my_RSTP_URL -vcodec libvpx -f webm -

    



    To distribute the stream I'm using a Node.js instance that calls the rtsp stream via ffpmeg when needed.

    



    The solution looks like such :

    



    Camera —Via RSTP—> ffmpeg —Encodes to WEBM—> Node.js —Via HTML5 Video—> Client

    



    Node.js code :

    



        var request = require('request');
    var http = require('http');
    var child_process = require("child_process");
    var stdouts = {};

    http.createServer(function (req, resp) {
    switch (params[0])
    {
      case "LIVE":
        resp.writeHead(200, {'Content-Type': 'video/mp4', 'Connection': 'keep-alive'});


            // Start ffmpeg
                var ffmpeg = child_process.spawn("ffmpeg",[
                    "-i","my_RSTP_URL", // Capture offset
                    "-vcodec","libvpx",      // vp8 encoding
                    "-f","webm",             // File format
                    "-"                      // Output to STDOUT
                ]);

            ffmpeg.on('exit', function()
                {
                    console.log('ffmpeg terminado');
                });

            ffmpeg.on('error',function(e)
            {
                console.log(e);
            })

            ffmpeg.stdout.on('data',function(data)
            {
                console.log('datos'+data);
            });


            ffmpeg.stderr.on('data', function(data) {
                console.log('stderr'+data);
            });

            stdouts[params[1]] = ffmpeg.stdout;

            // Pipe the video output to the client response
            ffmpeg.stdout.pipe(resp);

        console.log("Initializing camera");
        break;
    }


    }).listen(8088);

    console.log('Server running at port 8088');


    



    Am I using the wrong library codec ? Or why Am I getting such a weird result ?

    


  • Convert RTSP stream to MP4

    11 février 2017, par edua_glz

    I have a IP Camera that supports RTSP, and I need to display this stream to multiple clients using HTML5.

    Since HTML Video tag doesn’t support RTSP, I’m calling ffmpeg to encode it to a WEBM stream, but the result is very glitchy and distorts the original stream.

    The command im using is the following :
    ffmpeg -i my_RSTP_URL -vcodec libvpx -f webm -

    To distribute the stream I’m using a Node.js instance that calls the rtsp stream via ffpmeg when needed.

    The solution looks like such :

    Camera —Via RSTP—> ffmpeg —Encodes to WEBM—> Node.js —Via HTML5 Video—> Client

    Node.js code :

       var request = require('request');
       var http = require('http');
       var child_process = require("child_process");
       var stdouts = {};

       http.createServer(function (req, resp) {
       switch (params[0])
       {
         case "LIVE":
           resp.writeHead(200, {'Content-Type': 'video/mp4', 'Connection': 'keep-alive'});


               // Start ffmpeg
                   var ffmpeg = child_process.spawn("ffmpeg",[
                       "-i","my_RSTP_URL", // Capture offset
                       "-vcodec","libvpx",      // vp8 encoding
                       "-f","webm",             // File format
                       "-"                      // Output to STDOUT
                   ]);

               ffmpeg.on('exit', function()
                   {
                       console.log('ffmpeg terminado');
                   });

               ffmpeg.on('error',function(e)
               {
                   console.log(e);
               })

               ffmpeg.stdout.on('data',function(data)
               {
                   console.log('datos'+data);
               });


               ffmpeg.stderr.on('data', function(data) {
                   console.log('stderr'+data);
               });

               stdouts[params[1]] = ffmpeg.stdout;

               // Pipe the video output to the client response
               ffmpeg.stdout.pipe(resp);

           console.log("Initializing camera");
           break;
       }


       }).listen(8088);

       console.log('Server running at port 8088');

    Am I using the wrong library codec ? Or why Am I getting such a weird result ?