Recherche avancée

Médias (91)

Autres articles (20)

  • Qualité du média après traitement

    21 juin 2013, par

    Le bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
    Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • 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 (6542)

  • avcodec/h264_metadata_bsf : remove AUDs at any position

    29 janvier 2023, par Gyan Doshi
    avcodec/h264_metadata_bsf : remove AUDs at any position
    

    Some files, likely due to faulty packetization or muxing, can have AUDs
    at other positions besides the head unit of a packet. Remove these too.

    • [DH] libavcodec/h264_metadata_bsf.c
  • How to live video stream using node API (Read file with chunk logic)

    28 septembre 2023, par Mukesh Singh Thakur

    I want to make a live video streaming API and send the video buffer chunk data to an HTML.
I am using rtsp URL.
The chunk logic does not work. The video only plays for 5 seconds then stops.

    


    index.js file

    


    const express = require('express');
const ffmpeg = require('fluent-ffmpeg');
const fs = require('fs');
const path = require('path');

const app = express();
const port = 3000;

app.get('/', (req, res) => {
  res.sendFile(__dirname + "/index.html");
});

const rtspUrl = 'rtsp://zephyr.rtsp.stream/movie?streamKey=64fd08123635440e7adc17ba31de2036';
const chunkDuration = 5; // Duration of each chunk in seconds


app.get('/video', (req, res) => {
  const outputDirectory = path.join(__dirname, 'chunks');
  if (!fs.existsSync(outputDirectory)) {
    fs.mkdirSync(outputDirectory);
  }

  const startTime = new Date().getTime();
  const outputFileName = `chunk_${startTime}.mp4`;
  const outputFilePath = path.join(outputDirectory, outputFileName);

  const command = ffmpeg(rtspUrl)
    .inputFormat('rtsp')
    // .inputOptions(['-rtsp_transport tcp'])
    .videoCodec('copy')
    .output(outputFilePath)
    .duration(chunkDuration)
    .on('start', () => {
      console.log(`start ${outputFileName}`);
    })
    .on('end', () => {
      console.log(`Chunk ${outputFileName} saved`);
      res.setHeader('Content-Type', 'video/mp4');
      res.sendFile(outputFilePath, (err) => {
        if (err) {
          console.error('Error sending file:', err);
        } else {
          fs.unlinkSync(outputFilePath); // Delete the chunk after it's sent
        }
      });
    })
    .on('error', (error) => {
      console.error('Error: ', error);
    });

  command.run();
});

app.listen(port, () => {
  console.log(`API server is running on port ${port}`);
});


    


    index.html

    


    &#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;  <video width="50%" controls="controls" autoplay="autoplay">&#xA;    <source src="/video" type="video/mp4"></source>&#xA;    Your browser does not support the video tag.&#xA;  </video>&#xA;&#xA;&#xA;&#xA;

    &#xA;

    package.json

    &#xA;

    {&#xA;.....&#xA;  "scripts": {&#xA;    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",&#xA;    "start": "nodemon index.js"&#xA;  },&#xA;.....&#xA;}&#xA;

    &#xA;

  • How to live video stream using node API(Read file with chunk logic)

    28 septembre 2023, par Mukesh Singh Thakur

    I want to make a live video streaming API and send the video buffer chunk data to an HTML.&#xA;I am using rtsp URL.&#xA;The chunk logic does not work. The video only plays for 5 seconds then stops.

    &#xA;

    index.js file

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;&#xA;const app = express();&#xA;const port = 3000;&#xA;&#xA;app.get(&#x27;/&#x27;, (req, res) => {&#xA;  res.sendFile(__dirname &#x2B; "/index.html");&#xA;});&#xA;&#xA;const rtspUrl = &#x27;rtsp://zephyr.rtsp.stream/movie?streamKey=64fd08123635440e7adc17ba31de2036&#x27;;&#xA;const chunkDuration = 5; // Duration of each chunk in seconds&#xA;&#xA;&#xA;app.get(&#x27;/video&#x27;, (req, res) => {&#xA;  const outputDirectory = path.join(__dirname, &#x27;chunks&#x27;);&#xA;  if (!fs.existsSync(outputDirectory)) {&#xA;    fs.mkdirSync(outputDirectory);&#xA;  }&#xA;&#xA;  const startTime = new Date().getTime();&#xA;  const outputFileName = `chunk_${startTime}.mp4`;&#xA;  const outputFilePath = path.join(outputDirectory, outputFileName);&#xA;&#xA;  const command = ffmpeg(rtspUrl)&#xA;    .inputFormat(&#x27;rtsp&#x27;)&#xA;    // .inputOptions([&#x27;-rtsp_transport tcp&#x27;])&#xA;    .videoCodec(&#x27;copy&#x27;)&#xA;    .output(outputFilePath)&#xA;    .duration(chunkDuration)&#xA;    .on(&#x27;start&#x27;, () => {&#xA;      console.log(`start ${outputFileName}`);&#xA;    })&#xA;    .on(&#x27;end&#x27;, () => {&#xA;      console.log(`Chunk ${outputFileName} saved`);&#xA;      res.setHeader(&#x27;Content-Type&#x27;, &#x27;video/mp4&#x27;);&#xA;      res.sendFile(outputFilePath, (err) => {&#xA;        if (err) {&#xA;          console.error(&#x27;Error sending file:&#x27;, err);&#xA;        } else {&#xA;          fs.unlinkSync(outputFilePath); // Delete the chunk after it&#x27;s sent&#xA;        }&#xA;      });&#xA;    })&#xA;    .on(&#x27;error&#x27;, (error) => {&#xA;      console.error(&#x27;Error: &#x27;, error);&#xA;    });&#xA;&#xA;  command.run();&#xA;});&#xA;&#xA;app.listen(port, () => {&#xA;  console.log(`API server is running on port ${port}`);&#xA;});&#xA;

    &#xA;

    index.html

    &#xA;

    &#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;  <video width="50%" controls="controls" autoplay="autoplay">&#xA;    <source src="/video" type="video/mp4"></source>&#xA;    Your browser does not support the video tag.&#xA;  </video>&#xA;&#xA;&#xA;&#xA;

    &#xA;

    package.json

    &#xA;

    {&#xA;.....&#xA;  "scripts": {&#xA;    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",&#xA;    "start": "nodemon index.js"&#xA;  },&#xA;.....&#xA;}&#xA;

    &#xA;