Recherche avancée

Médias (91)

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (9099)

  • 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;

  • Redefinition of 'Picture'. isysroot is including Quickdraw.h into the build. Previous definition

    1er février 2019, par bruce

    Trying to build ffmpeg in Xcode 10.1. Getting

    Redefinition of ’Picture’

    Picture is defined in mpegpicture.h and in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/Headers/Quickdraw.h.

    I think the problem is -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk.

    How can I tell Xcode not to use the SDK frameworks ?