
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (75)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
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 (13918)
-
Writing data to a Node.js child process's stdin fails due to ECONNRESET
8 juillet 2015, par SwothProblem
Passing data to a child process’s stdin seems to fail. It fails due to an ECONNRESET after writing the data.Context
I am developing a small programm that is supposed to render a video, as fast as possible, based on frames captured from a canvas. The animation is rendered to a headless canvas implementation using Rekapi (JavaScript animation framework). The headless canvas is a Node.js module called node-canvas by Automattic. The animation frames are rendered one after another, after each rendering the frame is retrieved using canvas.getImageData().data (Uint8ClampedArray - rgba, faster than canvas.toDataUrl) and put into an array. Every frame is supposed to be send to ffmpeg to create a video.Rekapi -> canvas -> getImageData -> array -> ffmpeg
What I do
I already tried various possibilities to pipe that data to ffmpeg. In general I created a child process in Node.js executing ffmpeg :var spawn = require('child_process').spawn;
var child = spawn('ffmpeg', [
'-pix_fmt', 'rgba',
'-s','1280x720',
'-r', 25,
'-f', 'rawvideo',
'-vcodec', 'rawvideo',
'-i', '-', // read frames from stdin
'-threads', 0, // use all cores
'test.mpg']);Now I write my array data to the child’s stdin :
for(var i = 0; i < dataArray.length; ++i){
var buffer = new Buffer(dataArray[i]);
child.stdin.write(buffer);
console.log('wrote: ' + i);
}I wrote 25 frames this way. The console displays the following :
wrote: 24
wrote: 25
events.js:85
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at Pipe.onread (net.js:559:26)ffmpeg generated a 0 byte test.mpg.
I am very new to Node.js, thus I might not understand the big picture of it’s child processes. -
how to convert an rstp ffmpeg mp4 buffer into ImageData inside nodejs (nestjs)
23 décembre 2022, par distanteI am reading an rtsp stream using ffmpeg in this way :


const ffmpegArgs = [
 '-rtsp_transport',
 'tcp',
 '-i',
 this.rtspStreamPath,
 '-vcodec',
 'copy',
 '-f',
 'mp4',
 '-movflags',
 'frag_keyframe+empty_moov',
 '-reset_timestamps',
 '1',
 '-vsync',
 '1',
 '-flags',
 'global_header',
 '-bsf:v',
 'dump_extra',
 '-y',
 '-', // output to stdout
 ];
 const liveffmpeg = spawn(ffmpegPath, ffmpegArgs, {
 detached: false,
 });

 liveffmpeg.stdout.on('data', (data) => {
 console.log('data here!', data.toString());
 });



Later I pipe the
liveffmpeg.stdout
to theresponse
object of my NestJS controller so it can be consumed by the frontend in avideo
HTML Element.

In the frontend I calculate this by doing a snapshot of the video element into a canvas, getting the
ImageData
from thecanvasContext
and doing my calculations after I get two or more updates.

Now I need to do the exact same thing on the backend but I am not able to convert the
data
value fromliveffmpeg.stdout.on('data', )
into an ImageData so I can use the same average function I use in the frontend.

I already installed node-canvas to try to reproduce the frontend steps but to be able to draw something inside the canvas context I need an
Image
and noVideo
object can be constructed in nodejs.

So, is there a way to convert the stdout data of the
FFmpeg
process intoImageData
objects ? Or, to extract the images of each data update so I can manually draw them on the node-canvas element and get theImageData
?

Thanks !


PDd : I think convert them into
Uint8ClampedArray
could also work sincenode-canvas
has a function that uses that :createImageData(data: Uint8ClampedArray, width: number, height?: number) => ImageData


-
How to impose PNG stream over exist video using ffmpeg and image2pipe ?
16 avril 2019, par Михаил МагомедовI reproduce the steps of this article with nodeJs :
https://blog.scwu.io/rendering-canvas-to-mp4-using-nodejs/
I not need to generate a new video from the stream of png pictures, me need impose png stream over exist video, please tell me how to do it ?
var recorder = spawn("ffmpeg", [
"-y", "-f", "image2pipe",
"-vcodec", "png", "-r", "60",
"-i", "-", "-vcodec", "h264",
"-r", "60", "output.mp4"
]);
for(var i = 0; i<100; i++){
...some ctx processing
let url = canvas.toDataURL(),
data = atob( url.substring(url.indexOf("base64") + 7) );
recorder.stdin.write(data, "binary");
}
recorder.stdin.end();