
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (79)
-
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" (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette 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 (10001)
-
Node.JS Live Streaming Audio with FFMPEG
20 avril 2021, par nicnacnicI'm trying to create an Express server to live stream audio captured from another application (Discord in this case). I'm able to get a server up and running, but there are a couple issues that need to be solved. Here's my server code so far.


const app = express();
app.get("/", function(req, res) {
 res.sendFile(__dirname + "/index.html");
});
app.get("/audio", function(req, res) {
 const stream = ffmpeg(audio).inputOptions(["-f", "s16le", "-ar", "48k", "-ac", "2"]).format('wav');
 res.writeHead(200, { "Content-Type": "audio/wav" });
 stream.pipe(res);
});
app.listen(8080)



- 

- Silent sections of audio need to be added. When there's no activity on the input, there's no data written to the
audio
variable. This causes weird behavior, for example I can speak and the audio comes through a second later. Then, if I wait 10 seconds then speak again, the audio comes through 4-5 seconds later. I believe this is a problem with the way I'm using ffmpeg to transcode, but I have no idea how to fix it. - Refreshing the client crashes the program. Every time I refresh the client I get an ffmpeg error.
Error: Output stream closed
. This error doesn't happen if I close it, only on reload. - The audio is not synced between clients. Every time I open a new connection, the audio starts playing from the beginning instead of being synced with each other and playing the audio live.








This is how it's supposed to work : it captures audio from my app in PCM, converts the audio to WAV with ffmpeg, and then streams the audio live to the clients. The audio needs to be synced with all the clients as best as possible to reduce delay. And I'm using fluent-ffmpeg instead of just regular ffmpeg for the transcoding.
Thanks !


- Silent sections of audio need to be added. When there's no activity on the input, there's no data written to the
-
How to use ffmpeg to convert video into the audio format with nodejs and angular in web app
31 août 2021, par Amir ShahzadI want to convert the video into the audio format using ffmpeg in nodejs but I not know how I can implement it in the angular app with nodejs.


This is my nodejs code


const express = require('express');
 const ffmpeg = require('fluent-ffmpeg');
 const fileUpload = require('express-fileupload');
 const cors = require('cors')
 const app = express();

 app.use(fileUpload({
 useTempFiles: true,
 tempFileDir: 'temp/'
 }));
 app.use(express.json());
 app.use(express.urlencoded({ extended: true }));
 app.use(cors({ origin: 'http://localhost:4200' }));

 ffmpeg.setFfmpegPath('/usr/bin/ffmpeg');

 // Converting mp4 to audio
 app.post('/mp4tomp3', (req, res) => {
 res.contentType('video/avi');
 res.attachment('output.mp3');
 req.files.mp4.mv("temp/" + req.files.mp4.name , function(err) {
 if(err){
 res.sendStatus(500).send(err)
 }else{
 console.log("Fiel Uploaded Successfully.!");
 }
 });
 ffmpeg('temp/' + req.files.mp4.name)
 .toFormat('mp3')
 .on('end', function() {
 console.log('Done');
 })
 .on('error', function(err){
 console.log('An Error Occured' + err.message)
 })
 .pipe(res, {end: true})
 })

 app.listen(3000, () => {
 console.log('Server Start On Port 3000')
 })



This code is working good when I use index.html file in the nodejs app but its give an error while I remove index.html file and use angular app for frontend then it give error in nodejs mp4 not defined and name mv is not defined Please tell me how I can implement it using angular framework


This is my app.component.html file


<div class="container">
 <h1>Video Proccessing App</h1>
 <form>
 <input type="file" formcontrolname="mp4" />
 <input type="submit" value="Convert" />
 </form>
 </div>
 



This is my app.component.ts file


