Recherche avancée

Médias (91)

Autres articles (18)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (3678)

  • I received connection refused error while trying to stream live video through RTMP with FFMPEG

    25 septembre 2020, par Femzy

    I am working on a nodeJs app that can send camera stream to third party plartform i.e Facebook and Youtube using the RTMP protoco ;.. It works well on my localhost but once i deploy to the server, it only give me errors. The error I get is below on this content..
Here is my codes

    


    server.js

    


    

    

    const child_process = require('child_process'); // To be used later for running FFmpeg
const express = require('express');
const http = require('http');
const WebSocketServer = require('ws').Server;

const app = express();
const server = http.createServer(app).listen(4000, () => {
  console.log('Listening...');
});

// Serve static files out of the www directory, where we will put our HTML page
app.use(express.static(__dirname + '/www'));


const wss = new WebSocketServer({
  server: server
});
wss.on('connection', (ws, req) => {
  
  
  
  const rtmpUrl = 'rtmp://a.rtmp.youtube.com/live2/MyStreamId';
  console.log('Target RTMP URL:', rtmpUrl);
  
  // Launch FFmpeg to handle all appropriate transcoding, muxing, and RTMP.
  // If 'ffmpeg' isn't in your path, specify the full path to the ffmpeg binary.
  const ffmpeg = child_process.spawn('ffmpeg', [
    // Facebook requires an audio track, so we create a silent one here.
    // Remove this line, as well as `-shortest`, if you send audio from the browser.
    //'-f', 'lavfi', '-i', 'anullsrc',
    
    // FFmpeg will read input video from STDIN
    '-i', '-',
    
    // Because we're using a generated audio source which never ends,
    // specify that we'll stop at end of other input.  Remove this line if you
    // send audio from the browser.
    //'-shortest',
    
    // If we're encoding H.264 in-browser, we can set the video codec to 'copy'
    // so that we don't waste any CPU and quality with unnecessary transcoding.
    // If the browser doesn't support H.264, set the video codec to 'libx264'
    // or similar to transcode it to H.264 here on the server.
    '-vcodec', 'copy',
    
    // AAC audio is required for Facebook Live.  No browser currently supports
    // encoding AAC, so we must transcode the audio to AAC here on the server.
    '-acodec', 'aac',
    
    // FLV is the container format used in conjunction with RTMP
    '-f', 'flv',
    
    // The output RTMP URL.
    // For debugging, you could set this to a filename like 'test.flv', and play
    // the resulting file with VLC.  Please also read the security considerations
    // later on in this tutorial.
    rtmpUrl 
  ]);
  
  // If FFmpeg stops for any reason, close the WebSocket connection.
  ffmpeg.on('close', (code, signal) => {
    console.log('FFmpeg child process closed, code ' + code + ', signal ' + signal);
    ws.terminate();
  });
  
  // Handle STDIN pipe errors by logging to the console.
  // These errors most commonly occur when FFmpeg closes and there is still
  // data to write.  If left unhandled, the server will crash.
  ffmpeg.stdin.on('error', (e) => {
    console.log('FFmpeg STDIN Error', e);
  });
  
  // FFmpeg outputs all of its messages to STDERR.  Let's log them to the console.
  ffmpeg.stderr.on('data', (data) => {
    console.log('FFmpeg STDERR:', data.toString());
  });

  // When data comes in from the WebSocket, write it to FFmpeg's STDIN.
  ws.on('message', (msg) => {
    console.log('DATA', msg);
    ffmpeg.stdin.write(msg);
  });
  
  // If the client disconnects, stop FFmpeg.
  ws.on('close', (e) => {
    ffmpeg.kill('SIGINT');
  });
  
});

    


    


    



    On the server.js file i create a websocket to receive stream data from the client side and then use FFMPEG to send the stream data over to youtube via the RTMP url

    


    Here is my client.js code

    


    

    

    const ws = new WebSocket(
             'wss://my-websocket-server.com'

        );
         ws.addEventListener('open', (e) => {
             console.log('WebSocket Open', e);
             drawVideosToCanvas();
             mediaStream = getMixedVideoStream(); // 30 FPS
             mediaRecorder = new MediaRecorder(mediaStream, {
               mimeType: 'video/webm;codecs=h264',
               //videoBitsPerSecond : 3000000000
               bitsPerSecond: 6000000
             });

             mediaRecorder.addEventListener('dataavailable', (e) => {
               ws.send(e.data);
             });
             mediaRecorder.onstop = function() {
              ws.close.bind(ws);
              isRecording = false;
              actionBtn.textContent = 'Start Streaming';
              actionBtn.onclick = startRecording;
             }
             mediaRecorder.onstart = function() {
              isRecording = true;
              actionBtn.textContent = 'Stop Streaming';
              actionBtn.onclick = stopRecording;
              screenShareBtn.onclick = startSharing;
              screenShareBtn.disabled = false;
             }
             //mediaRecorder.addEventListener('stop', ws.close.bind(ws));

             mediaRecorder.start(1000); // Start recording, and dump data every second

           });

    


    


    



    On my client.js file, i captured users camera and then open the websocket server to send the data to the server.. Every thing works fine on local host expect for when i deploy it to live server..
