
Recherche avancée
Autres articles (76)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
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 (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (11684)
-
How to pipe rgba data using Node.js to ffmpeg ?
7 juillet 2015, par SwothContext
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
Problem
Everything except the transfer of stored rgba-array-data to ffmpeg works. I don’t seem to manage the transport using Node.js. How do I pass my frames to ffmpeg using Node.js and what did I do wrong ?What I do
The code below renders and saves each frame as rgba data to an array. The renderScene-function renders each animation frame.console.log("Rendering getImageData, length:"+ videoLength);
var dataArray = [];
function imageDataCallback() {
dataArray.push(context.getImageData(0, 0, 1280, 720).data);
}
rekapi.on('afterUpdate', imageDataCallback);
var time = Date.now();
renderScene(rekapi);
console.log('Time used: ' + (Date.now() - time) + 'ms;');
rekapi.off('afterUpdate', imageDataCallback);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']);I also tried using
-i pipe:0
, which is the same as -i -, just to be sure.
After process creation i registered for various events to know what happens :child.on('error', function(error){
console.log(error);
});
child.stdin.on('data', function (data) {
console.log('data retrieved')
});
child.on('exit', function (code) {
console.log('child exit with code:' + code)
});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 and as it seems no definded child-callback (like data) except error has been called. I am not 100% sure about the lifecycle but, as I understood, data should be called each time I write something.
I am very new to Node.js, thus I might not understand the big picture of it’s child processes.
Since my reputation is too low I am not allowed to post more than 2 links (first question) and I don’t feel comfortable using non-typed languages like JavaScript.
-
FFmpegMediaPlayer : findLibrary returned null
8 août 2015, par IceJOKERI use https://github.com/wseemann/FFmpegMediaPlayer in my applicaton, but some Adndroid device throw exception :
java.lang.ExceptionInInitializerError
at ru.mypackage.PlayService.initPlayer(PlayService.java:74)
at ru.mypackage.PlayService.onCreate(PlayService.java:68)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1949)
at android.app.ActivityThread.access$2500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load avutil: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
at wseemann.media.FFmpegMediaPlayer.<clinit>(FFmpegMediaPlayer.java:620)
... 13 more
</clinit>[![enter image description here][3]][3]
Can somebody explain me what’s wrong there ?
On my device and some other device the app working nice, but on some device (for example : Galaxy Ace (GT-S5830i) Android 2.3.3 - 2.3.7) it throw the exception.p.s. about "lib" prefix I understood ( http://developer.android.com/intl/ru/reference/java/lang/System.html#mapLibraryName(java.lang.String) )
-
FFmpeg memory growing in avcodec_decode_video2
21 juillet 2015, par Wendy PanI am using C# to call the ffmpeg lib.
I use the example code to decode an video in the MP4 format.However, I found out that the memory grows a lot (like 10MB), when I called the avcodec_decode_video2 function.
The memory keeps growing until I called the avcodec_close(&CodecContext) function.
I suppose the reason may be that AVCodecContext alloc 10MB data during the call of avcodec_decode_video2 function. And this memory will not be released until the AVCodecContext is closed.
I do not know if I am right.
Main codes are in the following.
private bool readNextBuffer(int index)
{
/// Read frames into buffer
//m_codecContext->refcounted_frames = 0;
int frameNumber = 0;
FrameBuffer[index].Clear();
GC.Collect();
while (frameNumber < m_bufferSize)
{
AVPacket Packet; /// vedio packet
AVPacket* pPacket = &Packet;
//AVFrame* pDecodedFrame = FFmpegInvoke.avcodec_alloc_frame();
AVFrame* pDecodedFrame = FFmpegInvoke.av_frame_alloc();
if (FFmpegInvoke.av_read_frame(m_pFormatContext, pPacket) < 0)
{
Console.WriteLine("The end of the vedio.");
break;
}
if (pPacket->stream_index == pStream->index)
{
/// Decode vedio frame
int gotPicture = 0;
int size = FFmpegInvoke.avcodec_decode_video2(m_codecContext, pDecodedFrame, &gotPicture, pPacket);
if (size < 0)
{
Console.WriteLine("End of the vedio.");
//throw new Exception(string.Format("Error while decoding frame {0}", frameNumber));
break;
}
if (gotPicture == 1)
{
/// Allocate an AVFrame structure
if (convertFrame(pDecodedFrame, index))
{
frameNumber++;
}
else
{
Console.WriteLine("Error: convert failed.");
}
}
}
FFmpegInvoke.av_frame_free(&pDecodedFrame);
FFmpegInvoke.av_free_packet(pPacket);
GC.Collect();
}
nowFrameIndex = 0;
return FrameBuffer.Count > 0 ? true : false;
}