import { Component, OnInit } from '@angular/core';
 import { FormBuilder, FormGroup, Validators } from '@angular/forms';
 import { VideoConversionService } from 'src/services/video-conversion.service';

 @Component({
 selector: 'app-root',
 templateUrl: './app.component.html',
 styleUrls: ['./app.component.css']
 })
 export class AppComponent implements OnInit {

 submitted =false;
 form! : FormGroup
 data:any


 constructor(private formBuilder: FormBuilder,
 private videoService: VideoConversionService){}


 creatForm(){
 this.form = this.formBuilder.group({
 mp4: ['', Validators.required],
 });
 }
 ngOnInit(): void {
 this.creatForm();

 }


 convertVideo(){
 this.submitted = true
 this.videoService.conversion(this.form.value).subscribe(res => {
 this.data = res;
 // console.log(this.data)
 //console.log(this.form.value)
 })
 }

 }



This is my service file for handling the backend api in my angular app


import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
 providedIn: 'root'
})
export class VideoConversionService {

constructor(private httpClient: HttpClient) { }

conversion(data: any){
 return this.httpClient.post('http://localhost:3000/mp4tomp3', data)
}
}



This is Screenshot of chrome error




This is the screenshot of the nodejs app error while I click on the convert button




-
Decoding a FFMPEG Buffer video Streaming using websocket for processing with OpenCV ?
4 octobre 2019, par Alexis MenesesI am having a problem trying to get a frame from a streaming that I am doing on a web socket.
I am sending my data from a webcam with ffmpeg using this command :ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -f mpeg1video -b:v 800k -r 30 http://localhost:8092
Later, I get that stream and broadcast on a node js server with the following code :
var childProcess = require('child_process')
, express = require('express')
, http = require('http')
, morgan = require('morgan')
, ws = require('ws');
// configuration files
var configServer = require('./lib/config/server');
// app parameters
var app = express();
app.set('port', configServer.httpPort);
app.use(express.static(configServer.staticFolder));
app.use(morgan('dev'));
// serve index
require('./lib/routes').serveIndex(app, configServer.staticFolder);
// HTTP server
http.createServer(app).listen(app.get('port'), function () {
console.log('HTTP server listening on port ' + app.get('port'));
});
var STREAM_MAGIC_BYTES = 'jsmp'; // Must be 4 bytes
var width = 320;
var height = 240;
// WebSocket server
var wsServer = new (ws.Server)({ port: configServer.wsPort });
console.log('WebSocket server listening on port ' + configServer.wsPort);
wsServer.on('connection', function(socket) {
var streamHeader = new Buffer(8);
streamHeader.write(STREAM_MAGIC_BYTES);
streamHeader.writeUInt16BE(width, 4);
streamHeader.writeUInt16BE(height, 6);
socket.send(streamHeader, { binary: true });
console.log(streamHeader);
console.log('New WebSocket Connection (' + wsServer.clients.length + ' total)');
socket.on('close', function(code, message){
console.log('Disconnected WebSocket (' + wsServer.clients.length + ' total)');
});
});
wsServer.broadcast = function(data, opts) {
for(var i in this.clients) {
if(this.clients[i].readyState == 1) {
this.clients[i].send(data, opts);
}
else {
console.log('Error: Client (' + i + ') not connected.');
}
}
};
// HTTP server to accept incoming MPEG1 stream
http.createServer(function (req, res) {
console.log(
'Stream Connected: ' + req.socket.remoteAddress +
':' + req.socket.remotePort + ' size: ' + width + 'x' + height
);
req.on('data', function (data) {
wsServer.broadcast(data, { binary: true });
});
}).listen(configServer.streamPort, function () {
console.log('Listening for video stream on port ' + configServer.streamPort);
});
module.exports.app = app;I am getting successfully the data from this.clients[i].send(data, opts) on my python program, but I dont know how to decode the information to process the image with opencv. Any idea ?
What I want to do is :
import asyncio
import websockets
import cv2
async def hello():
uri = "ws://192.168.1.170:8094" #URL of the websocket server
async with websockets.connect(uri) as websocket:
inf = await websocket.recv()
# Process the data in order to showimg with opencv.
print(inf)
asyncio.get_event_loop().run_until_complete(hello())