i am wondering if there is a bad configuration on the server.. The server is Centos 7.8 and the app was runing on Apache software
Here is how i configured the virtual host for the websocket domain

    


    

    

    ServerName my-websocket.com

  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} websocket [NC]
  RewriteCond %{HTTP:Connection} upgrade [NC]
  RewriteRule .* "ws://127.0.0.1:3000/$1" [P,L]

  ProxyPass "/" "http://127.0.0.1:3000/$1"
  ProxyPassReverse "/" "http://127.0.0.1:3000/$1"
  ProxyRequests off

    


    


    



    I don't know much about server configuration but i just thought may be the configuration has to do with why FFMPEg can not open connection to RTMP protocol on the server.

    


    here is the error am getting

    


    

    

    FFmpeg STDERR: Input #0, lavfi, from &#x27;anullsrc&#x27;:&#xA;  Duration:&#xA;FFmpeg STDERR: N/A, start: 0.000000, bitrate: 705 kb/s&#xA;    Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s&#xA;&#xA;DATA <buffer 1a="1a">&#xA;DATA <buffer 45="45" df="df" a3="a3" 42="42" 86="86" 81="81" 01="01" f7="f7" f2="f2" 04="04" f3="f3" 08="08" 82="82" 88="88" 6d="6d" 61="61" 74="74" 72="72" 6f="6f" 73="73" 6b="6b" 87="87" 0442="0442" 85="85" 02="02" 18="18" 53="53" 80="80" 67="67" ff="ff" 53991="53991" more="more" bytes="bytes">&#xA;DATA <buffer 40="40" c1="c1" 81="81" 00="00" f0="f0" 80="80" 7b="7b" 83="83" 3e="3e" 3b="3b" 07="07" d6="d6" 4e="4e" 1c="1c" 11="11" b4="b4" 7f="7f" cb="cb" 5e="5e" 68="68" 9b="9b" d5="d5" 2a="2a" e3="e3" 06="06" c6="c6" f3="f3" 94="94" ff="ff" 29="29" 16="16" b2="b2" 60="60" 04ac="04ac" 37="37" fb="fb" 1a="1a" 15="15" ea="ea" 39="39" a0="a0" cd="cd" 02="02" b8="b8" 56206="56206" more="more" bytes="bytes">&#xA;FFmpeg STDERR: Input #1, matroska,webm, from &#x27;pipe:&#x27;:&#xA;  Metadata:&#xA;    encoder         :&#xA;FFmpeg STDERR: Chrome&#xA;  Duration: N/A, start: 0.000000, bitrate: N/A&#xA;    Stream #1:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)&#xA;    Stream #1:1(eng): Video: h264 (Constrained Baseline), yuv420p(progressive), 1366x768, SAR 1:1 DAR 683:384, 30.30 fps, 30 tbr, 1k tbn, 60 tbc (default)&#xA;&#xA;FFmpeg STDERR: [tcp @ 0xe5fac0] Connection to tcp://a.rtmp.youtube.com:1935 failed (Connection refused), trying next address&#xA;[rtmp @ 0xe0fb80] Cannot open connection tcp://a.rtmp.youtube.com:1935&#xA;&#xA;FFmpeg STDERR: rtmp://a.rtmp.youtube.com/live2/mystreamid: Network is unreachable&#xA;&#xA;FFmpeg child process closed, code 1, signal null</buffer></buffer></buffer>

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    I will really appreciate if I could get some insight on what may be causing this issue or what i can do to solve it..Thanks in advance..

    &#xA;

  • stream mp4 video with node fluent-ffmpeg

    28 février 2016, par rchristian

    I’m trying to create video stream server and client with node fluent-ffmpeg, express and ejs. And a haven’t solve this for a while.
    What I want to do is to play video beginning by certain time.
    The following codes make it with Safari browser on windows but with others it makes a loop of a few seconds or it says

    video format not supported

    server code (run.js) :

    app.get('/video', function(req, res) {

     //define file path,time to seek the beegining and set ffmpeg binary
     var pathToMovie = '../videos/test.mp4';
     var seektime = 100;
     proc.setFfmpegPath(__dirname + "/ffmpeg/ffmpeg");


     //encoding the video source
     var proc = new ffmpeg({source: pathToMovie})
            .seekInput(seektime)
            .withVideoBitrate(1024)
            .withVideoCodec('libx264')
            .withAspect('16:9')
            .withFps(24)
            .withAudioBitrate('128k')
            .withAudioCodec('libfaac')
            .toFormat('mp4');

     //pipe
            .pipe(res, {end: true});
    });

    client code (index.ejs) :

     

     
       <video>
         <source src="video/" type="video/mp4"></source>
       </video>
     

    Help please. I searched everywhere solution but I didn’t find

  • can someone explain this difference between H.264 and H.265 ?

    19 janvier 2017, par Muhammad Abu bakr

    I have studied this in a research paper :

    "The off-the-shelf video codecs like H.264 handle all the movements equally. In our case there are some non moving region that lies in region of interest and need to be encode in high quality and there are some moving regions which don’t need such requirements. H.265 can help us in such circumstances."

    How H.265 deals with movements differently ?