
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (20)
-
Qualité du média après traitement
21 juin 2013, parLe 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, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP 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 -
How to live video stream using node API (Read file with chunk logic)
28 septembre 2023, par Mukesh Singh ThakurI 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






 
 
 
 



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






package.json


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



-
How to live video stream using node API(Read file with chunk logic)
28 septembre 2023, par Mukesh Singh ThakurI 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






 
 
 
 



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






package.json


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